This question was asked to me in an interview. I think the only way to get best solution is SOF. So the question was \"How would you implement a custom HashMap in java(A
You should use one dimensional array. Object[] arr.
The index of the array is the normalized hashcode from the Key object. The array holds the Pair.
The reason the value consists of both Key and Value is that if there is any hash collision , it has to go thru the list of keys inside the slot and find out which is the correct key (using equals on the key object).