Cognizant interview question

code for hash map