Pregunta de entrevista de J.P. Morgan

Quant puzzles, Sorting based questions