OpenAI·Frontend Engineer·Technical Phone Screen
- Build a minimal chat interface where the user submits a prompt and the assistant's response streams in token by token. Walk through the component structure, state management, and how you'd handle the incremental rendering.
- How would you prevent duplicate submissions while a stream is still in progress, and what do you do about the request that's already running?
- A response can be hundreds of small chunks. How do you keep the UI responsive and avoid performance problems from re-rendering on every single chunk?
- What happens if a slow chunk from a previous request arrives after a newer request has already started?
- How would you extend this to a multi-turn scrolling conversation while keeping the streaming bubble performant?
- Walk through adding a Stop Generating button. What state changes and what do you actually cancel?
- How would you handle auto-scroll-to-bottom behavior without yanking the user's scroll position if they've scrolled up to read earlier messages?
- How would you make streaming text accessible to screen reader users, and how would you test the streaming behavior in a deterministic way?
“The state model tripped me up at first.”