Morgan Stanley interview question

Java Core