Question presented to candidate:
"Many teams in our company want to notify users: order updates, login codes, marketing campaigns, reminders. Design one notification service they can all call that sends push notifications, emails and SMS, respects user preferences, and does not lose or duplicate important messages."
What a strong answer should cover:
Requirements split into transactional and marketing traffic, and a capacity estimate that includes campaign bursts, not just the daily average
The pipeline: an API that accepts requests with an idempotency key, preference and template resolution, per-channel queues with workers, third-party providers (APNs, FCM, an email service, an SMS gateway), and status tracking
Reliability: at-least-once delivery inside the system with deduplication, retries with exponential backoff, and a dead-letter queue; why exactly-once to a phone is not achievable
Respecting users: opt-outs per category and channel, quiet hours in the user's time zone, frequency caps, and priority isolation so a campaign never delays a login code
Channel facts that shape the design: push tokens expire, payload size limits, SMS segment lengths, bulk email sender rules
Clarifying questions expected:
Which channels, and which kinds of notification (transactional, marketing, both)?
What volume, and how big are campaigns compared to the daily average?
Which notifications are time-critical (login codes) and what latency do they need?
Code / implementation expected: Optional โ a pipeline simulation with dedup, preferences, quiet hours, caps and retries; the example runs one with a fake clock and failing providers.
notifications
2
Try it yourself
Sketch your approach before you read the solution. That is what the interview tests.
Stuck? Get a hint.
A short nudge toward the approach. It will not give the answer away.
3
Solution
Target Audience: Engineers preparing for a system design round; queues, retries and push notifications are explained from the start.
Difficulty: Hard
Verified with: Node 22.22 and Python 3.12 (both print identical output). Provider facts (FCM HTTP v1 migration, FCM payload size, SMS segment lengths, Gmail and Yahoo bulk sender rules) checked in October 2026 and cited inline.
How to read this doc: Every idea is explained in plain language first, then tagged with ๐ Interview term: so you also learn the exact words an interviewer expects. The capacity numbers and the delivery log come from the example program; the Verified section quotes its full output.
1. Why This Even Matters โ A Story First
Think of the front desk of a large hotel. Guests get messages all day: "your taxi is here" (urgent), "the spa has a discount" (not urgent), "your room key code" (urgent
The solution is hidden so you can try first
17 min read ยท 17 sections
4
Read the code
Notification pipeline: idempotency keys, preferences, quiet hours, per-user caps, retries with backoff and a DLQ