Morgan Stanley interview question

Implementation, coding questions