PwC Interview Question

Core Java ,Collections, Basic SQL and a puzzle.