Design an AI chatbot with browser storage
Company: OpenAI
Role: Software Engineer
Category: ML System Design
Difficulty: medium
Interview Round: Technical Screen
Design an AI chatbot system with a frontend focus under these constraints: user messages and conversation history are not stored in any server-side database and instead live in the user's browser; bot messages must be streamed to the user; refreshing the page starts a new conversation; and user credential handling must be addressed on the client. Describe the architecture (client, edge, backend/LLM), data flow, how streaming is implemented (SSE vs WebSockets), session management without a server database, security for credentials and API access, rate limiting, failure modes and retries, and trade-offs of the no-DB approach.
Quick Answer: This question evaluates a candidate's system-design and ML-integration skills for privacy-preserving, browser-only AI chatbots, including client-side state and session management, streaming response delivery, security of credentials and API keys, rate limiting, failure modes, and trade-off analysis.