Domanda di colloquio di Oracle

Question on puzzles, and programming was asked