Find a lesson, question or project

Start typing to search published content and planned structures.

↑ ↓ moveEnter openEsc close
ACTIVE-LEARNING TRACE

LRU cache simulator

Predict each cache decision, then reveal how recency changes and why capacity forces an eviction.

Use 1 to 15 short keys separated by commas. Capacity may be 1 to 6.
RULEWaiting for a request
for (String key : requests) {
  if (cache.contains(key)) {
    moveToMostRecent(key);
  } else if (cache.isFull()) {
    evictLeastRecent();
    insertAsMostRecent(key);
  }
}
Incoming keyNoneWaiting
MOST RECENTLY USEDLEAST RECENTLY USED
Hit and movedMiss and insertedLRU evicted
Step 0 of 0

Keyboard: focus this simulator, then use ← → to step, Home End to jump, Space to play or pause, and R to reset.

Planned for later

Topics in this subsection

These concepts remain visible as a preview of the learning path, but they stay quieter than published articles.

01
PLANNED CONCEPT

Cache aside

02
PLANNED CONCEPT

Read through and write through

03
PLANNED CONCEPT

TTL and eviction

04
PLANNED CONCEPT

Invalidation

05
PLANNED CONCEPT

Distributed caches

06
PLANNED CONCEPT

Cache failure