Design an Email Client UI
Problem statement
Design an email client with a virtualized inbox, safe thread rendering, durable compose drafts, attachment uploads, triage shortcuts, and mailbox sync.
Asked In
Key Challenges
- ·Virtualizing a dense inbox and thread pane
- ·Keeping unread, archive, and label mutations consistent across views
- ·Durable compose drafts and attachment upload lifecycle
- ·Search, filters, keyboard shortcuts, and focus movement
- ·Rendering untrusted email HTML safely
2-Minute Answer — High-Level TL;DR
Read this before your interview
HLD Interview Focus
I would split the UI into mailbox navigation, a virtualized thread list, a thread reader, and a durable compose surface. The client caches thread summaries separately from message bodies, keys list queries by mailbox, label, search query, and sync cursor, and applies optimistic archive/read/label mutations with reconciliation from the server. Compose drafts autosave locally and remotely, while attachments upload before send and show recoverable failure states. Realtime or sync polling invalidates affected thread summaries without resetting scroll or focus. The risky areas are huge inboxes, stale unread counts, untrusted message HTML, offline triage, and shortcut-heavy accessibility.
My Approach: Building the Solution
How to think about this problem
I'll start from a 50k-thread inbox plus a draft the user spent 10 minutes on — then design virtualization, draft durability, and safe HTML rendering.
Why This Approach?
Most candidates build three columns of divs. Strong answers virtualize the inbox, sandbox HTML, and keep compose drafts durable while sync cursors update metadata without nuking selection.
Treat the thread list like a task queue and the compose window like an unsent document that must survive interruptions.
Requirements: What Makes a Great Solution?
Clarify scope before designing anything
Requirements Exploration Questions
Ask your interviewer these questions to refine requirements
Which mail surfaces are in scope?
- ·Inbox, sent, archive, labels, search
- ·Threaded conversations vs flat messages
- ·Desktop split pane and mobile navigation
What triage actions are required?
- ·Read/unread, archive, delete, snooze, labels
- ·Bulk selection
- ·Undo window
How does compose work?
- ·Draft autosave
- ·Attachments
- ·Reply, reply-all, forward
How fresh must mailbox state be?
- ·Polling vs push sync
- ·Cross-tab updates
- ·Offline reading and writes
What security constraints apply?
- ·Remote images
- ·Untrusted HTML
- ·PII in previews and notifications
Functional Requirements
Must Have — MVP
- ✓Mailbox and label navigation
- ✓Virtualized thread list with selection and search
- ✓Thread reader with message expand/collapse
- ✓Compose, reply, draft autosave, attachments, and send status
- ✓Optimistic triage with undo and error recovery
- ✓Keyboard shortcuts and screen-reader friendly focus moves
Advanced (If Time Permits)
- +Offline outbox and queued send
- +Realtime sync cursors across tabs
- +Schedule send and snooze
- +Conversation search result highlighting
Non-Functional Requirements
Performance Targets
- ·Inbox first page paints quickly from summaries
- ·Scrolling thousands of threads keeps DOM bounded
- ·Message body fetches are lazy per thread
- ·Compose typing is isolated from mailbox rerenders
Reliability & Consistency
- ·Draft survives refresh and attachment retry
- ·Unread counts reconcile after reconnect
- ·Bulk triage is idempotent
- ·Sync gaps refetch mailbox summaries
Accessibility & Input Support
- ·Keyboard-first flows with visible focus and predictable tab order
- ·Screen-reader announcements for async changes using aria-live where appropriate
- ·Reduced-motion alternatives for animated transitions
- ·Pointer, touch, and keyboard parity for every core action
Security & Privacy
- ·Sanitize and sandbox message HTML
- ·Proxy or gate remote images
- ·Never trust attachment MIME or filename from sender
Observability
- ·Track Core Web Vitals plus domain-specific interaction latency
- ·Measure API error rate, retry rate, stale-cache usage, and client exceptions
- ·Emit structured events for critical user journeys and abandoned flows
The full solution is part of HelloFrontend Pro
The question above is free to read in full. Upgrade to unlock the interactive workspace and the senior-level walkthrough that go with it.
- Full RADIO-framework walkthrough with architecture diagrams
- Data model, API design, and rendering strategy trade-offs
- Performance, accessibility, and offline sections plus a model answer
Already a member? Log in to open the workspace.