Goldman Sachs Interview Question

two coding test.