I recently had an interview to save a huge amount of employee data in DS.
I gave a solution as a Hashmap with emp Id as the key.
The next question was whether the user wants to search by name, how to implement it. I suggested using emp as the key and keeping all employees with the same name as Arraylist.
The next next question was difficult, you need to create ONE map where the user can search based on the name emp Id or emp. How to implement this on a map?
Implement it in memory in an efficient way.
Lathy source
share