Capgemini interview question

Asked to solve pseudocode puzzles.