Goldman Sachs interview question

two coding test.