High level design, for interviews and for building things

Study System Design. Worked out.

You have a job, and a Senior or Staff interview somewhere in the next few weeks. An hour in the evening is about what you have got, so each article is one sitting: one system, walked the whole way.

Start with the URL ShortenerSee all articles

Free to read, no signup required.

Argued from the papers and the postmortems, not from blog posts.

Sources cited across the course include PostgreSQL, Apache Kafka, MySQL, Notion, Figma, Pinterest, Google, Meta, Netflix, AWS, Apple, OpenAI, Anthropic, Stripe, Microsoft, Cloudflare, Discord, X, Slack, GitHub.

hit rate
99.0 %
multiplier, 1 / (1 − h)
100x
database normally
1,000 /s
if the cache dies
100,000 /s

At 100,000 requests a second. Drag it: the multiplier is the whole argument, and it is one division.

Every decision here is argued with a diagram.

Problem Breakdowns

3

One system, designed end to end, the way a 45 minute interview goes.

  1. 01Distributed Rate LimiterUsesApproximate CountingContention and Hot KeysGraceful Degradation
    • 93 min read
  2. 02URL ShortenerUsesBijective ID GenerationContention and Hot KeysWorking Set Caching+6
    • 122 min read
  3. 03WhatsApp and Chat SystemsUsesFencing and EpochsContention and Hot KeysFanout on Write against Fanout on Read+2
    • 112 min read

Core Concepts

1

The building blocks behind the designs. Every answer is worked out, not just stated.

  1. 01Caching Strategies and InvalidationNeeded byURL Shortener
    • 69 min read

Patterns

12

Ideas that come up again and again. Explained once, linked from every article that uses them.

  1. 01Bijective ID GenerationAppears inURL Shortener
    • 15 min read
  2. 02Contention and Hot KeysAppears inDistributed Rate LimiterURL ShortenerWhatsApp and Chat Systems+1
    • 15 min read
  3. 03Approximate CountingAppears inDistributed Rate LimiterURL Shortener
    • 13 min read
  4. 04Graceful DegradationAppears inDistributed Rate LimiterWhatsApp and Chat SystemsCaching Strategies and Invalidation
    • 14 min read
  5. 05Read Your WritesAppears inURL Shortener
    • 13 min read
  6. 06Fanout on Write against Fanout on ReadAppears inWhatsApp and Chat Systems
    • 13 min read
  7. 07Idempotency KeysAppears inURL ShortenerWhatsApp and Chat Systems
    • 11 min read
  8. 08Working Set CachingAppears inURL ShortenerCaching Strategies and Invalidation
    • 11 min read
  9. 09Tiered StorageAppears inURL Shortener
    • 14 min read
  10. 10Backfill and ReprocessingAppears inURL Shortener
    • 13 min read
  11. 11Denylist Push against Cache PurgeAppears inURL ShortenerCaching Strategies and Invalidation
    • 12 min read
  12. 12Fencing and EpochsAppears inWhatsApp and Chat Systems
    • 13 min read

More coming soon.

Sign in to oneby7

Keep your progress, your streak and your code, on any device.

New here? This creates your account too.