Morgan Stanley interview question

Data Structure and Algorithm based