GlobalLogic interview question

Hashmap internal working