Oracle Interview Question

Prepare on puzzles. Puzzles were tough.