OpenAI·Software Engineer·Onsite - System Design / Architecture
Jul 2026
System design round at OpenAI for a software engineering role, focused entirely on building a real-time streaming chat UI in React. The question was deceptively deep and kept branching into concurrency, state management, and reliability edge cases I wasn't fully prepared for.
- Walk through how you'd design and build a React chat interface where assistant responses stream in token by token, users can send new messages mid-stream, and multiple conversation threads can be active at once.
- Name two pieces of state that only exist while a stream is active and explain how and when you clean them up.
- How do you make sure streamed tokens append correctly without flickering or overwriting content, especially when state updates are happening rapidly?
- What can go wrong when multiple responses are streaming concurrently, and how do you prevent one stream from corrupting another's state?
- When would you use useRef versus useState in this streaming scenario, and what's your general rule for deciding?
- If the same network request gets sent twice due to a double-submit, retry, or StrictMode remount, how do you prevent a duplicate assistant message from appearing?
- React 18 StrictMode mounts effects twice in development. How does that interact with opening a stream inside useEffect, and how do you make the setup and teardown idempotent?
- The connection drops halfway through a streaming response. How do you handle recovery, and what do you need from the server contract to support it?
- Rendering on every token tanks performance for long message lists. How would you diagnose this and what techniques would you apply?
- If you moved the entire streaming state machine out of React component state, where would it live and what do you gain or lose compared to keeping it in useReducer?
“This started as a React question and turned into a full system design conversation.” The rest of the author's notes on Software Engineer interview at OpenAI, Onsite - System Design / Architecture round, covers how they worked through the question, what the panel pushed back on, and what they would do differently.
View Post