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.
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
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- 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 ProblemsSample 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
- Compose service saves the message in the user's mailbox store with state
SCHEDULEDand asend_attime (now plus undo delay, or the chosen time). - Timer service: a sharded, durable ind...