~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.

read the guide →
0/16 cleared1380 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

World 05Consistency and Coordination

  1. LAB · W05 · CONFLICT DETECTIONNEWVector clocks with siblingsCompare and merge vector clocks, keep concurrent writes as siblings instead of losing one, and let a write that saw both collapse them.From W05 · D4 · Conflict ResolutionMedium~35 min3 + 9 hidden tests+90 XP

World 06Real-Time Delivery

  1. LAB · W06 · NOTIFICATION DELIVERYNEWDeliver once, retry rightClaim a task key before sending so a redelivered task is skipped, free the claim on failure, then classify the error and back off with full jitter, cut off at the message's expiry.From W06 · D2 · The Delivery Pipeline: Guarantees, Priorities and PreferencesMedium~35 min3 + 10 hidden tests+90 XP

World 07Designing a Search System

  1. LAB · W07 · TYPEAHEADNEWTypeahead with a top-k trieScore queries from daily logs with a half-life and a distinct-user floor, then build a trie that keeps its top k at every node so a keystroke is one walk.From W07 · D4 · Typeahead at Scale: Autocomplete, Spelling and FacetsMedium~35 min3 + 10 hidden tests+90 XP

World 08Designing an Analytics Pipeline

  1. LAB · W08 · APPROXIMATE COUNTINGNEWHyperLogLog unique viewersCount distinct viewers in a few kilobytes with HyperLogLog registers, correct small counts with linear counting, and merge daily sketches into an exact-union weekly count.From W08 · D6 · Counting at Scale: Bloom Filters, HyperLogLog, Count-Min Sketch and Top-KMedium~35 min3 + 8 hidden tests+90 XP

World 09Multi-tenancy and Security

  1. LAB · W09 · NOISY NEIGHBOURSNEWPer-tenant quota limiterA token bucket per tenant sized by plan, costs per operation, a shared cluster bucket on top, and a 429 that says why and when to retry.From W09 · D2 · Noisy Neighbor PreventionMedium~35 min3 + 11 hidden tests+90 XP

World 10Production Readiness and Operational Excellence

  1. LAB · W10 · SLO ALERTINGNEWMulti-window burn-rate alertsTurn per-minute good and bad counts into error ratios and burn rates, page only when a long and a short window both burn fast, and report the budget left.From W10 · D1 · SLIs, SLOs and SLAsEasy~30 min3 + 9 hidden tests+60 XP

World 11Designing AI Systems

  1. LAB · W11 · RAGNEWRAG chunker and context packerSplit a policy section on its strongest boundaries into chunks under a token limit, then pack reranked chunks into a token budget, best first, without duplicates or weak evidence.From W11 · D3 · RAG SystemsMedium~40 min3 + 9 hidden tests+90 XP
  2. LAB · W11 · LLM CACHINGNEWScoped semantic answer cacheReturn a stored answer for a similar enough question, but only inside its tenant, language and prompt version, never for personal answers, and purge it when a source changes.From W11 · D5 · Cost, Caching and OperationsMedium~30 min3 + 8 hidden tests+90 XP