Morgan Stanley interview question

How to implement a median finding algorithm?