Oracle Interview Question

2 DSA question and 1 puzzle.