Morgan Stanley interview question

Asked to code production level application in core java :D