Moonfrog Labs interview question

about some puzzles