Pregunta de entrevista de Randstad US

Standard question, in personal interview client asked to write algorithm and sql statements.