Scope
Functional
- Internal services send notifications: transactional (OTP, order shipped) and bulk (campaigns).
- Channels: mobile push (FCM/APNs), SMS, email, in-app inbox.
- Templates with localisation; user preferences and opt-outs; scheduling.
Non-functional
- OTPs delivered to the provider in < 2 s at p99.
- No duplicate sends for the same event; at-least-once internally, deduplicated.
- Campaigns to 100M users complete within an hour without hurting transactional traffic.
Size
- Transactional: 50M/day → ~600/s average, a few thousand/s peak.
- Campaigns: 100M in an hour → ~28,000/s bursts.
- Provider limits (SMS gateways, email providers) are often the real bottleneck.
API
POST /v1/notifications
{ "idempotency_key": "order-881-shipped",
"user_id": 42, "template": "order_shipped", "params": {...},
"channels": ["push","email"], "priority": "high", "send_at": null }The architecture
The 30-second summary
Say it in the interview
"One API validates, deduplicates by idempotency key and applies preferences, caps and quiet hours. Work is split into priority-isolated queues, with per-channel worker pools rate-limited to each provider's quota. Delivery is at-least-once with per-channel sent markers, retries and provider failover. All events feed a delivery log for tracking."
Follow-up questions the interviewer may ask
- How do you avoid sending the same notification twice?
- How do you respect quiet hours and user preferences at scale?
- A provider (SMS or push) is down. What happens?
- How do you send a campaign to 50M users without hurting transactional notifications?
Model answers to each of these are in the book.