13. System Design Prompts
Open-ended prompts to practice trade-offs, failure modes, and scalability strategies.
Prompt: Design a globally distributed rate limiter with per-tenant quotas and low latency.
Discussion Points:
Consider the CAP theorem.
How do you handle state synchronization across regions?
What data store is appropriate (e.g., Redis, Cassandra)?
How do you make the counting atomic and efficient?
How does the client discover its nearest limiter endpoint?
Prompt: Build an idempotent payments service with retries, outbox, and ledger.
Discussion Points:
Discuss idempotency key handling and storage.
Explain the transactional outbox pattern for reliable eventing.
How do you model a double-entry ledger for financial accuracy?
What isolation level is required?
How do you handle external payment gateway failures?
Prompt: Design a multi‑region active‑active read/write service.
Discussion Points:
- Replication model (CRDTs vs per‑key ownership vs leader/follower); conflict resolution.
- Consistency vs availability trade‑offs; client‑side retries and idempotency.
- Data locality, failover, and regional isolation/blast radius.
Prompt: Build a globally distributed cache with consistency guarantees.
Discussion Points:
- Coherence model (write‑through/around/back); TTLs and stampede prevention.
- Invalidation vs update propagation; pub/sub; single‑flight de‑dup.
- Hot‑key sharding and backpressure to protect origins.