Skip to main contentSkip to user menuSkip to navigation

Design Gmail Smart Compose

Problem: Design Gmail's Smart Compose feature that provides real-time, contextually relevant text suggestions as users type emails. The system must handle 150M concurrent users with <100ms latency while maintaining privacy and generating high-quality suggestions.

Q: What's the scope of Smart Compose? Is it just for Gmail web or also mobile apps?
Interviewer: Focus on Gmail web for now, with considerations for mobile scalability.
Analysis: This means we need <100ms latency for real-time suggestions and efficient client-server communication.
Q: What types of emails should Smart Compose work for?
Interviewer: All email types - personal, business, replies, forwards, and compose.
Analysis: We need context understanding from email threads, subject lines, and user writing patterns.
Q: What's the expected scale and user base?
Interviewer: 1.5 billion Gmail users globally, ~10% actively composing at any time.
Analysis: That's ~150M concurrent users needing real-time ML inference with geographic distribution.
Q: What are the privacy and compliance requirements?
Interviewer: GDPR compliant, enterprise-grade privacy, no email content stored for training.
Analysis: On-device processing where possible, federated learning, and differential privacy techniques needed.
Q: How much context should the model consider?
Interviewer: Current email draft, email thread history, and user's writing style patterns.
Analysis: Need efficient context encoding and management of variable-length sequences up to ~4K tokens.

Summary of Requirements

Functional Requirements:

  • • Real-time text suggestions (<100ms)
  • • Context-aware completions
  • • Multi-language support
  • • Personal writing style adaptation

Non-Functional Requirements:

  • • 150M concurrent users
  • • 99.9% availability
  • • GDPR compliance
  • • Enterprise privacy standards
No quiz questions available
Quiz ID "gmail-smart-compose" not found

Interview Practice Questions

Practice these open-ended questions to prepare for system design interviews. Think through each scenario and discuss trade-offs.

1

Massive Scale Real-time Inference: Design Smart Compose to handle 150M concurrent users with <100ms latency for text suggestions. Address model serving architecture, caching strategies, load balancing, and graceful degradation during peak loads.

2

Privacy-Preserving Personalization: Build personalized email suggestions while maintaining user privacy and GDPR compliance. Include federated learning, on-device processing, differential privacy, and secure aggregation techniques.

3

Context-Aware Suggestion Quality: Design context understanding for Smart Compose using email threads, subject lines, and user writing patterns. Address context window management, relevance scoring, and handling of long email conversations.

4

Multilingual & Cultural Adaptation: Support Smart Compose across 50+ languages with cultural context understanding. Include language detection, culturally appropriate suggestions, formal/informal tone adaptation, and regional communication patterns.

5

Intelligent Suggestion Filtering: Implement suggestion quality control to avoid inappropriate, biased, or irrelevant suggestions. Include content safety, bias detection, relevance filtering, and user feedback integration for continuous improvement.

6

Enterprise Integration & Security: Design Smart Compose for enterprise Gmail with additional security, compliance, and integration requirements. Address admin controls, audit logging, custom vocabulary, and integration with enterprise workflows.