Goldman Sachs Interview Question

one code question and two behaviour question