Morgan Stanley Interview Question

generic sort method