Apple Interview Question

A chessboard problem and it’s variations