Labs

Watch distributed systems behave

All 37 labs are free and need no account. 24 are live simulations, including a cache, Kafka and a rate limiter. 5 are interactive, such as consistent hashing, and 8 are guided walkthroughs.

Each lab is a small system you can run, tune and break. There are three kinds. A live simulation runs many requests at once and checks that its counts add up. An interactive lab works out exact numbers as you change the inputs. A guided walkthrough goes through one case, step by step. Most labs also have a "Try this" list of short experiments to run.

Interview method

Turn a prompt into requirements, then into numbers.

Foundations

How a request travels and how systems grow.

Guided walkthroughEasy

Request flow

Follow one request through DNS, CDN, load balancer, cache and database, with the latency of each hop.

  • DNS lookup and caching
  • CDN hit vs origin round trip
  • Where latency comes from

Concept: The client–server model

Building blocks

The components almost every design uses.

Live simulationEasy

Load balancer

Round robin, weighted, least connections and IP hash — plus slow servers, crashes and health checks.

  • Algorithms and when each fails
  • Health-check detection delay
  • Sticky sessions

Concept: Load balancing and health checks

Live simulationEasy

Caching

Cache-aside, write-through and write-behind; LRU/LFU/FIFO; TTLs, stale reads, stampedes and cold starts.

  • Hit rate and hot keys
  • Invalidation and staleness
  • Stampede protection

Concept: Caching strategies

Live simulationEasy

CDN and edge caching

Edge caches in three regions in front of one origin: hit rate by popularity, TTL and size, purges, and an origin shield.

  • Hit rate by region
  • TTL vs freshness
  • Purges and origin shields

Concept: CDNs and edge caching

Live simulationMedium

Rate limiting

Five algorithms under one policy: token bucket, leaky bucket, fixed window and two sliding windows.

  • Burst vs sustained rate
  • The fixed-window edge problem
  • Memory vs accuracy

Concept: Rate limiting

Live simulationMedium

Queues & backpressure

What happens when work arrives faster than it can be processed: growing queues, shedding, or slowing the producer.

  • Utilization and waiting time
  • Load shedding vs backpressure
  • Little's law

Concept: Message queues and Kafka

Live simulationMedium

Transactions & isolation levels

Run transactions side by side and watch lost updates, dirty reads, wrong totals and write skew appear, then pick a level that stops them.

  • What each isolation level lets a read see
  • Lost update and write skew
  • The price of serializable: aborts

Concept: Transactions and isolation levels

Distributed data

Copying and splitting data across machines.

Live simulationMedium

Replication

Async, semi-sync and sync replication; stale reads, read-your-writes routing, and what failover can lose.

  • Replication lag
  • Read-your-writes
  • RPO on failover

Concept: Replication and sharding

Live simulationMedium

Sharding

Choose a shard key and watch hot spots, salting, fan-out queries and the cost of adding a shard.

  • Hot shards and hot keys
  • Scatter-gather queries
  • Resharding cost

Concept: Replication and sharding

InteractiveMedium

Consistent hashing

Add and remove servers on a hash ring and see exactly which keys move — compared with hash % N.

  • Minimal key movement
  • Virtual nodes

Concept: Consistent hashing

InteractiveMedium

Map cells: find what is nearby

Place a rider on a map of 200 drivers and search three ways: scan everyone, a fixed grid of cells, or a quadtree. See which cells are read and how many drivers are checked.

  • Why a search reads the neighbour cells
  • A fixed grid against a quadtree
  • Crowded and empty places

Concept: Geospatial indexes: finding what is nearby

Guided walkthroughHard

CAP & consistency

Partition two regions and choose between rejecting writes (consistency) or accepting them and reconciling later (availability).

  • CP vs AP behaviour
  • Conflict resolution

Concept: CAP, PACELC and quorums

Live simulationHard

Clocks & ordering

Skew one node's clock and watch last-writer-wins drop newer edits, then order edits with Lamport and vector clocks.

  • Why wall clocks mislead
  • Lamport against vector clocks
  • Siblings and merges

Concept: Time, clocks and ordering

Live simulationHard

Raft leader election

Five nodes run real Raft: random election timers, split votes, majority commits, a crashed leader and a split network.

  • Terms and elections
  • Majority quorum

Concept: Consensus and Raft

Reliability

What happens when things fail — and how to contain it.

Live simulationMedium

Circuit breaker

Break a dependency and watch the breaker move through closed, open and half-open while protecting both services.

  • Failure thresholds
  • Fail fast with fallbacks
  • Timeouts

Concept: Circuit breakers and bulkheads

Live simulationMedium

Deployments

Ship version 2 to six servers all at once, as a rolling update, blue-green or as a canary. Make it faulty, and watch the traffic share, failed requests and rollback.

  • Four ways to ship a release
  • How far a bad release spreads
  • How fast each one rolls back

Concept: CI/CD and safe deployments

Live simulationHard

Cascading failures

Slow one service down and watch full worker pools spread the slowdown to pages that never call it. Then try timeouts, a queue limit, a bulkhead and retries.

  • Why slow is worse than down
  • Timeouts, load shedding and bulkheads
  • How retries multiply load

Concept: Cascading failures, load shedding and backpressure

Architecture patterns

Coordinating work across services.

Live simulationHard

Stream windows & late events

Count clicks in 10-second windows while phones go offline and retries send clicks twice; choose how long to wait for stragglers.

  • Event time and watermarks
  • Late events: wait or drop
  • Deduplication by event id

Concept: Stream and batch processing

Architecture at scale

Regions, failover and the cost of staying up.

AI engineering

Serving language models: batches, memory and queues.

Live simulationMedium

Serving a language model

Requests fill a GPU batch and its memory; watch batching, long prompts and batch size decide how fast each user gets an answer.

  • Continuous vs static batching
  • KV memory limits
  • Time to first token vs tokens per second

Concept: LLM serving and retrieval (RAG)

More to try in the AI lessons

Each of these sits inside a lesson of the AI track, beside the text that explains it.