React Interview Questions: Props, State, Hooks and Keys Explained

LAB 11 The Interview Lab · Full-Stack Developer

React interview essentials made simple

Learn components, props, state, hooks, keys and the virtual DOM with everyday examples, real interview questions and model answers.

⏱ 10 min🎯 Freshers & junior developers🧪 4 hands-on drills
Your lab progress0 of 4 drills done
Spot itDecodeBuildTest

React is a JavaScript library for building user interfaces. React questions come up in many full-stack and front-end interviews, from campus drives to experienced roles. Interviewers rarely want textbook lines. They want to see that you understand why React works the way it does.

In this lab you will learn the five ideas that come up again and again: components, props and state, hooks, keys and the virtual DOM. You will also practise one clear way to answer any React concept question in under a minute.

The big idea: Define, Example, Why

Every React concept question can be answered in three short steps. This works for props, hooks, keys and anything else they ask.

Step 1
FRAME 1
Define
Say what it is in one simple, correct sentence.
Step 2
FRAME 2
Example
Show a tiny real use from your code or project.
Step 3
FRAME 3
Why
Say what problem it solves or what bug it prevents.
Do not just define a hook. Show where you used it and what problem it solved.
Drill 1 · Spot it

Spot the difference

Question: “What is the difference between props and state?” Switch between the two answers and watch what changes.

Props and state are both used in React. Props means properties and state means the state of the component. Both store data. We use props in functional components and state in class components, and useState is also there for state. Basically props are passed and state is not passed. Both are very important concepts and are used in every React project.
✕ Circular: “props means properties” explains nothing
✕ Wrong: both work in function components
✕ No example and no reason why it matters
Drill 2 · Decode

Quick concept check

Tap each card to flip it and check your answer.

Key concepts, explained simply

Everyday picture first, then the correct technical answer.

ComponentsLike LEGO blocks. A component is a JavaScript function that returns JSX, which looks like HTML. You build a page by joining small components like Navbar and ProductCard. Names start with a capital letter.
PropsLike the address on a courier parcel: the sender fills it in, the receiver only reads it. A parent passes props to a child. Props are read-only inside the child.
State and useStateLike a scoreboard the component keeps. useState gives you the current value and a setter. Calling the setter makes React re-render with the new value. Never change state directly.
useEffectFor side effects, meaning work outside drawing the UI, like fetching data or starting a timer. The dependency array controls when it runs again. Return a cleanup function to stop timers or listeners.
KeysLike roll numbers in a class: they tell React which item is which. A key must be unique among its siblings and should not change between renders.
Virtual DOM and reconciliationLike comparing two drafts and rewriting only the changed lines. React builds a new UI tree, compares it with the previous one (this is called reconciliation), then updates only what changed in the real DOM.
import { useState, useEffect } from 'react';

function Counter({ label }) {
  const [count, setCount] = useState(0);

  useEffect(() => {
    document.title = label + ': ' + count;
  }, [label, count]);

  return <button onClick={() => setCount(count + 1)}>{label}: {count}</button>;
}
💡 Here label is a prop, count is state, and the effect re-runs only when label or count changes. If you can explain these 10 lines out loud, you can answer most basic React questions.
Drill 3 · Build

Build a concept answer

Fill the blanks. Your answer writes itself on the right.

Your answer
Start typing on the left and your answer will appear here.
⏱ ~0 seconds spoken0 words

Three model answers you can adapt

Two common concept questions and one “explain your React project” answer.

“useState is a hook that lets a function component remember a value between renders. It returns the current value and a setter function. In my to-do app, I kept the list of tasks in state. When a user added a task, I called setTasks with a new array instead of pushing into the old one, so React noticed the change and re-rendered the list.”

Four mistakes that quietly cost you the job

Changing state directlyWriting tasks.push(x) or user.name = ‘Asha’ does not tell React anything changed. Create a new array or object and pass it to the setter.
Using the index as key everywhereThe index is fine for a fixed list that never changes. For lists that change, use a unique id, or inputs and animations can attach to the wrong item.
Missing useEffect dependenciesIf your effect uses a value but does not list it, it can run with old data. List every value it uses, and add a cleanup for timers and event listeners.
Copying props into stateCopying a prop into state without a reason creates two sources of truth that can go out of sync. If the parent owns the data, read it straight from props.
Drill 4 · Test

Test yourself

Question 1 of 5

0:00

Rehearse before the real thing

Press start and explain “props vs state” out loud using Define, Example, Why. A strong concept answer usually fits in 45 to 60 seconds. Stop before 90.

Interview Lab · 11
React Interview Essentials
  1. 1Props in, state inside
  2. 2Never change state directly
  3. 3Use stable ids as keys
  4. ★Define, example, why
worldremotejobs.com@keshav_consults

Screenshot it. Save it. Share it.

Keep this card on your phone and look at it five minutes before your interview.

Share on WhatsApp
Next in the lab
Lab 12 · No Work Experience? How to Talk About Projects and Internships
Open lab →

Quick answers

Do I still need to learn class components?

New React code uses function components and hooks, and the official docs teach those first. But many older company projects still have class components, so know the basics: this.state, setState and lifecycle methods like componentDidMount.

Why does my useEffect run twice in development?

In development, React Strict Mode runs your effect setup and cleanup one extra time when the component mounts. This helps you catch missing cleanup. It does not happen in the production build.

Should I use Create React App for a new project?

No. The React team deprecated Create React App in 2025. For new projects, the React docs suggest a framework such as Next.js, or a build tool such as Vite if you want to set things up yourself.

Is React a library or a framework?

React calls itself a library for building user interfaces. It handles the view part. For routing, data loading and server rendering, you add other tools or use a framework built on React, like Next.js.

More remote jobs

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *