Morgan Stanley interview question

To solve a matrix searching problem and how to optimize it