Skip to content

Build an LRU Cache

Build the canonical O(1) LRU cache with a hash map + doubly-linked list. Then add TTL, sharding, metrics, and concurrency. By the end you'll understand caches in the kernel page cache, browser disk cache, Memcached, and Redis.

beginnerFree2 hours8 lessons
Start learningor sign up to track progress

Curriculum

Loading reference solution…
Build an LRU Cache