Bloomberg interview question

How it's implemented a HashMap?

Interview Answer

Anonymous

Jan 29, 2016

That is a funny question, because standard HashMap Java implementation (and C++ unordered_map as well) use one of the worst possible implementations - buckets of linked lists. Instead of open addressing, which is much more cache friendly and beats the linked lists performance by a great deal (not even speaking about memory allocations which make the linked lists even much worse).