Microsoft interview question

HashMap based questions around occurrences