Skip to main content

Design a Notification System

Difficulty: 🟡 Medium | Time: 35-45 min | Prerequisites: Message queues, Priority handling, Rate limiting
Design a scalable notification system that delivers billions of notifications daily across multiple channels (push, SMS, email, in-app) with reliability guarantees.

1. Requirements Clarification

Functional Requirements

Non-Functional Requirements

  • Latency: Critical notifications < 1 second, Normal < 5 seconds
  • Throughput: 1 million notifications/minute peak
  • Reliability: At-least-once delivery guarantee
  • Availability: 99.9% uptime

Capacity Estimation


2. High-Level Architecture


3. Core Components Deep Dive

3.1 Notification Request Flow

3.2 Notification Router

3.3 Template Engine

3.4 Priority Queue System

3.5 Push Notification Service

3.6 User Preferences Service

3.7 Rate Limiting


4. Delivery Guarantees

At-Least-Once Delivery

Retry Strategy


5. Analytics and Tracking


6. Database Schema


7. Interview Tips

Common Follow-ups

  1. Rate limiting per category (max 2 marketing/day)
  2. Smart batching - consolidate multiple notifications
  3. Relevance scoring - only send high-value notifications
  4. User preferences - granular opt-out controls
  5. A/B testing - optimize timing and frequency
  • Per-user queues for ordered delivery
  • Sequence numbers to detect gaps
  • Buffering at the client side for reordering
  • Note: Usually not required—most notifications are independent
  1. Multiple providers per channel (Twilio + Vonage for SMS)
  2. Circuit breakers to detect failing providers
  3. Automatic failover to healthy providers
  4. Provider health monitoring with SLO tracking

Key Trade-offs


8. Summary

Key Takeaways:
  1. Priority queues ensure critical notifications (2FA) are delivered first
  2. User preferences respect opt-outs and quiet hours
  3. Rate limiting prevents notification fatigue
  4. At-least-once delivery with deduplication at the client
  5. Template engine for consistent multi-channel content