Sainsbury’s interview question

Solved a chess problem and an API problem