Prompt 1
Build a chat interface in React during a one-hour pairing session
Practice version modelled on a reported round: Public report: xAI Frontend Engineer interview account on Taro, August 2025
What this measures
Clarify first
Confirm whether the reply arrives at once or as a stream, whether a mock is acceptable, and what the interviewer wants to see working first. Confirm the setup: TypeScript or JavaScript, any starter code, and whether styling matters inside the hour.
Strong answer should cover
Say the plan before coding: one messages array as the source of truth, a composer with a controlled value, and a status per message (sending, sent, failed). Render the list from state, key each item by a stable id, and keep the scroll pinned to the latest message until the reader scrolls up. Explain each hook as you use it: useCallback keeps a stable handler reference for a memoised child and changes nothing where no child memoises. Keep Send disabled on a blank draft and while a reply is in flight, and give a failed send a visible retry that does not duplicate the user turn.
Common miss: