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.
- problem breakdownsProblem BreakdownsOne system, designed end to end, the way a 45 minute interview goes.
- core conceptsCore ConceptsThe building blocks behind the designs. Every answer is worked out, not just stated.
- patternsPatternsIdeas that come up again and again. Explained once, linked from every article that uses them.
- interview craftInterview CraftHow the 45 minutes is actually scored, and the ways strong engineers still lose it.
Problem Breakdowns
22One system, designed end to end, the way a 45 minute interview goes.
- 01Distributed Rate LimiterUsesApproximate CountingContention and Hot KeysGraceful Degradation+1
- 02URL ShortenerUsesBijective ID GenerationContention and Hot KeysWorking Set Caching+7
- 03WhatsApp and Chat SystemsUsesFencing and EpochsContention and Hot KeysFanout on Write against Fanout on Read+3
- 04News Feed and TimelineUsesContention and Hot KeysFanout on Write against Fanout on Read
- 05InstagramUsesIdempotency KeysBijective ID GenerationFanout on Write against Fanout on Read+7
- 06Notification ServiceUsesThe Outbox PatternLeased Quota and Batched CoordinationFanout on Write against Fanout on Read+3
- 07Live Comments and ReactionsUsesFanout on Write against Fanout on ReadDealing with SkewIdempotency Keys+5
- 08YouTubeUsesTiered StorageWorking Set CachingContention and Hot Keys+4
- 09Uber and Ride-HailingUsesIdempotency KeysFencing and EpochsThe Outbox Pattern+3
- 10Design Yelp (Nearby Places)UsesIdempotency KeysRead Your WritesBackfill and Reprocessing+3
- 11Ticketmaster and Event Ticket BookingUsesContention and Hot KeysDealing with SkewFencing and Epochs+4
- 12Design a Payment SystemUsesFencing and EpochsThe Outbox PatternIdempotency Keys+2
- 13Design an Ad Click AggregatorUsesIdempotency KeysApproximate CountingTiered Storage+4
- 14Dropbox and Google DriveUsesIdempotency KeysRead Your WritesFanout on Write against Fanout on Read+4
- 15Design Google Docs (Collaborative Editing)UsesIdempotency KeysFencing and EpochsTiered Storage+3
- 16Distributed CacheUsesWorking Set CachingContention and Hot KeysDealing with Skew+2
- 17Design a Distributed Message QueueUsesIdempotency KeysFencing and EpochsTiered Storage+4
- 18Design a Key-Value StoreUsesIdempotency KeysFencing and EpochsRead Your Writes+3
- 19Design a Distributed Job SchedulerUsesThe Outbox PatternFencing and EpochsIdempotency Keys+2
- 20Design a Web CrawlerUsesContention and Hot KeysBackfill and ReprocessingWorking Set Caching+3
- 21Search Autocomplete and TypeaheadUsesFanout on Write against Fanout on ReadWorking Set CachingBackfill and Reprocessing+4
- 22Design a Leaderboard / Ranking ServiceUsesIdempotency KeysRead Your WritesFanout on Write against Fanout on Read+5
Core Concepts
34The building blocks behind the designs. Every answer is worked out, not just stated.
- 01Back-of-Envelope EstimationNeeded byLatency Numbers That MatterPartitioning and ShardingBloom Filters and Probabilistic Structures+4
- 02Latency Numbers That MatterNeeded byDistributed CacheSearch Autocomplete and TypeaheadCAP and What It Actually Constrains+9
- 03CAP and What It Actually ConstrainsNeeded byTicketmaster and Event Ticket BookingConsistency ModelsReplication and Leader Election
- 04Consistency ModelsNeeded byDropbox and Google DriveDesign Google Docs (Collaborative Editing)Design a Key-Value Store+8
- 05Partitioning and ShardingNeeded byURL ShortenerNews Feed and TimelineInstagram+15
- 06Consistent HashingNeeded byLive Comments and ReactionsDesign Google Docs (Collaborative Editing)Distributed Cache+2
- 07Replication and Leader ElectionNeeded byDesign Google Docs (Collaborative Editing)Design a Distributed Message QueueDesign a Key-Value Store+3
- 08Quorums, Raft and PaxosNeeded byDesign a Distributed Message QueueDesign a Key-Value StoreDesign a Distributed Job Scheduler
- 09Caching Strategies and InvalidationNeeded byURL ShortenerNews Feed and TimelineInstagram+8
- 10Load BalancingNeeded byDistributed Rate LimiterCircuit Breakers, Bulkheads and BackpressureWebSockets, SSE and Polling+2
- 11CDNs and Edge ComputeNeeded byURL ShortenerInstagramYouTube+4
- 12Message Queues vs Event StreamsNeeded byWhatsApp and Chat SystemsNotification ServiceLive Comments and Reactions+9
- 13Idempotency and Exactly-Once DeliveryNeeded byWhatsApp and Chat SystemsNotification ServiceDesign a Payment System+6
- 14Distributed Transactions and SagasNeeded byUber and Ride-HailingTicketmaster and Event Ticket BookingDesign a Payment System
- 15Bloom Filters and Probabilistic StructuresNeeded byURL ShortenerDesign an Ad Click AggregatorDesign a Web Crawler
- 16Circuit Breakers, Bulkheads and Backpressure
- 17Choosing a DatabaseNeeded byURL ShortenerYouTubeDesign a Payment System+5
- 18LSM Trees vs B-TreesNeeded byDesign a Key-Value StoreWrite-Ahead LogsInverted Indexes+1
- 19Indexing and Query PerformanceNeeded byChoosing a DatabaseLSM Trees vs B-TreesInverted Indexes+1
- 20Write-Ahead LogsNeeded byDesign a Payment SystemDesign Google Docs (Collaborative Editing)Design a Distributed Message Queue+2
- 21Change Data CaptureNeeded byDesign Yelp (Nearby Places)Design a Leaderboard / Ranking Service
- 22Inverted IndexesNeeded byDesign Yelp (Nearby Places)
- 23Geospatial IndexingNeeded byUber and Ride-HailingDesign Yelp (Nearby Places)
- 24Time-Series StorageNeeded byDesign an Ad Click AggregatorObservability: Metrics, Logs and Traces
- 25Object and Blob StorageNeeded byInstagramYouTubeDesign Yelp (Nearby Places)+3
- 26WebSockets, SSE and PollingNeeded byNotification ServiceLive Comments and ReactionsUber and Ride-Hailing+4
- 27Push Notification DeliveryNeeded byNotification ServiceUber and Ride-Hailing
- 28Auth: Sessions, JWT and OAuthNeeded bySecurity in System Design
- 29Multi-Region and Disaster RecoveryNeeded byDesign a Payment SystemDesign a Leaderboard / Ranking Service
- 30Observability: Metrics, Logs and TracesNeeded byDeployments: Blue-Green and Canary
- 31Capacity Planning and Autoscaling
- 32Deployments: Blue-Green and Canary
- 33Security in System Design
- 34Cost as a Design Constraint
Patterns
16Ideas that come up again and again. Explained once, linked from every article that uses them.
- 01Bijective ID GenerationAppears inURL ShortenerInstagram
- 02Contention and Hot KeysAppears inDistributed Rate LimiterURL ShortenerWhatsApp and Chat Systems+26
- 03Approximate CountingAppears inDistributed Rate LimiterURL ShortenerLive Comments and Reactions+3
- 04Graceful DegradationAppears inDistributed Rate LimiterWhatsApp and Chat SystemsInstagram+34
- 05Leased Quota and Batched CoordinationAppears inDistributed Rate LimiterURL ShortenerWhatsApp and Chat Systems+2
- 06Read Your WritesAppears inURL ShortenerLive Comments and ReactionsDesign Yelp (Nearby Places)+12
- 07Fanout on Write against Fanout on ReadAppears inWhatsApp and Chat SystemsNews Feed and TimelineInstagram+8
- 08Idempotency KeysAppears inURL ShortenerWhatsApp and Chat SystemsInstagram+20
- 09The Outbox PatternAppears inNotification ServiceUber and Ride-HailingTicketmaster and Event Ticket Booking+10
- 10Working Set CachingAppears inURL ShortenerInstagramYouTube+11
- 11Tiered StorageAppears inURL ShortenerInstagramYouTube+9
- 12Backfill and ReprocessingAppears inURL ShortenerInstagramYouTube+11
- 13Denylist Push against Cache PurgeAppears inURL ShortenerInstagramLive Comments and Reactions+7
- 14Dealing with SkewAppears inInstagramLive Comments and ReactionsYouTube+18
- 15Fencing and EpochsAppears inWhatsApp and Chat SystemsUber and Ride-HailingTicketmaster and Event Ticket Booking+12
- 16Dual Write MigrationAppears inPartitioning and ShardingMessage Queues vs Event StreamsIdempotency and Exactly-Once Delivery+3
Interview Craft
5How the 45 minutes is actually scored, and the ways strong engineers still lose it.
More coming soon.