Design a Notification System
Quick Overview
Design a scalable notification system supporting push notifications, email, and SMS channels. Cover event-driven architecture, message bus design, user preference management, rate limiting, and delivery guarantees at Meta's scale.
Meta
0
Design a scalable notification system supporting push notifications, email, and SMS channels. Cover event-driven architecture, message bus design, user preference management, rate limiting, and delivery guarantees at Meta's scale.
This shows up in Meta's onsite system design round, where notifications are the glue between Facebook, Instagram, WhatsApp and Messenger events and the people who need to see them. The interviewer is checking whether you can fan out billions of events a day across push, email and SMS while respecting user preferences, rate limits and delivery guarantees.
What the Interviewer Expects
- Separate event ingestion, notification decisioning and per-channel delivery behind a durable message bus such as Kafka
- Model user preferences and opt-outs so they are checked before anything is sent
- Apply per-user and per-channel rate limiting and deduplication to avoid spamming
- Explain delivery guarantees (at-least-once with idempotency keys) and retry with backoff to third-party providers
- Size the system with back-of-envelope numbers for daily and peak volume
- Discuss trade-offs such as eventual consistency, batching and priority queues for urgent notifications
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How would you guarantee a user never receives the same notification twice when a delivery worker crashes after sending?
- How do you prioritize a security alert over a 'someone liked your photo' notification during a traffic spike?
- How would you aggregate many similar notifications (50 likes) into one digest?
- What happens when an SMS or APNs provider is degraded for an hour?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
- Functional Requirements:
- Support multiple notification channels: push notifications, email, and SMS.
- User preference management to allow users to opt-in/out of specific channels. ...
Capacity Estimation
- User Base: Assume Meta has 2 billion active users.
- Notification Frequency: Assume an average of 3 notifications/user/day.
- Total Notifications:
- Daily: 2 billion users ...