← Questions

Design the front end of a desktop AI chat app

0
AnthropicSystem designLast asked Sep 2025

A system design interview question asked in Anthropic's live technical screen, last asked Sep 2025. It tests frontend, state management and real-time.

Design the client side of a cross-platform desktop chat app for an AI assistant (built with Electron, Tauri or a native web view): the list of conversations, the chat view, attachments, several windows, and the model's replies streaming in token by token. This is a front-end system design round: the focus is the app's architecture, not the servers.

Requirements

  • Functional: conversation list and search; chat view with streamed replies, Markdown and code blocks; file attachments; drafts kept per conversation; several windows open on different chats; work offline on cached history; sync with the cloud account.
  • Non-functional: typing and scrolling stay smooth while a reply streams; conversations with thousands of messages open fast; modest memory use; secure handling of local files and secrets; safe auto-updates.

Clarifying questions

  • Which platforms, and is the shell already chosen (Electron, Tauri, native)?
  • Is the backend API fixed (SSE or WebSocket for streaming)?
  • How much must work offline: reading only, or composing and queueing messages?
  • Can the same conversation be edited on two devices at once?
  • Are plugins or third-party extensions planned?

What a strong answer covers

  • Process model: a privileged main process (files, keychain, updates) and sandboxed renderers talking over a narrow, typed IPC surface; no Node access from rendered content.
  • State: a normalized store (conversations, messages, drafts, stream status) with the local database (SQLite or IndexedDB) as the source the UI reads; sync with the server by message ids and versions; shared across windows through the main process.
  • Streaming: append tokens to the message in a buffer and render at most once per animation frame; parse Markdown incrementally; never re-render the whole conversation per token.
  • Long conversations: list virtualization, lazy loading older messages, and keeping scroll anchored while a reply grows.
  • Dropped connections mid-reply: the server keeps generating; the client resumes the stream from the last received offset, or refetches the finished message, and shows a clear state.
  • Security: sanitize rendered Markdown and HTML, a content security policy, scoped file permissions, secrets in the OS keychain, signed updates with rollback.
  • Testing, crash reporting and privacy-preserving telemetry, accessibility (keyboard, screen readers) and internationalization.

Follow-ups

  • Electron against Tauri: memory, bundle size, security and team skills. Which would you pick?
  • Add a plugin system without giving plugins access to every conversation.
  • Encrypt history at rest. Where does the key live?
  • A user reports the app is slow after a month of use. How do you find out why?

Where it's asked

  • Anthropic · Live technical screen · Last asked Sep 202555 min · One engineer on video with screen share, usually in CodeSignal (Google Colab for research roles), Python by default; one practical problem that grows in parts · No AI; looking up documentation and searching the web is fine

What it tests

frontend · state management · real-time · llm

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing