cache-low-level-system-design icon indicating copy to clipboard operation
cache-low-level-system-design copied to clipboard

Wrong Behaviour When Adding a Key Again

Open guptamohit24 opened this issue 5 months ago • 0 comments

Case - Adding the key which is already exist in the Cache with some new value

Expected Behaviour -

Update the value associated with the key. Mark the key as recently used — move it to the "most recently used" position in linked list(At the last as per current implementation) Do NOT increase the size of the cache.

Actual Behaviour - Eldest Key is removed unnecessary

Image

guptamohit24 avatar Jun 12 '25 19:06 guptamohit24