Write the notification to a table as the source of truth, then enqueue a delivery job per channel so a failing email provider never blocks the in app feed. Make jobs idempotent and retry with exponential backoff into a dead letter queue. Serve the feed from that table, pushing updates over a socket or polling on focus. Add per user preferences and digesting so nobody gets twenty emails an hour.
Why interviewers ask this
This is a design question that touches data modeling, queues, third party failure and product judgement all at once, which is exactly the full stack surface. The interviewer wants to see you separate the record from the delivery, handle partial failure, and think about the user experience of volume. Mentioning preferences and digesting shows you consider the product, not just the pipes.
How to structure your answer
- Separate the notification record from channel delivery.
- Describe the queue, retries and failure handling.
- Explain how the in app feed reads and updates.
- Cover preferences, batching and unsubscribes.
Example answer
I would model a notifications table keyed by user with a type, a payload, a created timestamp and a read timestamp, and treat that row as the truth. Creating a notification is a single write plus enqueueing delivery jobs, one per channel, so if the email provider is down the in app feed still works and the email retries later. Each job carries a stable idempotency key made from the notification id and channel, so a retry cannot double send. Retries use exponential backoff and land in a dead letter queue after a handful of attempts, with an alert, because silent email failure is the kind of bug you find out about from a customer. The feed itself is a simple paginated read on that table, with unread counts cached, and I push new items over server sent events or just refetch when the tab regains focus. On the product side, preferences live per user per type, high volume types get digested into a daily summary, and every email carries a one click unsubscribe that actually writes back to those preferences.
Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.
See how it worksFollow-up questions to expect
- How would you deduplicate ten identical events in one minute?
- How do you make sure an unsubscribe is honored everywhere?
- What would you use for the queue and why?
Related full stack developer questions
Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.
Predict my questions