TOPIC-WISE INTERVIEW PRACTICE

React interview questions and quick answers

Rendering, state, hooks, keys and effects, explained with small examples.

Review 944 questions and short answers on React. Start with real examples below, then search, practise and follow links to full explanations.

944 questionsFree revision22 topics
START HERE

React: questions worth revising first

These answers come from AI Tapri's existing question bank and published interview guides. Open each answer and read the linked in-depth guide for examples and context.

01Can a child component modify the props it receives?

No. Props are read-only; React treats them as immutable snapshots from the parent. To change a value, the parent passes down a callback, and the child calls it so the parent updates its own state.

Read the full explanation
02Is it fine to use the array index as a key in a React list?

Only when the list is static: never reordered, filtered, or inserted into. If items can move or be removed, index keys make React reuse the wrong component state and DOM, so use a stable ID from the data.

Read the full explanation
03When should you use Context instead of prop drilling or a state management library?

Pass props when only a few levels need the data. Use Context for values many components read but that change rarely, such as theme, language or the logged-in user. Reach for a state library when shared state is large, updates often, or needs tools like selectors and devtools.

Read the full explanation
04What 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.

Read the full explanation
05For a simple contact form, would you use controlled or uncontrolled inputs?

For a few fields that are only read on submit, uncontrolled inputs with FormData are enough and re-render less. Use controlled inputs when you need live validation, dependent fields, formatting as the user types or to disable the button.

Read the full explanation
06What is the difference between function components and class components, and which should you use today?

Function components are plain functions that use hooks for state and lifecycle behaviour. Class components use this.state and lifecycle methods. New code should use function components; classes still work, and error boundaries still need a class.

Read the full explanation
07What is a common pitfall related to "Can a child component modify the props it receives"?

Mutating an object prop, for example props.user.name = x, which breaks memoisation and causes stale UI.

Read the full explanation
08How would you explain "Can a child component modify the props it receives" in an interview?

"Props are read-only, so a child must never mutate them. The usual pattern is lifting state up: the parent owns the value and passes a callback like onChange. The child calls it, the parent updates state, and the child re-renders with the new prop."

Read the full explanation
YOUR PRACTICE SPACE

Find your next answer.

Pick a topic, search a keyword, or open a question to reveal the answer.

944 questions available
REACT

React quick answers

Showing 18 of 944
926 remaining

Free to practise. No account needed. Made for quick revision, not rote memorisation.

Keep preparing for React

Quick answers help with recall; detailed guides explain the reasoning, examples and common mistakes behind each answer.

More topics to practise