Advanced~4h

System Design: Walkthroughs

Five systems, decided one decision at a time

A link shortener, a feed, a chat, a rate limiter and a file store — not narrated, but taken apart into the decisions inside them. Every one states its constraints and has an answer: how long the code must be, what a post costs to fan out, which request the limiter refuses, what the sender sees when an ack is lost.

Modules
5
Drills
3
Build steps
0
Time
~4h

Walk out able to

Run three rate limiters over one arrival list and say which request each refuses — and price a fan-out before choosing one.

What you decide

01

Key spaces, sized

How short a code can be, and where it comes from.

02

Fan-out, priced

What one post costs on write, and on read.

03

Limits, to the request

Which one the bucket refuses, and exactly when.

04

Failure, from outside

What the sender sees when an ack goes missing.

The pitch

What you practise, and what you leave with

Not an artifact — a reflex: every decision inside a named system arrives with its number attached instead of as a preference.

You will practise

  • Size a code space and pick where ids come from
  • Price fan-out on write against fan-out on read
  • Run three rate limiters over one arrival list
  • Cost a failed upload and a content-addressed store

Afterwards you can

  • Say which request each limiter refuses, and when
  • Derive a fan-out threshold instead of quoting one
  • Say what the sender sees when an ack is lost
  • Review a whole design with three numbers

Modules

5 modules, 23 items

Lessons explain one idea. Drills repeat it until it sticks. Build steps make something that exists afterwards.

  1. 1

    Shorten a URL

    ~42 min

    Size a code space, let a constraint pick the id scheme, and keep the click data.

    • LessonDecide how long the code is13 min
    • LessonName the four places a code comes from6 min
    • LessonLet the constraint pick the scheme10 min
    • LessonDecide whether one machine holds it5 min
    • LessonServe the redirect and keep the data8 min
  2. 2

    Build the feed

    ~44 min

    Price both fan-out paths, derive the threshold between them, and page a moving list.

    • LessonPrice one post on the write path7 min
    • LessonMove the work to the read path9 min
    • LessonDerive the threshold, do not quote it12 min
    • LessonPage a list that is being written to9 min
    • LessonSwap the offset for a cursor7 min
  3. 3

    Deliver a message

    ~37 min

    Keep a conversation ordered, make a resend safe, and say what the sender sees.

    • LessonNarrow the ordering promise6 min
    • LessonFind where the ordering stops9 min
    • LessonMake the resend safe12 min
    • DrillSay what the sender sees10 min
  4. 4

    Hold the line

    ~1h

    Run three limiters over the same arrivals, and place the counter where it works.

    • LessonSpend a token bucket14 min
    • DrillCount a sliding window12 min
    • LessonEstimate without keeping the log13 min
    • LessonFind where two limiters disagree14 min
    • LessonPut the counter somewhere12 min
    • DrillPay for the retry9 min
  5. 5

    Store the file

    ~44 min

    Cost a failed upload, count what a block store holds, then review one whole design.

    • LessonSplit the upload and resume it13 min
    • LessonStore each block once13 min
    • LessonReview one design end to end18 min

The system is the setting. The decisions are the work.

The first item is free. ~4h of focused work, at your own pace.

Advanced~4h5 modules