S01 · The Bootsector · L-01

LRU Eviction Debug

Difficulty
easy
Type
debugging
Session
Quick
Stack
Go go1.22
Domain
Core Algorithms
Est. solve
~20 min

01 · The task

A fixed-capacity cache is dropping the wrong keys: under some access patterns it discards entries that should have survived and holds on to ones a true LRU would have evicted first. Dig into how it tracks usage over time and get its eviction order back in line with least-recently-used.

02 · Constraints

  • No external dependencies

    Solve it with the standard library only.

03 · Skills exercised

bug-localizationPinpointing the single faulty site from a failing behavior — read before you patch.data-structuresChoosing and correctly wiring the structure (list, map, heap) the problem needs.

How to playDaemon

The whole level runs through the local promptly daemon — it pulls the workspace, captures your token usage, tests locally, and submits the ranked run.

  1. Pair this machine

    One-time — approve the code under your devices.

    promptly pair
  2. Pull the workspace

    Downloads the starter kit into lru/ and starts the solve clock — cd in before the next step.

    promptly init lru
  3. Start the captured session

    Then drive your AI tool — the daemon meters every prompt and token live.

    promptly start
  4. Submit for ranked grading

    Runs the full hidden suite and ends the attempt.

    promptly submit

Or combine steps 02–03 into one commandShortcut

promptly play pulls the workspace, launches the daemon, and starts the captured session in a single step — the same as running init then start. Then cd lru and drive your harness.

promptly play lru