May we use cookies so Meta, Google, LinkedIn and ChatGPT see your visit and we learn which ads work? PrivacyMay we use cookies to see which pages help, and let Meta, Google, LinkedIn and ChatGPT see your visit, so we know which of our ads work? That way we spend less on ads that do not work. We do not sell your data, and the site works the same if you decline. You can change your answer at any time under Cookie settings at the foot of the page. Privacy policy
Loading...
System Design and AI Engineering, by Roni Das. 989 interactive lessons in two courses.: 770 in System Design and 219 in AI Engineering.
Start LearningSystem design interview guide
in this guide
7 parts open to everyone · 3 with a free account · 3 with the course
You can read 7 of 13 parts. A free account opens the deep dive; the course opens all of it.
Interviewers like this problem because it looks simple and is not. A weak candidate designs a single service that loops over users and calls APNs. A strong candidate sees the queueing, the fanout amplification, the idempotency requirement under at-least-once delivery, the per-channel failure modes, and the tension between transactional and promotional traffic. It tests whether you can decompose a pipeline, reason about delivery guarantees, handle third-party rate limits and outages you do not control, and design for observability so you can prove a message was delivered. It also surfaces product judgment: preferences, quiet hours, and aggregation are what separate a spammy system from one people tolerate.
This page is the free part.
₹1,111 in India$35 everywhere elseonce, for the whole course
The System Design course covers the Notification System design across a run of lessons, not one page. These 4 alone are about 74 minutes of step-by-step reading, every one with a quiz.
Always clarify these in the first 5 minutes of the interview. Do not start drawing boxes until both lists are agreed.
This guide is built on these 5 lessons. Each one teaches one piece of the Notification System design above, step by step.
Lifetime access for ₹1,111 in India or $35 elsewhere. Interactive diagrams, quizzes, and 20 capstone projects to practise on.
This one question is not enough for the interview.
Each question has why it is asked, a full answer, what the interviewer listens for, the follow-ups, the common mistakes and a diagram (268 diagrams in all). A PDF you keep, junior to staff level.
Two courses by the author of this page:
770 lessons · 18 free to read
₹1,111 in India · $35 elsewhere, once
Get System DesignYou own this course
219 lessons · 10 free to read
₹1,333 in India · $35 elsewhere, once
Get Generative AI and Agentic AIYou own this course
Save your progress and get the interview checklist PDF
A large consumer platform routinely sends billions of notifications a day across push, SMS, email, and in-app. Uber's real-time push platform has reported peaks above 250,000 messages per second and 1.5M concurrent streaming connections, and LinkedIn's Air Traffic Controller processes over 1 billion notification decisions daily. At that volume, a single bug in the dedup or retry path can double-send to hundreds of millions of people, so correctness matters as much as throughput.
A notification system takes an event, such as "your driver is arriving" or "someone commented on your post," and turns it into one or more messages delivered across the right channels to the right users. The hard part is not sending one push; it is doing this reliably for billions of events a day while respecting user preferences, deduplicating retries, rate limiting per user and per channel, and tracking delivery status end to end. The standard shape is an ingestion API that validates and enqueues requests, a fanout stage that expands an event into per-user per-channel jobs, durable queues that decouple producers from delivery, and channel-specific workers that talk to APNs, FCM, an SMS aggregator like Twilio, and an email provider like SES or SendGrid. Idempotency keys and a dedup store prevent double sends, retries use exponential backoff with jitter, and messages that exhaust retries land in a dead-letter queue for inspection. Priority lanes keep a two-factor code from waiting behind a marketing blast. Templates and user preferences are looked up per message so content is localized and channels the user has muted are skipped.
Where it shows up
Asked at Uber, Amazon, Meta, LinkedIn, Airbnb, DoorDash, Stripe, and most companies that run large consumer or transactional messaging. It shows up both as a standalone "design a notification service" prompt and as a subsystem inside larger designs like a ride-hailing or social feed system.
Spec sheetNotification System
worked through below, with the maths
The hard parts of this design are taught step by step in the System Design course: Push Notifications, Message Queues and Dead Letter Queue.
Deliver messages to users even when they're not actively using your app.
Decouple producers from consumers with a buffer that holds messages until they're processed.
Where failed messages go to die, or to be investigated and rescued.
The fan-out/fan-in pattern splits work across parallel workers and combines the results. Includes a search across shards example and a sequence view.
all part of
System Design Masterclass
770 lessons · about 290 hours · 18 free to read
₹1,111in India, by UPI
$35everywhere else, by card or PayPal
You own this course
Continue with Push Notificationspay once,
yours for life
Live from the course bench
Real interview questions, live diagrams and measured lab results, pulled at random from the lessons. A new set every time you come back.
Show your math. Pulling numbers from thin air signals you have not thought about the load.
Daily notification volume
~2 billion messages/day (assumed target)
Assume 200M active users receiving an average of 10 notifications a day across all channels. 200M x 10 = 2B messages/day. This is the working figure for the rest of the estimates; a smaller product scales the same design down.
Average send rate
~23,000 messages/sec average
Derived: 2B / 86,400 seconds ≈ 23,148 per second averaged over the day. Real traffic is bursty, so provision for several times this at peak.
Peak send rate
~115,000 messages/sec (5x average, estimate)
Derived: peaks from promotional blasts and time-zone clustering commonly run 5x average, so 23K x 5 ≈ 115K/sec. For comparison, Uber's push platform has published peaks above 250K messages/sec, so this order of magnitude is realistic.
Fanout amplification
1 event to 3-5 delivery jobs
A single event often expands to push plus email plus in-app for one user, and a broadcast expands to millions of users. Plan for the queue and worker tier to carry several times the inbound event rate.
Dedup store size
~120 GB hot, ~200M keys/day (estimate)
Derived: if we keep an idempotency key for each of 2B daily messages for a 24-hour window, and each entry is roughly 60 bytes of key plus metadata, that is about 120 GB. Kept in a TTL'd store like Redis or a wide-column table with a 1-day expiry.
Delivery status writes
~46,000 writes/sec (2x message rate)
Derived: each message produces at least a "sent" and a terminal "delivered/failed" status update, so 23K x 2 ≈ 46K status writes/sec average. Provider webhooks (email opens, SMS receipts) add more, which is why status is stored in a write-optimized store.
A producing service (orders, chat, marketing) calls the Notification API with a request that names the user or audience, a template id, a category, and optional data variables. The API validates the request, attaches or reads an idempotency key, checks it against a dedup store, and if it is new, persists the request and enqueues it. Behind the API sits a fanout stage: for a single-user event it looks up that user's devices and channel preferences, and for a broadcast it expands an audience into per-user jobs, often reading from a precomputed subscriber list. Each fanned-out job is a per-user, per-channel unit of work placed on a durable message queue such as Kafka or a managed queue, partitioned by user id so all work for one user stays ordered on one partition. Channel workers consume from priority-specific topics: a transactional consumer group drains a high-priority topic, a bulk consumer group drains promotional topics, so an OTP never queues behind a newsletter. A worker loads the template, renders it with user variables and locale, re-checks preferences and rate limits, and calls the channel provider: APNs over HTTP/2 for iOS, FCM for Android and web, an SMS aggregator, or an email provider. The provider response drives status: success marks the message sent, a transient failure triggers a retry with exponential backoff and jitter, and a permanent failure or exhausted retries routes the message to a dead-letter queue. Providers also send asynchronous receipts (APNs feedback, email opens, SMS delivery reports) through a webhook ingestion service that updates the same delivery-status store. A separate scheduler handles future-dated and quiet-hours sends by buffering jobs until their fire time.
In a real interview, sketch this on the whiteboard before diving into any single box.
Walk through each service. The interviewer wants to hear what each one owns, not just the names.
The single entry point that all internal producers call. It authenticates the caller, validates the payload against the template schema, assigns or reads an idempotency key, checks the dedup store, and persists then enqueues accepted requests. It returns fast, doing no delivery work inline, so producers are decoupled from provider latency.
Expands one logical request into concrete per-user, per-channel delivery jobs. For a targeted event it resolves the user's registered devices and channels; for a broadcast it streams an audience list and shards it. This is where amplification happens, so it is designed to run in parallel and to backpressure onto the queue rather than hold state in memory.
Kafka or an equivalent durable log sits between fanout and delivery, partitioned by user id for ordering and grouped into separate topics per priority class. Decoupling here means a provider outage backs up a topic instead of failing user requests, and consumer groups scale independently per channel.
Stateless consumers, one pool per channel, that render templates and call the provider. Push workers speak APNs HTTP/2 and FCM, SMS workers call an aggregator, email workers call SES or SendGrid. Each pool tunes its own concurrency, batching, and rate limits to match the provider it owns.
Stores per-user channel preferences, category opt-outs, quiet hours, and locale, plus versioned message templates. Workers query it right before sending so a preference change or template fix takes effect immediately rather than being baked in at enqueue time.
A fast TTL'd store, typically Redis or a wide-column table, keyed by idempotency key or a content hash. A SET-if-not-exists on the key gates whether a message is sent, which makes at-least-once queue delivery and producer retries safe against double sends.
A write-optimized store records each message's lifecycle (queued, sent, delivered, failed, opened) and a webhook service ingests asynchronous receipts from providers to close the loop. This feeds status APIs, metrics, and the dead-letter queue tooling.
notification_request. One row per accepted logical request before fanout. The unique index on idempotency_key is the first dedup gate. Kept short-term; archived or TTL'd after the delivery…
Every table for Notification System, its keys, and which store fits it and why.
Fanout: single-recipient vs broadcast amplification. Fanout is where one event becomes many messages, and the two cases behave very differently. A targeted event ("your order shipped") expands to a handful of jobs: this…
7 deep dives on the parts that break at scale: Fanout: single-recipient vs broadcast amplification; Idempotency and deduplication under at-least-once delivery; Retries, exponential backoff, and dead-letter queues.
At-least-once with idempotent consumers versus exactly-once delivery. True exactly-once across a network and third-party providers is effectively impossible, since you cannot atomically send a push and record that you sent it. The…
6 decisions an interviewer expects you to defend, each with the alternative and why it loses here.
APNs has a two-hour partial outage. What happens to queued iOS pushes and to OTP traffic?
3 follow-up questions with model answers, the interview scorecard for this question, and a mock interview on Design Notification System with the AI tutor.
Uber's real-time push platform, RAMEN, is a strong public reference: it started on Server-Sent Events and later moved to gRPC bidirectional streams, uses a Fireball service to decide when to push and an API gateway to decide what to push, shards connections with Apache Helix and ZooKeeper via Streamgate workers, and has reported peaks above 250,000 messages per second with more than 1.5M concurrent connections and priority queues for time-critical traffic. LinkedIn's Air Traffic Controller is the reference for the decision layer: built on Apache Samza and Kafka, it partitions all of a member's signals to one host so channel selection, aggregation, delivery-time optimization, and relevance filtering run against co-located state, processing over a billion notification decisions a day. On the delivery edge, Apple's APNs is an HTTP/2 provider API with token-based ES256 JWT auth and a 4KB payload limit, and Google's FCM handles Android and web with token, topic, and device-group targeting plus message priority, TTL, and collapsible messages. Amazon SNS is the common managed building block for pub/sub fanout and mobile push when teams do not build their own.
If any of these topics are fuzzy, the interviewer will catch it. Each lesson is 15 to 60 minutes with diagrams, code, and a quiz.
interview readiness
Three questions from this guide. Answer them without scrolling up, the way you would have to in the room.
Pay by UPI, cards or netbanking through Razorpay. Pay by card or PayPal, in US dollars. Download at once from My packs.
NEWSystem Design Hands-On
Postgres Sharding: Complete Hands-On (PgBouncer + Citus). 2 h 36 min and 20 chapters: one PostgreSQL loaded until it breaks, then four shards behind a router you write, PgBouncer and Citus, with the 139-page slide deck. The first 15 minutes are free to watch.
Free PDF · 79 pages
25 real tech interview questions, answered in full
Five from each of our AI, GenAI, Inference, Maths for ML and Forward Deployed packs. Each with a diagram and a model answer. Free by email.
free tool
Check these numbers yourself
Put in your own guesses for Notification System and see requests per second, storage, bandwidth and servers, with every sum written out.
Open the Capacity EstimatorIt is really nice and good Please join the course