Morgan Stanley Interview Question

Classes and design