Pregunta de entrevista de Uber

Hashmap and to find efficient implementation for a method