Referring to LRU cache design
I have a question regarding the answer.
Say my hash map is full (the interviewer gave me a max size) [I understand if I need to fetch a pair already present in the map I'll move the list entry to the front to indicate recent use.]
But, what if I have an entry which is to be added and this key hashes to same position as a different key. (Collision) How do I go about it?
DO I do chaining or probing? If I do chaining, should I increase the map size? If I remove the oldest entry it empties a location in my hash map. But a new entry might not hash to this location? It might hash to another full entry? (Different Key, Value Pair) How to solve this?