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

Design a Newsletter Sender

Easy 30 min

A media company sends a weekly newsletter to 5 million subscribers. An editor presses 'send', and every subscriber should get exactly one copy within a few hours. Emails go out through an external email provider that accepts at most 1,000 messages per second per account and sometimes rejects requests or goes down for a few minutes. Subscribers must be able to unsubscribe with one click, and nobody who unsubscribed may receive the next issue. Sends are paced at about 500 emails per second, which leaves headroom under the provider's limit.

Functional requirements

  • Editors schedule or trigger a send of one issue to all active subscribers
  • Each subscriber receives exactly one copy of each issue
  • One-click unsubscribe that takes effect before the next send
  • Track delivered, bounced and failed emails per issue

Non-functional requirements

  • An issue reaches all 5 million subscribers within 4 hours
  • Stay under the provider's rate limit
  • A provider outage delays emails but never loses or duplicates them

Constraints and scale

  • 5 million subscribers, growing 5% per month
  • Email provider limit: 1,000 messages per second
  • Send rate about 500 emails per second

You will practise

  • Break a large job into queued work items processed by workers
  • Respect a third party's rate limit and retry with backoff
  • Make sends idempotent so retries do not create duplicate emails
Show 2 hints
  1. What happens if the process sending emails crashes at subscriber 2,400,000?
  2. How could a retried job know the email was already sent?

Ready to build?

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

Sign in to start

Failure scenarios

  • The provider starts rejecting requestsHalfway through a send, the email provider returns '429 Too Many Requests' for a third of calls because another team shares the same account.

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