Pregunta de entrevista de Goldman Sachs

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