Frontend Coding Patterns
The live component-build interview is not a memory test — it is a pattern-matching test. Strong candidates do not invent a fresh solution under pressure; they recognise the prompt as one of a handful of patterns they have built a dozen times, and reach for the skeleton.
try to break it
you drive.
function NameField() {
const [name, setName] = useState("");
return (
<input
value={name} // state -> UI
onChange={(e) => setName(e.target.value)} // UI -> state
/>
);
}When to reach for it: Any form field: search box, login, settings. The UI must react to what was typed (validate, filter, enable a button).
The tell: Heard "build a form / make this input do X as you type" → state drives value, onChange writes it back.
Almost every "build me a component" prompt is one of these four — or two of them stacked (a list + filter that fetches, a compound component whose parts hold controlled inputs). Recognise the pattern, reach for the skeleton, then customise.