~learn.
Learn · code labs · free

Build it yourself.

More interviews now include an “implement this component” round: a rate limiter, an LRU cache, a consistent hashing ring. Each lab here is one of those, taken straight from a lesson. Write Python in the browser and run it against example tests and hidden edge cases.

0/8 cleared690 XP to earnPython 3.14 · runs on your device

World 01Data at Scale

  1. LAB · W01 · RATE LIMITINGNEWToken bucket rate limiterRefill by elapsed time, spend tokens per request, allow bursts up to capacity, and tell a rejected client when to retry.From W01 · D3 · Rate Limiting at ScaleEasy~25 min4 + 9 hidden tests+60 XP
  2. LAB · W01 · RATE LIMITINGNEWSliding window counter rate limiterTwo counters per key and a weighted estimate fix the fixed window's boundary burst, in O(1) memory.From W01 · D3 · Rate Limiting at ScaleMedium~30 min2 + 9 hidden tests+90 XP
  3. LAB · W01 · PARTITIONINGNEWConsistent hashing ring with virtual nodesHash nodes and keys onto a ring, walk clockwise with binary search, and prove that adding a node only moves the keys it takes over.From W01 · D1 · Partitioning Deep-DiveMedium~35 min3 + 9 hidden tests+90 XP

World 02Failure-First Design

  1. LAB · W02 · IDEMPOTENCYNEWIdempotency-key storeA retried payment returns the first response instead of charging twice, a reused key with a different body is refused, and failures can be retried.From W02 · D2 · Idempotency in PracticeMedium~35 min3 + 10 hidden tests+90 XP
  2. LAB · W02 · FAILURE HANDLINGNEWCircuit breaker state machineCLOSED, OPEN and HALF-OPEN with a sliding failure window, a recovery timer on a fake clock, and business errors that don't trip it.From W02 · D3 · Circuit BreakersMedium~35 min3 + 10 hidden tests+90 XP
  3. LAB · W02 · RETRIESNEWRetry with exponential backoff and full jitterRetry only what can succeed later, wait base × 2^attempt capped, pick a random point below it, and honour Retry-After.From W02 · Preview · Failure-First Design PreviewEasy~25 min2 + 10 hidden tests+60 XP

World 03Messaging and Async Processing

  1. LAB · W03 · MESSAGINGNEWTransactional outbox relayWrite the order and its event in one transaction, relay events in order, survive a crash between publish and mark, and dedupe in the consumer.From W03 · D2 · Transactional OutboxHard~45 min2 + 10 hidden tests+120 XP

World 04Caching

  1. LAB · W04 · CACHINGNEWLRU cache in O(1)A hash map plus a doubly linked list gives O(1) get and put with least-recently-used eviction. No OrderedDict.From W04 · D1 · Caching PatternsMedium~35 min3 + 9 hidden tests+90 XP