Morgan Stanley interview question

Classes and design