← All problems
Dashboard
Courses
Problems
Badges
Theme
Sign inStart free
Problem 027 · Messaging and event-driven systems

Design Scheduled Reminders

Easy 35 min

A to-do app with 10 million users lets people set reminders such as 'call the dentist at 09:00 tomorrow' or 'every Monday at 08:30'. At the chosen time the app sends a push notification through an external push provider. Most reminders are set for round times, so thousands fall due in the same second at the top of each hour. Design the system that stores reminders and fires them within a few seconds of their due time, without sending duplicates or losing any when servers restart.

Functional requirements

  • Create, edit and cancel one-off and repeating reminders
  • Deliver a push notification within 5 seconds of the due time
  • Respect each user's time zone, including daylight saving changes
  • Retry failed deliveries and record the final outcome

Non-functional requirements

  • No reminder is lost once the user has saved it
  • Each reminder is delivered at most once per occurrence
  • The top-of-the-hour spike does not delay reminders by more than 5 seconds

Constraints and scale

  • 10 million users with 50 million pending reminders
  • Up to 400 API requests per second to create and edit reminders
  • Up to 30,000 reminders due in the same minute at the top of the hour

You will practise

  • Store due times so the next batch can be found with an indexed range query
  • Hand due work to a queue so delivery scales independently of scheduling
  • Make delivery idempotent across retries and worker crashes
Show 2 hints
  1. Scanning 50 million rows every second is too slow. What index lets you fetch only what is due next?
  2. If a worker crashes after sending a push but before recording it, what stops a second send?

Ready to build?

Open the canvas, place your components and explain your decisions. Your draft saves automatically.

Sign in to start

Failure scenarios

  • The scheduler crashes at 08:59The process that finds due reminders crashes one minute before the 09:00 spike and takes three minutes to be replaced.

Run them from the workspace once your design is in place.