Goldman Sachs Interview Question

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