Skip to content
Live on Product Hunt

We just launched BrainUp on Product Hunt. Thanks for coming over!

BrainUp
  • Templates
  • Resume Guides
  • Blog
  • Pricing
  • Contact
Log inBuild Resume
  • Templates
  • Resume Guides
  • Blog
  • Pricing
  • Contact
  • Log in
Build My Resume — Free
BrainUp

Build your resume. Then build your advantage. The career productivity toolkit for your whole job search.

Products

  • Free Resume Builder
  • Cover Letter Builder
  • LinkedIn Optimizer (Premium)
  • AI Interview Prep (Premium)
  • Job Tracker (Premium)

Resources

  • Resume Templates
  • Resume Guides
  • Career Blog

Company

  • Pricing
  • Contact us

Legal

  • Terms
  • Privacy
  • Cookies

© 2026 BrainUp. All rights reserved. ·

BrainUp is a career productivity tool, not a recruitment agency. We help you prepare — we don't guarantee interviews, job offers or ATS outcomes.

BrainUp

  1. Home
  2. React Interview Questions

React interview prep

React Interview Questions: Hooks, State and Rendering

React interviews test how well you understand rendering: props vs state, hooks and their rules, useEffect dependencies, keys in lists, avoiding unnecessary re-renders and where state should live. Most rounds end with building a small component live.

Practise with AI Interview PrepSee React developer resume
  • 16 questions answered
  • Hooks-focused
  • Fresher to mid-level
  • Machine-coding tips

Sample answers

Explain the rendering model, not just the API.

Strong answers show you know why React behaves the way it does.

Model answers for 4 React questions

Typical round: concepts, then a 30-45 minute component build

Q: What is the difference between props and state? A: Props are inputs passed from a parent and are read-only inside the component. State is data the component owns and updates with a setter, which triggers a re-render. If two siblings need the same data, lift the state to their common parent.

Q: How does useEffect's dependency array work? A: The effect runs after render, then again only when a value in the dependency array changes. An empty array runs it once after mount; no array runs it after every render. Return a cleanup function for subscriptions or timers.

Q: Why do lists need keys? A: Keys let React match list items between renders. Stable, unique keys like IDs keep state attached to the right item; using the array index can cause bugs when items are inserted, removed or reordered.

Q: How do you stop unnecessary re-renders? A: First measure with the React DevTools Profiler. Then keep state close to where it's used, wrap expensive children in React.memo, and stabilise props with useMemo or useCallback only where profiling shows a real cost.

What interviewers check

Built for scanners, humans and hiring intent.

  • Rendering model

    When and why components re-render is the question behind most React interview questions.

  • Hooks and their rules

    useState, useEffect, useRef, useMemo and custom hooks, plus why hooks can't be called conditionally.

  • Performance thinking

    Memoization, list virtualisation and code splitting show you have worked on real apps.

  • Building components live

    A todo list, search with debounce or a modal is common in machine-coding rounds.

Examples

Copy the structure, not the wording.

These examples show shape and specificity. Add your own facts, metrics, tools and outcomes.

Core concepts

  • What is the virtual DOM?
  • What is JSX?
  • Controlled vs uncontrolled components?
  • What is lifting state up?
  • What are React fragments?

Hooks questions

  • What are the rules of hooks?
  • useMemo vs useCallback?
  • When would you use useRef?
  • How do you write a custom hook?
  • What is useReducer good for?

Machine-coding tasks

  • Build a search box with debounced API calls.
  • Build a paginated list from an API.
  • Build a reusable modal with a close-on-escape key.
  • Build a star rating component.
  • Build a todo list with add, edit and delete.

Actionable tips

Small edits that lift response rates.

Run through these before every application.

  1. 1Talk while you codeIn machine-coding rounds, explain your component structure and state before typing.
  2. 2Handle loading and errorsShow loading, empty and error states in API tasks. Interviewers notice when you skip them.
  3. 3Know one state libraryBe ready to compare Context with Redux Toolkit or Zustand and say when you'd pick each.
  4. 4Mention testingA line about React Testing Library shows you care about maintainable code.
  5. 5Rehearse explanationsBrainUp AI Interview Prep asks React questions for your level and gives feedback on your answers.

FAQ

Common questions, direct answers.

What is React?

React is a JavaScript library for building user interfaces from reusable components. It updates the UI efficiently when data changes, using a virtual DOM to work out what to change.

What is the virtual DOM?

The virtual DOM is a lightweight JavaScript copy of the UI. React compares the new copy with the previous one and updates only the changed parts of the real DOM.

What is the difference between props and state?

Props are read-only inputs from a parent component. State is data owned by a component and updated with a setter, which causes a re-render.

What are hooks in React?

Hooks are functions like useState and useEffect that let function components use state, side effects and other React features without classes.

What are the rules of hooks?

Call hooks only at the top level of a function component or custom hook, never inside loops, conditions or nested functions, so React can keep their order stable between renders.

How does useEffect work?

useEffect runs a side effect after render. Its dependency array controls when it re-runs, and it can return a cleanup function that runs before the next effect or on unmount.

What is the difference between useMemo and useCallback?

useMemo caches the result of a calculation. useCallback caches a function reference. Both re-compute only when their dependencies change.

Why are keys important in lists?

Keys help React identify which items changed, were added or removed. Use stable unique IDs; array indexes can break state when items are reordered.

What is a controlled component?

A form input whose value is driven by React state and updated through onChange. An uncontrolled component keeps its own value in the DOM, read with a ref.

What is the Context API?

Context passes data like theme or user details through the component tree without prop drilling. Every consumer re-renders when the context value changes.

What is React.memo?

React.memo wraps a component so it skips re-rendering when its props are shallowly equal to the previous props.

What is prop drilling and how do you avoid it?

Prop drilling is passing props through many layers that don't use them. Avoid it with composition, Context, or a state library for widely shared state.

What is useRef used for?

useRef holds a mutable value that persists across renders without causing re-renders, commonly used for DOM access, timers or previous values.

What is code splitting in React?

Code splitting loads parts of the app only when needed, using React.lazy and Suspense or route-based splitting, to reduce initial bundle size.

What is the difference between React and Next.js?

React is a UI library. Next.js is a framework built on React that adds routing, server rendering, static generation and API routes.

How should I prepare for a React interview?

Revise rendering, hooks and state management, build 5-6 common components from scratch under time limits, and be ready to explain one React project you shipped.

Related guides

Keep improving your application.

  • React Developer ResumePresent the React work you'll be asked about.View React resume →
  • Frontend Developer ResumeThe broader frontend format beyond React.View frontend resume →
  • Core Java Interview QuestionsFull-stack roles often pair React with a Java backend.See Java questions →

Practise React interview answers out loud

BrainUp AI Interview Prep runs frontend mock interviews and scores your explanations.

Start interview practiceBrowse templates

The resume builder and PDF downloads are free. AI tools are part of BrainUp Premium.