GlobalLogic interview question

Discussion on Core Java, DS and puzzles