Design a multi-channel notification system
AirbnbSoftware Engineer · Technical ScreenLast updated
This question tests the ability to design a distributed, multi-channel notification system capable of handling high throughput, varying latency requirements across channels (e.g., email, push, SMS), and ensuring reliable message delivery.
Problem Statement
Design a scalable multi-channel notification service that can trigger alerts via email, SMS, and mobile push notifications. The system must support different notification priorities, handle high traffic spikes, and ensure that users do not receive duplicate notifications for the same event.
Functional Requirements
- Send notifications via multiple channels: Email, SMS, Push.
- Support notification scheduling (e.g., "remind me in 2 hours").
- Allow users to configure notification preferences (e.g., "no SMS at night").
- Guarantee at-least-once delivery.
Non-Functional Requirements
- Scalability: Support 100,000 notifications per second.
- Latency: Push notifications should ideally be delivered within 500ms; emails can take longer.
- Reliability: High availability, avoiding message loss during system failures.
- Observability: Track delivery success rates per channel.
Constraints & Assumptions
- The system must integrate with third-party providers (e.g., Twilio, SendGrid, APNS/FCM).
- You do not need to build the content generation engine, but you must define the interface for it.
- Assume a global user base with regional data residency requirements.
Hints
Hint 1
Consider using a message queue to decouple the request ingestion from the provider-specific delivery logic.
Hint 2
Think about how to implement idempotency keys to ensure that a network retry doesn't trigger two separate SMS messages to a user.
Hint 3
How would you handle a sudden surge in demand that exceeds the rate limits imposed by your third-party notification vendors?
Follow-up questions
- How would you implement a 'notification preference' service to ensure we don't send messages during a user's quiet hours?
- If a third-party email provider experiences a 30-minute outage, how would you design the system to recover and process the backlog without overwhelming the provider upon recovery?
- How would you monitor and alert if a specific channel's delivery success rate drops below 95%?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.