Design a Notification Platform
A full Staff-level walkthrough of a system that delivers hundreds of millions of multi-channel messages a day — with no duplicates and strict per-channel SLAs. Follow it top to bottom, or jump to any step.
Scope & ambiguity
Before drawing a single box, separate transactional (password resets, receipts) from marketing (campaigns, digests) — they have different latency, priority, and failure tolerances. Pin delivery semantics: target at-least-once delivery with deduplication, not true exactly-once. Define what “never duplicate” actually means: idempotent within a bounded dedup window.
Requirements
Back-of-envelope estimation
Size the system out loud so every later decision has a number behind it.
API design
A single ingest endpoint, with the idempotency_key carried at the boundary so retries from callers collapse safely.
202 Accepted with an id (not a synchronous send) is what makes the platform async, queueable, and resilient under burst.Data model
idempotency_key as the partition key makes dedup a free side effect of the write path — a retry storm collapses to a single row, no separate dedup service required.High-level architecture
Deep dives
WHERE STAFF IS WONSpend the most time here. Interviewers calibrate level on the depth of these.
At-least-once + dedup-on-write gets you effectively-once at a fraction of the coordination cost. True exactly-once needs distributed transactions across provider + store — defend why that price isn’t worth it here.
Each channel runs primary + fallback providers behind a circuit breaker. When a provider’s deliverability or latency degrades, trip the breaker and reroute — don’t pile retries onto a failing dependency.
Separate queues per priority. Under overload, shed marketing first to protect transactional SLAs — graceful degradation, not collapse.
Rollout strategy
Migrate off the existing system with zero downtime: shadow-write to the new platform first, compare delivery outcomes, then cut over one notification type at a time behind a feature flag — with an instant kill-switch back to the old path.
Bottlenecks, observability & evolution
Rubric — Senior vs Staff
Want more breakdowns like this?
Join free early access for upcoming RAG, LLM eval, agents, and AI infrastructure walkthroughs.