System Design Cheat Sheet
Interview steps, quick numbers, availability, load balancing, caching, databases, consistency, replication, queues, APIs, reliability patterns and common designs.
Updated
Interview steps#
Quick numbers#
Availability#
Chained parts multiply: 99.9% × 99.9% = 99.8%.
When to reach for what#
Load balancing#
Layer 4 routes by IP and port. Layer 7 routes by URL and headers.
Caching#
Databases#
Consistency#
- CAP: during a partition, choose consistency or availability.
- Quorum: R + W must be greater than N for current reads.
- Strong: payments, inventory.
- Eventual: feeds, likes, counters.
Replication and sharding#
- Replicas add read capacity, not write capacity.
- Asynchronous replication means lag.
- A shard key needs many values, and an even spread.
- Consistent hashing moves few keys when servers change.
Queues#
- At-least-once delivery means that consumers must be idempotent.
- Use a dead-letter queue for repeated failures.
- Queue: tasks. Log (Kafka): event streams and replay.
API#
- Name resources, and use HTTP methods.
- Use cursors for feeds.
- Use idempotency keys for payments.
- Status codes: 200, 201, 400, 401, 403, 404, 429, 500, 503.
Reliability patterns#
Rate limiting#
Common designs#
Want the full explanations? Go to the Learn System Design course →