This question evaluates a candidate's understanding of data structures and algorithms for implementing an LRU cache, including choice of data structures, constant-time access and eviction policies, and correct handling of recency updates on reads and writes.
Design and implement a least-recently-used (LRU) cache with a fixed capacity. Support get(key) -> value and put(key, value) in average O(