Capgemini Engineering interview question

Interview puzzles