Morgan Stanley Interview Question

How to implement a median finding algorithm?