Back to All 30 System Design Questions
LLDMediumQuestion 4 of 30
Design an In-Memory LRU / LFU Eviction Cache
Design and implement a thread-safe, high-concurrency in-memory Least Recently Used (LRU) cache supporting true O(1) get and put operations, TTL expirations, and fine-grained concurrent locking.
Asked by:GoogleMicrosoftAmazonSalesforce
#Low Level Design#Data Structures#Concurrency#Double Linked List#O(1) Algorithms
Object-Oriented Class Hierarchy
Compiling architecture diagram...
In-Memory LRU Cache
Combines a Hash Table with a Doubly Linked List with Sentinel dummy head/tail nodes for guaranteed O(1) get, put, and eviction operations. Supports lock striping to scale across concurrent CPU threads.