Design a Notification System

MediumInfrastructureMessage QueuesRetriesIdempotencyThird-party IntegrationAbout 35 minutes

Design a service other teams use to send notifications to users by push, SMS, and email. It must respect user preferences and quiet hours, avoid duplicates, and deliver urgent messages within seconds. Plan for 500M notifications per day with bursts 10x the average.

How the interview goes

Five phases, and questions the interviewer is likely to ask in each.

  1. 1. Requirements

    • Which notifications are urgent and what latency do they need?
    • What does a user expect if they opt out mid-campaign?
    Show a hint

    Ask what 'urgent' means and how it is different from a campaign.

  2. 2. High-level design

    • Where do queues sit, and how many do you need?
    • Who checks preferences, and when?
    Show a hint

    Decouple accepting a notification from delivering it.

  3. 3. Deep dive

    • A provider returns a timeout: was the message sent? What do you do?
    • How do templates and localization fit in?
    Show a hint

    A timeout from a provider does not tell you whether the message went out.

  4. 4. Scaling

    • How do you keep a 50M-user campaign from starving password resets?
    • How do you handle a provider outage?
    Show a hint

    Isolation between priorities can come from separate queues and worker pools.

  5. 5. Trade-offs

    • At-least-once versus at-most-once: which would you pick per channel?
    • Check preferences at enqueue or at send time?
    Show a hint

    A user's preference can change between enqueue and send.

Practice this with an AI interviewer

Write your design doc with live diagrams while the interviewer asks one question at a time and pushes on your choices. Get a scored debrief with what to study next.

Start this interview