ProblemReal-time and messaging
Notification service
Send push, email and text messages to hundreds of millions of people, on the channels they chose.
The brief
Notification platform · suggested for Senior
Design a notification service
Design the notification platform for a large consumer app: every team's services use it to reach users by push, email, SMS and an in-app inbox, following each user's choices, with login codes in seconds and promotions to 100 million people.
You run the notification platform for a large consumer app. Dozens of teams' services (accounts, orders, social, marketing) need to reach users: a login code must arrive in seconds, an order update within half a minute, and a promotion can take hours. Users decide what they get, on which channel, and when not to be disturbed, and a calling service's retry or a replayed event must never turn into a second copy of a text. The platform talks to outside providers (Apple's and Google's push services, two email providers and two SMS providers), each with a contracted rate and its own failures. About 500 million users, about 5 billion sends a day, campaigns of up to 100 million users, in several regions. Design the platform, from a team's request to the message on the user's phone or in their inbox.
Functional requirements
- CoreAny team's service can send a notification to a user by category (for example "login code", "order shipped", "promotion"), in the user's language (12 are supported).
- CoreDeliver by mobile push, email, SMS and an in-app inbox, depending on the category and what the user has.
- CoreUsers choose which categories they get on which channels, and set quiet hours in their own time zone; marketing goes only to users who opted in.
- CoreSchedule a notification for later, and send a campaign to an audience of up to 100 million users; a running campaign can be stopped.
- CoreSenders can look up the status of each notification, and see sent, delivered and opened counts for each campaign.
Non-functional requirements
- DurabilityEvery notification the service accepts reaches a final status on each channel (sent to the provider, delivered where the channel reports it, failed, or skipped because of the user's choices), and its sender can see which.
- ConsistencyA retried request or a replayed event never creates a second notification, and the platform never re-sends a message a provider has confirmed taking.
- LatencyLogin codes and security alerts reach the provider within about 5 seconds at the 99th percentile, even during the biggest campaign; order and account updates within 30 seconds; marketing can take hours.
- AvailabilityAccepting notifications stays available (99.99%), even when a whole region is down.
- CostNever send faster than a provider's contracted rate.
- SecurityAn unsubscribe takes effect within a minute, including for notifications already waiting or scheduled; message contents and login codes never appear in logs.
- QualityDelivery records are kept for 90 days.
Scale
- ScaleAbout 500 million users, in every time zone.
- ScaleAbout 5 billion sends a day: about 75% push, 20% email, 4% in-app only and 1% SMS (mostly login codes).
- ScaleThe busiest hour runs at about three times the average.
- ScaleContracted provider rates (this problem's givens): push 200,000 a second; email 50,000 a second; SMS 2,000 a second. There are two email providers and two SMS providers, and either one of a pair can carry its channel's full rate on its own.
- ScaleLogin codes alone can reach about 1,000 SMS a second at the busiest moment.
- ScaleThe largest campaign goes to 100 million users. The service runs in several regions.
Nice to mention (below the line)
- Below the lineBuilding campaign audiences (a campaign names an audience that already exists).
- Below the lineThe template editor.
- Below the lineA/B tests.
- Below the lineWeb push and voice calls.
Out of scope
- Out of scopeChoosing who is in an audience, and ad targeting.
- Out of scopeChecking message content for spam.
- Out of scopeBilling teams for what they send.
The variant
One fully specified brief, with the level it suits best. You can practise it at any level.
- Notification platformSuggested for Senior
One service every team uses to reach 500 million people by push, email, SMS and in-app, from login codes to marketing.
9 steps · 7 must-pass · about 48 min at Senior
What each level is graded on
Notification platform, step by step. A result at a level needs its must-pass steps answered, and only the steps you answer count. Going up a level adds steps or holds them to a stricter bar.
| Step | Entry level | Mid-level | Your levelSenior | Staff |
|---|---|---|---|---|
| The numbers that shape the design (optional) | Graded | Graded | Graded | Graded |
| Notifications, people and their devices | Graded | Graded | Graded | Graded |
| What a team sends, and what it gets back | Graded | Must-pass | Must-pass | Must-pass |
| A shipping update, end to end | Must-pass | Must-pass | Must-pass | Must-pass |
| Never lose a notification | Must-passcan block | Must-passcan block | Must-passcan block | Must-passcan block |
| Who wants what, and when | Must-pass | Must-pass | Must-pass | Must-pass |
| When a provider fails, and how you'd know | — | Must-pass | Must-pass | Must-pass |
| A login code behind a million promotions | — | Must-pass | Must-pass | Must-pass |
| One message to 100 million people | — | — | Must-pass | Must-pass |
| Many regions, many teams | — | — | — | Must-pass |
| At this level | 6 steps 3 must-pass about 30 min | 8 steps 6 must-pass about 42 min | 9 steps 7 must-pass about 48 min | 10 steps 8 must-pass about 55 min |
Entry level6 steps · 3 must-pass · about 30 min
- The numbers that shape the design (optional)Graded
- Notifications, people and their devicesGraded
- What a team sends, and what it gets backGraded
- A shipping update, end to endMust-pass
- Never lose a notificationMust-passcan block
- Who wants what, and whenMust-pass
Mid-level8 steps · 6 must-pass · about 42 min
- The numbers that shape the design (optional)Graded
- Notifications, people and their devicesGraded
- What a team sends, and what it gets backMust-pass
- A shipping update, end to endMust-pass
- Never lose a notificationMust-passcan block
- Who wants what, and whenMust-pass
- When a provider fails, and how you'd knowMust-pass
- A login code behind a million promotionsMust-pass
SeniorYour level9 steps · 7 must-pass · about 48 min
- The numbers that shape the design (optional)Graded
- Notifications, people and their devicesGraded
- What a team sends, and what it gets backMust-pass
- A shipping update, end to endMust-pass
- Never lose a notificationMust-passcan block
- Who wants what, and whenMust-pass
- When a provider fails, and how you'd knowMust-pass
- A login code behind a million promotionsMust-pass
- One message to 100 million peopleMust-pass
Staff10 steps · 8 must-pass · about 55 min
- The numbers that shape the design (optional)Graded
- Notifications, people and their devicesGraded
- What a team sends, and what it gets backMust-pass
- A shipping update, end to endMust-pass
- Never lose a notificationMust-passcan block
- Who wants what, and whenMust-pass
- When a provider fails, and how you'd knowMust-pass
- A login code behind a million promotionsMust-pass
- One message to 100 million peopleMust-pass
- Many regions, many teamsMust-pass
- Must-pass
- a result at that level needs this step answered.
- Can block
- a miss there is a Blocking issue at that level.
Going up a level
- Mid-level
- “What a team sends, and what it gets back” becomes must-pass.Adds “When a provider fails, and how you'd know”, must-pass.Adds “A login code behind a million promotions”, must-pass.
- Senior
- “When a provider fails, and how you'd know” is graded more strictly.“A login code behind a million promotions” is graded more strictly.Adds “One message to 100 million people”, must-pass.
- Staff
- “One message to 100 million people” is graded more strictly.Adds “Many regions, many teams”, must-pass.
Skills this problem practises
Your coach tracks readiness per skill across every problem you practise. Each links to the lesson that teaches it.
- Capacity estimation
- API design
- Idempotency and retries
- Data modelling
- Choosing storage
- High-level architecture
- Queues and async messaging
- Networking and protocols
- Traffic surges and backpressure
- Replication and durability
- Failure modes and recovery
- Observability and operations
- Latency budgets
- Rate limiting and abuse
- Security and privacy
Worked solution
Try it first: practise a variant, then read the walkthrough and compare it with your own design. Reading it first makes the practice much less useful.
Learn: Design a notification systemYour history
Sign in to see your sessions on this problem.