How would you design a notification service?
Practice this questionShort explanation:
A notification service accepts delivery requests and sends them through channels such as email, SMS or push. Queued delivery separates user-facing request speed from provider latency and limits. Durable status records allow retries, troubleshooting and reporting without assuming that provider acceptance means the user received the message.
Key points:
-
API accepts a notification request and queues it by channel.
-
Workers call email, SMS or push providers and record delivery status.
-
Enforce preferences, rate limits and deduplication; provider acceptance does not prove delivery.
-
Store template version, recipient, channel and deduplication key; honor preferences before sending.
-
Use provider callbacks or reconciliation where available to distinguish accepted, delivered and failed states.
Interview point:
- Explain duplicate-send prevention and what happens when a provider sends the same delivery callback twice.