Design a GPT chat UI with snapshots and sharing
Company: OpenAI
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Technical Screen
Design an end-to-end web application for interacting with a GPT-like model. It must:
(
1) let users enter a prompt, submit, establish a session/connection to the model, and stream tokens in real time to the UI;
(
2) save a snapshot of the current state, including conversation messages, system prompt, model/version, and tuning parameters (e.g., temperature, top_p) with timestamps;
(
3) support full-text and metadata search over saved snapshots (by content, tags, creator, date); and
(
4) allow sharing snapshots with others via links and role-based access (public/unlisted/team; view/comment/duplicate). Describe the high-level architecture (frontend, backend, data stores, search/indexing), API design, data schemas, and how you would implement real-time transport (SSE vs WebSocket), streaming backpressure, idempotency, retries, and error handling. Cover authentication/authorization, multi-tenant isolation, rate limiting, auditing, cost tracking, and privacy/compliance considerations. Explain frontend state management for live streaming (pause/resume, partial updates, optimistic UI), snapshot versioning, and how to prevent data loss on network interruptions. Discuss scalability (stateless services, session affinity, caching), consistency choices, observability (logs, traces, metrics), deployment strategy, and capacity estimation. Outline testing strategies (unit, contract, E2E) and how you would enable offline drafts that later sync.
Quick Answer: This question evaluates system-design and engineering competencies for building a multi-tenant LLM chat web application, covering real-time token streaming, snapshot/versioned data modeling, full-text and metadata search, API and schema design, role-based sharing, security, and frontend state management.