Skip to the guide

Design a notification service

IntermediateCase study11 pages

The interviewer asks you to design the classes that send a user a message by email or text, the way that user chose. Picture a dentist's front desk with a card for each patient that says "phone me" or "write to me". One helper makes the calls and another posts the letters, so a helper stuck on hold never stops the post. Each reminder has a number in the book, and a number already ticked isn't sent again.

It is also asked as "design a notification system". The closest other case study is the pub/sub broker, where subscribers are your own code. Interviewers like it because outside providers bring slow calls, lost replies and different terms. Once notifications must survive a crash, or millions go out a day, it stops being a class question, and Notification system owns that system.

Below is a full 45-minute round on the LLD framework. At each Guess before you read on, stop and answer first. The full runnable project is a download in Java, JavaScript and Python.

Run the full project

This design as a project you can run, with its tests and a demo. You only need Java 21, Node 24 or Python 3.13. The README says how to run it.

Step 1 · Clarify the requirements and cut the scope

Minutes 0–5 · How this step works

Interviewer: Design a notification service.

You: Who calls it, and which channels are there?

Interviewer: Our own services. Email and text for now, through outside providers with their own APIs. Each user picks channels for each kind of message: order news, security and marketing.

You: What happens when a provider fails, and can a message arrive twice?

Interviewer: Try again if it might work, and record how it ended. A service may also resend after a timeout, and the user should get it once.

You: How big is it?

Interviewer: One process. About 100 emails and 20 texts a second at peak. A provider call takes about 200 ms, and its client gives up after 5 seconds.