1. A service gets 8.6M requests/day evenly. Roughly what is the average QPS?
- ~1 QPS
- ~1,000 QPS
- ~100 QPS
- ~10,000 QPS
Show answer
Answer: ~100 QPS
8.6M / 86,400s ≈ 100 QPS average; peak would be higher.
Lesson: Back-of-the-Envelope Estimation
20 questions from the System Design: Architecture, Scale and Trade-offs course, each with the correct answer and an explanation. Try to answer before you open the answer.
Answer: ~100 QPS
8.6M / 86,400s ≈ 100 QPS average; peak would be higher.
Lesson: Back-of-the-Envelope Estimation
Answer: LRU
LRU (Least Recently Used) evicts the coldest entry by last access time.
Lesson: Caching
Answer: Shard the data
Replicas and caches scale reads. Sharding spreads writes across nodes.
Lesson: Replication & Sharding
Answer: The same message may be delivered more than once
Retries and redeliveries mean duplicates; idempotent handling makes them harmless.
Lesson: Message Queues
Answer: Reads (queries) vs writes (commands)
CQRS (Command Query Responsibility Segregation) uses a write model optimized for commands and a separate, often denormalized, read model optimized for queries.
Lesson: Event-Driven Architecture & CQRS
Answer: Once a majority of nodes have replicated it
Majority (quorum) commitment lets Raft tolerate a minority of node failures while staying correct.
Lesson: Leader Election & Idempotency
Answer: At-least-once delivery + idempotent consumers
Delivering at least once and then deduping on the consumer side is the practical way most systems achieve exactly-once effect.
Lesson: Delivery Guarantees
Answer: Leaky bucket
Leaky bucket processes at a fixed rate no matter how bursty the input is, unlike token bucket which allows saved-up bursts through.
Answer: A read replica
Replication lag means a replica may not yet have the write that just committed on the primary.
Answer: Someone intercepting data as it travels over the network
TLS protects data moving between client and server or between services; at-rest encryption protects stored data on disk. You need both.
Answer: Token bucket
Accumulated tokens let a client spend several at once, up to the bucket cap.
Lesson: Design a Rate Limiter
Answer: Without it, losing a shard sends a flood of misses straight to the database
A cold shard means every request for its keys becomes a miss, hammering the database until it's warm again — replicas avoid that cliff.
Lesson: Design a Distributed Cache
Answer: p99 latency under 200ms
Non-functional requirements describe quality: latency, availability, scale.
Answer: 1,000
A day has about 86,400 seconds, so 86.4M / 86,400 ≈ 1,000 QPS.
Answer: The app loads from the database and fills the cache
In cache-aside the application owns loading and populating the cache.
Answer: Massive key remapping when nodes change
Only a small share of keys move when a node joins or leaves.
Answer: Messages can be delivered more than once
Retries cause duplicates, so repeating work must be safe.
Answer: Reject some requests to stay consistent
CP chooses consistency over availability during a partition.
Answer: Stops calling a failing dependency to prevent cascades
It fails fast so one slow dependency does not take down callers.
Answer: Clarify requirements, users and scale
Requirements and scale drive every later decision.