Worked case: design a notification system
Design notifications across push, email and SMS, with preferences, priorities and rate limits that protect users from spam.
On this page
Notification systems look simple ("send a message") but combine queues, third-party providers, user preferences, prioritisation, retries and analytics. They also have a big product dimension: too many notifications and users turn them off forever. That mix makes this a favourite PM system design question.
Why interviewers ask this
Interviewers check whether you can design a shared platform that many teams use, separate urgent from non-urgent messages, handle provider failures, and protect users from notification fatigue. Product judgement about preferences, quiet hours and relevance matters as much as the boxes.
The framework
Requirements → users and scale → components → data flow → tradeoffs → metrics.
Worked example
Question: "Design a notification system for a social app."
1. Clarify requirements
"Notifications include likes, comments, new followers, direct messages, security alerts (new login) and marketing.
- Functional: other services can request notifications; deliver via push, email, in-app inbox and SMS for critical alerts; respect user preferences per channel and type; group and summarise ('Priya and 12 others liked your photo').
- Non-functional: security alerts and messages should arrive within seconds; likes can be batched; no duplicates; survive provider outages; scale to big spikes (a celebrity post).
- Out of scope: the content of marketing campaigns."
2. Users and scale
"Say 50 million daily users, averaging 10 notification-worthy events each: 500 million events a day, around 6,000 per second, with spikes of 10x or more. Most are low priority."
3. Core components
flowchart LR
S["Product services<br/>likes, messages, security"] -->|notification event| NS["Notification service"]
NS --> PR[("Preferences<br/>and quiet hours")]
NS --> RL["Rate limiter<br/>and batching"]
RL --> HQ[["High-priority queue"]]
RL --> LQ[["Low-priority queue"]]
HQ --> W["Delivery workers"]
LQ --> W
W --> PUSH["Push providers<br/>Apple, Google"]
W --> EM["Email provider"]
W --> SMS["SMS provider"]
W --> INB[("In-app inbox")]
W -.-> LOG["Delivery and open tracking"]- Notification service: a single API all teams call with an event ("user X commented on Y"), so rules are enforced in one place.
- Preferences store: per-user settings by type and channel, quiet hours and time zone.
- Rate limiter and batching: caps per user per hour, and groups similar events into digests.
- Priority queues: security alerts and messages skip ahead of likes and marketing.
- Delivery workers: render templates (with localisation), call providers, retry with backoff, fall back to another channel when appropriate.
- Tracking: sent, delivered, opened, and turned-off events.
4. Data flow
"Someone comments on Asha's post → the comments service sends an event → the notification service checks Asha's preferences (push on for comments, not in quiet hours) → the rate limiter sees she's already had several comment notifications this hour, so it groups them → it's queued as normal priority → a worker sends a push and writes to her in-app inbox → delivery and open events are logged."
5. Tradeoffs and failures
- Speed vs fatigue: instant notifications drive engagement but annoy people; batching and caps protect long-term retention. The real metric is opt-outs, not just opens.
- Build vs buy: use push providers (required by the platforms) and an email/SMS vendor; build the orchestration, preferences and rules in-house because that's product logic.
- Duplicates: retries can cause double sends, so each notification has an ID and workers skip ones already sent.
- Provider outages: queue and retry; for critical alerts, fall back to another channel (email if push fails).
- Spikes: queues absorb bursts; low-priority notifications can be delayed or dropped under heavy load.
- Privacy: don't put sensitive content in lock-screen previews by default.
- Time zones and quiet hours: a digest sent at 3am local time is worse than no digest. Schedule low-priority notifications for the user's active hours, which also improves open rates.
- Ranking: when there's more to say than a user will tolerate, send the most relevant items (a comment from a close friend beats a like from a stranger) and fold the rest into the in-app inbox.
6. Metrics
"Delivery latency for high priority (p95 under 5 seconds), delivery success rate, open and click rates by type, notification opt-out and uninstall rates as the key guardrail, and per-team volume so one team can't spam users."
Common mistakes
- Every team sending notifications directly, with no central rules.
- No user preferences or rate limits.
- Treating all notifications as equally urgent.
- Ignoring duplicates and retries.
- Optimising opens while ignoring opt-outs.
Interviewer tips
What "great" sounds like:
- "One notification service, so preferences and caps are enforced everywhere."
- "Security alerts and messages go in a priority queue; likes can be batched."
- "Opt-out rate is the guardrail that protects the channel long term."
- "Retries can cause duplicates, so each notification has an ID."
- "We buy delivery, but build the rules, because that's product logic."
Practice questions
Answer one in a mock interview and get graded instantly.
1.Design a notification system for a social app.
Practice this →2.Users complain they get too many notifications. How would you fix it without killing engagement?
Practice this →3.How would you make sure security alerts are delivered even when push notifications fail?
Practice this →
Finished reading?
