Question 1
Streaming chat composer
Build a composer that accepts a user message, renders the user bubble immediately, and appends an assistant response as streamed chunks arrive.
Strong answer should cover
- Readable state shape for messages, draft input, pending request id, and stream status.
- Incremental text rendering without blocking typing, selection, or scroll position.
- Error and retry states that preserve the user prompt and partial assistant text.
- Clear separation between transport code and rendering logic.
Question 4
Accessibility/keyboard interaction
Make the chat input, send button, stop control, regenerate action, and message list usable from keyboard and assistive technology.
Strong answer should cover
- Correct textarea behavior for Enter, Shift+Enter, focus restoration, and disabled states.
- Accessible button names that change with send, stop, and regenerate modes.
- Live region strategy for streamed assistant output without excessive announcements.
- Visible focus states and logical tab order across composer and message actions.
- Respect for reduced motion and high-contrast reading needs.
Question 5
Frontend system design/conversation history
Design the frontend architecture for conversation history, message virtualization, search, local recovery, and sync with server-side threads.
Strong answer should cover
- Data model for threads, messages, streaming drafts, attachments, and pagination cursors.
- Cache and persistence plan for recent conversations, offline recovery, and invalidation.
- Virtualized rendering and scroll anchoring for long conversations.
- Privacy, retention, and redaction considerations for sensitive chat content.
- Observability for latency, stream failures, and client-side rendering errors.