Mock Interviewer

Ask Coach

Ask Coach
Clarify requirements before you design — kept separate from your stage notes.

Tap a question to start, or type your own below.

Notification System Design

Visual Problem Diagram

Notification System Design architecture diagram

Scenario

Picture forgetting your password on a shopping app. You tap Forgot password, the app says a code is on its way, and you sit waiting for a text message. A few minutes earlier the store sent a huge sale message to millions of people, and your code got stuck in the same line behind all of them, so it shows up five minutes late, when it is already useless. The part of the system that takes a request like tell this person something and gets it to a phone or an inbox is called a notification system. A good answer explains why the code was late, how urgent messages stay ahead of sale messages, and why a retry must never send a second copy.

Stuck on where to start? Ask Coach

Clarify this problem here, or open Pathway Coach if you want a prep plan first.

Free Coach trial
How should I start prep?

This problem asks you to design a notification system, which is the shared part of a product that every other part asks when it wants to tell a person something. Think of a shopping app. When you forget your password, when you pay, when your parcel ships, and when a sale starts, a different team's code wants to reach you on your phone, by text message, or by email. Instead of every team building its own way to reach you, they all hand the message to one shared system, and that system decides how, when, and whether to deliver it. The first message in that list is urgent, because you are staring at a page waiting for a code. The last one is optional, and you may have asked never to receive it.

In the interview you need to explain five things. First, how the product gets a quick yes that its request was accepted, without waiting for the phone to actually show the message. Second, how a reset code stays out of the same line as a sale blast. Third, how the system chooses email, a text, or a phone alert for this one person, and how it respects the person's opt-outs and quiet hours. Fourth, how a retry finds the first attempt so the person does not receive a second copy. Fifth, what the system does when an outside sender says "slow down". The outside delivery networks themselves already exist, so you only need to describe how you connect to them.

Constraints

Functional

Accept a request to notify someone. Fill in the message from a template. Choose email, text, a phone alert, or an in-app notice. Honor opt-out and quiet hours. Retry a failed try. Record whether the message was accepted, sent, or skipped. Keep resets and receipts apart from sales.

Non-functional

The request is accepted in well under a second, which means the job is saved and the code is not on the phone yet. A password reset is attempted within a few seconds, while the person is still on that page. A retry does not create a second code the person can see. The outside sender's speed limit is respected. An opt-out is stored so you can audit it later.

Scale

Tens of millions of users. The hot action is a sale blast that can send millions of messages in a few minutes. That blast must not block resets. Many templates and languages exist. A person may have several devices. A day can reach hundreds of millions of sends.

Stages ahead

1Requirement Analysis
2API Design
3High-Level Design
4HLD Extensions
5Trade-offs

Not ready to design yet?

Try the free Coach trial — ask how to prep, what to practice first, or how InterviewCrafted works. Sign in when you want to start this problem.

Try Coach free

Log in to start practicing

Preview the problem below. Sign in to start your timed session, save progress, and use the AI coach.

Want full access now? View Pro pricing