🎉 October Learning Month — learn a new software term every day!
An interactive flashcard trainer for software engineering terms.

LRU Cache

In plain terms

A cache that evicts the least-recently-used item when full.

Going deeper

An LRU cache keeps a bounded set of items, discarding whichever hasn't been accessed longest to make room. It approximates keeping 'hot' data available.

Under the hood

Typically a hash map plus a doubly-linked list gives O(1) get and put; a classic interview and systems-design problem.

Examples

CPU/page caches, web caches, browser caches, memoization with limits.

Think of it like...

Like a small fridge: when full, you toss whatever you haven't touched in the longest.

Feedback & Bug Report