Goldman Sachs interview question

core java, DS/algo, puzzles