Morgan Stanley interview question

generic sort method