Pregunta de entrevista de Goldman Sachs

one code question and two behaviour question