Goldman Sachs interview question

one code question and two behaviour question