Design Gmail Scheduled Send and Undo Send

Last updated: November 29, 2026

Quick Overview

Design the outbound mail path in Gmail that supports undo send for a short window and scheduled send for any future time, delivering each message exactly once.

Google
System Design
Software Engineer
Google
November 29, 2026
Software Engineer
System Design Round
System Design
Medium

0

0

0 solved


Design the outbound mail path in Gmail that supports undo send for a short window and scheduled send for any future time, delivering each message exactly once.

This is a Gmail-specific spin on delayed job scheduling: it tests durable timers, cancellation races, and exactly-once side effects (an email cannot be unsent once delivered). Interviewers check the state machine and how you handle clock and failure edge cases.

What the Interviewer Expects
  • Defines a clear message state machine
  • Builds a durable timer or delay queue
  • Handles cancel versus send races safely
  • Achieves effectively exactly-once handoff to SMTP
  • Scales to bursts at popular send times
Key Topics to Cover
delay queues
state machines
idempotency
distributed timers
email delivery
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • What happens if the user clicks undo at the same instant the timer fires?
  • How do you handle millions of messages scheduled for 9:00 on Monday?
  • How do edits to a scheduled message work?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: undo send with a configurable delay (5 to 30 s); scheduled send at any future time with edit and cancel; messages appear in an Outbox or Scheduled label; delivery to external and inter...

High-Level Design
  1. Compose service saves the message in the user's mailbox store with state SCHEDULED and a send_at time (now plus undo delay, or the chosen time).
  2. Timer service: a sharded, durable ind...

Submit Your Answer
Markdown supported