Design an LRU Cache
Asked at Amazon · Coding & Leetcode-style Questions · Difficulty: Medium · Last asked Apr 28, 2026
Build a fixed-capacity cache that evicts the least recently used entry. Reading an existing key and inserting or updating a key both make that key the most recently used. The implementation must support long operation sequences without scanning all entries.
Loading the problem…