I recently interviewed with Indeed, and every one of the interviewers asked me how a hashmap is implemented (like separate chaining and complexity)? Either they don't have a coordination between them, or it's a very important part of the organization. Any thoughts/experiences?
Hash map is important to all large data driven companies. Anyone could build Indeed in their basement, they want to make sure you are that guy and not some scammer. Hash map super valuable.
I get that thoroughly, hashmap is important and one must know the tradeoffs vs gains of using hashmap, but would every interviewer ask its implementation?
Well, if you have a “canned answer” and don’t truly understand the concept, they could smoke out useless people with the strategy. The black and white of the matter is that there are multiple implementations, companies like chained hashing. They want to C prime number table sizes. If your doing bro tables nobody likes U.
Was this a frontend interview?
No! Backend.
You’re leaving Apple for indeed?
Yo mama so big she doesn't fit in a hash map
Yo mamma so fat I solved Leetcode 114. "Flatten Binary Tree to Linked List" in O(1) time by asking her to sit on it.
Bummer what location and questions? They are supposed to coordinate but maybe messed it up.
The other questions were different, problems were unique, but during the solution process, almost every-time a hash implementation came up and they asked me to define how it works.
Did you answer the same ?
I gave almost similar answers to everyone, described the list impl with modulo, then separate chaining and concluded with open addressing.
Lol I do tech interviews at indeed. We don't coordinate between interviews to reduce bias so this can sometimes happen (we coordinate after out feedback is individually submitted to avoid spillover between evaluation groups) - sorry about that. Almost all of our our whiteboard questions can be answerable with something like a simple list or hashmap but we are seeing if you could use something more appropriate (heap/queue/stack/tree) instead. It would be concerning though if the interviewers were actively pushing you for a hash map solution only though.
Well, let me be clear, the questions were unique, and we did explore solution using various data-structures, such as heap, tries etc, however, hashing of string usually comes in most of the scenarios, when you are discussing extensibility or larges aspects of design. For example, in my description of Trie, I used Trie as a map, again for load balancing in cluster for a totally different question, I used consistent hashing to avoid hot spots. So you see, "hash" is discussed generally.
Tell them it’s implemented in the JDK and you would use the implementation as is 😉