Goldman Sachs interview question

Data structure