← Create New Paste

System Design Interview: Building an Email Newsletter Delivery Platform

3 views
"Design a service like Mailchimp or Substack's email sender" is a system design question that looks simple and gets deep fast. A strong answer covers subscriber management, high-volume sending, deliverability, and tracking, while keeping the conversation organized. Clarify the requirements Ask who the users are: creators writing newsletters, and readers receiving them. Core features usually include managing subscriber lists, composing a newsletter, scheduling a send, delivering to every subscriber, handling unsubscribes, and showing open and click statistics. Then pin down scale. A reasonable assumption is 100,000 publishers, some with lists of 5 million subscribers, and a peak of around 50 million emails per hour when popular newsletters go out in the morning. Non-functional requirements matter here: sends must not be duplicated, unsubscribes must take effect quickly for legal reasons, and the platform must protect its sender reputation so mail lands in inboxes rather than spam folders. High-level architecture A publisher API stores lists, subscribers, and newsletter drafts in a relational database, sharded by publisher ID. When a send is scheduled, a scheduler service creates a send job. A fan-out worker reads the subscriber list in pages and writes one message per recipient (or per small batch) to a durable queue such as Kafka or SQS. Sender workers consume the queue, render the personalized email, and hand it to mail transfer agents or an external provider through SMTP or an API. Idempotency and retries Each recipient message carries a key made from send ID plus subscriber ID. Before sending, a worker checks a fast store such as Redis or a delivery table to see whether that key was already processed. This prevents duplicates when a worker crashes after sending but before acknowledging the queue message. Temporary failures (4xx SMTP responses) are retried with exponential backoff; permanent bounces mark the address as invalid. Deliverability and rate limiting This is where candidates can stand out. Mailbox providers like Gmail throttle senders who ramp up too quickly. The system should maintain per-domain rate limits, warm up new IP addresses gradually, sign messages with SPF, DKIM, and DMARC, and segregate traffic so that one spammy publisher does not damage the reputation of everyone else. Processing bounce and complaint feedback loops automatically keeps lists clean. Unsubscribes and compliance Every email includes a one-click unsubscribe link and the List-Unsubscribe header. Unsubscribe events update the subscriber record immediately and are also checked by sender workers just before sending, so a reader who leaves mid-send is skipped. Tracking opens and clicks Opens are tracked with a tiny image pixel and clicks with redirect links. These events are high volume, so write them to a stream and aggregate them into an analytics store such as ClickHouse, rather than the transactional database. Mention that open tracking is increasingly unreliable because of privacy features, which shows real-world awareness. Wrapping up Close by summarizing trade-offs: queue-based fan-out for resilience, idempotency keys against duplicates, and reputation management as a first-class concern. Practicing these answers out loud is the hard part. Linkjob AI (https://linkjob.ai) offers real-time help during job interviews and technical interviews, which can remind you of a missed requirement like unsubscribes or rate limits while you are sketching the design.
Created Nov 17, 2026 12:59 Expires Nov 17, 2027 12:59