React Developer Interview Question

Explain controlled versus uncontrolled components, and how you pick between them for a form.

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

In a controlled component React state is the source of truth: the input reads its value from state and every keystroke goes through onChange. In an uncontrolled component the DOM keeps the value and you read it with a ref or from the form data on submit. Controlled gives you live validation and derived UI; uncontrolled means far fewer renders and less code on big forms.

Why interviewers ask this

The interviewer is checking that you know where state actually lives and that you do not default to controlled everything out of habit. They also want awareness of the cost, since a controlled input re-renders its subtree on every keystroke, which is fine for three fields and painful for eighty. A modern answer mentions form actions and libraries that keep inputs uncontrolled on purpose.

How to structure your answer

  • Define both by where the value lives.
  • Say what each one buys you, live validation versus fewer renders.
  • Give your default and the point at which you switch.
  • Mention form actions or a form library and why they lean uncontrolled.

Example answer

Spoken example, first person

Controlled means React owns the value: value comes from state, onChange writes it back, and the input cannot change without a render. Uncontrolled means the DOM owns it and I only read it when I need it, either through a ref or from the submitted form data. My default for small forms is controlled, because I usually want validation as the user types or a field that depends on another field. Once a form gets past roughly fifteen or twenty inputs, or once I have a field that fires an expensive re-render on each keystroke, I flip to uncontrolled and validate on blur and on submit. That is also what the popular form libraries do under the hood, they register inputs and subscribe narrowly instead of re-rendering the whole form. With React 19 form actions I lean uncontrolled even more, because the action gets the FormData for free, so for a plain create or edit form I can skip the state entirely and just handle the pending and error states from useActionState.

Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.

See how it works

Follow-up questions to expect

  • What is the warning React gives when an input flips from uncontrolled to controlled, and why?
  • How would you validate an uncontrolled form on submit?
  • How do React 19 form actions change your approach here?

Related react developer questions

Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.

Predict my questions

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot