Morgan Stanley Interview Question

HashMap functioning