Interview Q&A / React
React interview questions
Rendering, state, hooks, keys and effects, explained with small examples.
Prefer rapid revision? Practise React short interview answers →
- What is the difference between controlled and uncontrolled components in React?
In a controlled component, React state holds the input's value and every change goes through an onChange handler. In an uncontrolled component, the browser DOM keeps the value and you read it when needed, for example with a ref or from the form data on submit.
BeginnerIn-depth3 min read - What is the difference between state and props in React?
Props are inputs passed into a component by its parent and are read-only inside it. State is data a component owns and can change over time, and changing it makes the component re-render.
BeginnerIn-depth3 min read - What is the virtual DOM, and how does reconciliation work in React?
The virtual DOM is React's lightweight description of what the UI should look like, made of plain JavaScript objects. On each update React compares the new description with the previous one (reconciliation) and changes only the parts of the real DOM that differ.
BeginnerIn-depth4 min read - Why do keys matter when rendering lists in React?
Keys tell React which list item is which between renders, so it can keep the right state with the right item when the list changes order, grows or shrinks.
BeginnerIn-depth2 min read