Design Help Me Write Email Drafting in Gmail

Last updated: November 29, 2026

Quick Overview

Design an LLM feature in Gmail that drafts or rewrites an email from a short instruction, using the thread context, with strong privacy and safety guarantees.

Google
ML System Design
Machine Learning Engineer
Google
November 29, 2026
Machine Learning Engineer
Onsite
ML System Design
Medium

0

0

0 solved


Design an LLM feature in Gmail that drafts or rewrites an email from a short instruction, using the thread context, with strong privacy and safety guarantees.

Workspace generative features handle private user content, so interviewers probe privacy boundaries, context construction from long threads, latency for an interactive editor, and how to evaluate tone and correctness. Grounding on the actual thread is the core skill being tested.

What the Interviewer Expects
  • Construct context from the thread and instruction within a token budget
  • Keep user data out of training and logs unless explicitly allowed
  • Handle tone and length controls and rewriting of user text
  • Add safety filters and avoid fabricating facts like dates or prices
  • Evaluate with human ratings and acceptance metrics
Key Topics to Cover
Prompt construction
Context compression
Privacy
Hallucination control
Human evaluation
How to Approach This
  1. Start by mapping the business objective to a concrete ML objective and metric.
  2. Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
  3. Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
  4. Address the serving latency budget and whether batch or real-time inference is needed.
  5. Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
  • How do you handle a 60-message thread that exceeds the context window?
  • How do you stop the draft from inventing a meeting time that is not in the thread?
  • How would you personalize style without training on a user's emails?
Sharpen Your Skills on Codemia

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

Practice ML System Design Problems
Sample Answer
Requirements

Inputs: user instruction ('decline politely, suggest next week'), optional existing draft, current thread, sender and recipient names. Output: a draft in the compose box within about 2 seconds, stream...

High-Level Design
  1. Client: gathers instruction and selected text; sends with thread ID.
  2. Context builder: fetches thread server side, selects relevant messages, trims quoted history and signatures.
  3. **Pro...

Submit Your Answer
Markdown supported