Morgan Stanley interview question

sorting algorithm