Morgan Stanley Interview Question

It’s related to data structure, iteration over map,