Oracle interview question

Problem solving, Java, Rest, Puzzles ,Reasoning