LRU Cache with Thread-Safe Extension

Asked at LinkedIn · Coding Questions · Difficulty: Medium · Last asked Jan 22, 2026

Both operations must be `O(1)` amortized. The canonical structure is a doubly-linked list of `(key, value)` nodes plus a hashmap `key -> node`; access splices the node to the head, eviction drops the tail.

Loading the problem…