Apple interview question

A chessboard problem and it’s variations