Morgan Stanley interview question

HashMap functioning