J.P. Morgan interview question

Quant puzzles, Sorting based questions