Goldman Sachs interview question

First two are coding problems and the rest are maths & statistics