React Interview Prep

200+ React Interview Questions

Comprehensive React interview prep covering components, hooks, state management, lifecycle methods, context, and more. Questions asked at Razorpay, Flipkart, Google, Atlassian, Swiggy, CRED and other top tech companies.

🚀 Practice Now — It's Free💻 Output Quiz🐛 Debug Lab
131+
Questions
23
Categories
9+
Companies
72+
With Code
🏢 Asked at:MetaRazorpayFlipkartGoogleAtlassianCREDSwiggyAmazon

All Questions by Category

Advanced Patterns3

advancedWhat is Error Boundary and how do you implement one?advancedWhat is the Suspense pattern and data fetching with it?advancedWhat is prop spreading and when is it an anti-pattern?

Async & Effects3

advancedState update after component unmount
MetaFlipkart
debug
expertRace condition — earlier slow request overwrites later fast one
MetaGoogle
debug
advancedMissing await causes render before data is ready
MetaFlipkart
debug

Async in React4

expertAbortController — cancel fetch on unmount
MetaRazorpay
output
advancedPromise.all in useEffect — parallel fetch, single state update
MetaRazorpay
output
expertOptimistic update — immediate UI, rollback on failure
MetaFlipkart
output
advancedDebounced search — only fires after typing stops
FlipkartSwiggy
output

Component Logic2

advancedEarly return before hooks — violates Rules of Hooks
MetaFlipkart
debug
advancedDerived state in useEffect causes double render
MetaFlipkart
debug

Component Patterns8

coreWhat is the Compound Component pattern?coreWhat is the Render Props pattern and when would you still use it?advancedWhat is the Provider pattern and how do you build a scalable context architecture?advancedWhat is the Container/Presentational pattern? Is it still relevant?advancedChildren prop — components as data
MetaFlipkart
output
expertRender props — caller controls rendering
MetaAtlassian
output

Concurrent React2

advancedWhat is Concurrent Mode and what problems does it solve?advancedWhat are useTransition and useDeferredValue?

Ecosystem4

coreWhat is the difference between Next.js Pages Router and App Router?coreWhat is TanStack Query (React Query) and what does it solve?coreWhat is Zustand and how does it compare to Context?advancedWhat are the key differences between Vite and Create React App?

Event Loop & Batching8

advanceduseEffect fires after render — not during
MetaFlipkart
output
advancedMultiple state updates — renders before and after
MetaGoogle
output
expertstartTransition marks updates as non-urgent
MetaGoogle
output
advancedPromise chain order inside useEffect
MetaRazorpay
output
expertRace condition — last request wins with cancelled flag
MetaGoogle
output
advanceduseLayoutEffect vs useEffect timing
MetaFlipkart
output

Forms1

coreWhat is react-hook-form and why is it better than manual controlled forms?

Hook Patterns4

advanceduseEffect missing cleanup — subscription leaks
MetaFlipkart
debug
expertuseEffect infinite loop — object in deps
MetaGoogle
debug
advanceduseMemo returns cached value but deps comparison is wrong
MetaFlipkart
debug
expertCustom hook shares state with multiple callers — should not
MetaFlipkart
debug

Hooks13

beginnerWhat are the Rules of Hooks and why do they exist?beginnerExplain useState — batching, functional updates, and lazy initialization.beginnerHow does useEffect work? What are its dependency array behaviors?coreWhat is the difference between useEffect and useLayoutEffect?coreWhat is useRef and what are its two main use cases?coreWhat is useContext and when should you avoid it?

Hooks & Closures14

advancedStale closure in setInterval — count never updates
MetaFlipkart
output
advancedFunctional update reads latest state — closure does not
MetaRazorpay
output
expertuseEffect deps — effect runs only on relevant changes
MetaAtlassian
output
advancedCustom hook returns fresh state each call — no sharing
MetaFlipkart
output
expertuseCallback identity — same deps, same reference
MetaGoogle
output
advancedusePrevious — ref holds last render's value
FlipkartSwiggy
output

Memoization2

advancedReact.memo useless without stable callback prop
MetaFlipkart
debug
expertuseMemo dep missing — stale filtered list
MetaFlipkart
debug

Memoization & Identity6

advancedReact.memo — skips when props shallowly equal
MetaFlipkart
output
advanceduseMemo — recomputes only on dep change
MetaFlipkart
output
expertNew object prop bypasses React.memo
MetaFlipkart
output
advanceduseCallback vs inline function — identity difference
MetaFlipkart
output
expertContext re-render — every consumer re-renders on value change
MetaGoogle
output
expertStable context value with useMemo prevents cascading re-renders
MetaGoogle
output

Performance8

coreWhat is React.memo and when does it actually prevent re-renders?coreWhat is code splitting and lazy loading in React?advancedWhat is virtualization (windowing) and when do you need it?advancedWhat causes unnecessary re-renders and how do you diagnose them?advancedWhat is the React Profiler and how do you use it to diagnose performance issues?advancedContext value unstable — all consumers re-render
MetaGoogle
debug

React Fundamentals18

beginnerWhat is React and what problem does it solve?beginnerWhat is JSX and how does it work under the hood?beginnerWhat is the Virtual DOM and how does reconciliation work?beginnerWhat is the difference between a controlled and uncontrolled component?beginnerWhat are props and how is prop drilling a problem?coreWhat is the key prop and why is it critical in lists?

React Router2

beginnerHow does React Router v6 work and what are the key hooks?coreHow do you implement protected routes in React Router?

Refs & Side Effects4

advancedRef vs state — ref doesn't cause re-render
MetaFlipkart
output
advancedforwardRef — parent accesses child's DOM node
MetaAtlassian
output
expertuseImperativeHandle — expose limited API via ref
MetaGoogle
output
expertRef callback — fires on mount and unmount
MetaGoogle
output

Server Components2

advancedWhat are React Server Components (RSC) and how do they differ from SSR?advancedWhat is hydration and what causes hydration errors?

Stale Closures4

advancedsetInterval always reads initial count
MetaRazorpay
debug
advancedEvent handler reads stale count from first render
MetaFlipkart
debug
expertuseCallback stale dep — handler misses latest value
MetaGoogle
debug
expertClosure captures object reference — works differently than expected
MetaAtlassian
debug

State & Immutability14

coreObject spread creates new reference — mutation does not
MetaRazorpay
output
advancedNested state requires full spread chain
MetaFlipkart
output
advancedArray state — push mutates, spread does not
MetaRazorpay
output
advancedUpdating array items immutably with map
MetaFlipkart
output
advancedRemoving from array state with filter
MetaFlipkart
output
expertObject.is comparison — what React uses for state bail-out
MetaGoogle
output

State Management2

beginnerWhat are the different state management options in React and when do you use each?coreWhat is server state vs client state and why does the distinction matter?

Testing3

coreWhat is React Testing Library and what is its testing philosophy?coreHow do you test custom hooks?advancedHow do you mock API calls in React tests?

Core React Topics

Rendering & PerformanceReact useEffect HookReact useContext HookConcurrent Rendering (React 18)React useState HookReact Fiber ArchitectureBrowse All Topics →

Frequently Asked Interview Questions

What is React?

React is a JavaScript library for building user interfaces using a component-based architecture. It allows developers to create reusable UI components and efficiently update the DOM using a Virtual DOM.

What is the Virtual DOM?

The Virtual DOM is a lightweight JavaScript representation of the real DOM. React uses it to compare previous and current UI states and update only the changed parts in the real DOM for better performance.

What triggers a re-render in React?

A re-render is triggered when state changes, props change, or context updates. A parent re-render can also cause child components to re-render unless optimizations like React.memo are used.

What is reconciliation in React?

Reconciliation is the process of comparing the old Virtual DOM with the new one to determine what has changed. React uses an optimized diffing algorithm to update only the necessary parts of the DOM.

What is the difference between useEffect and useLayoutEffect?

useEffect runs asynchronously after the browser paints, making it suitable for side effects like API calls. useLayoutEffect runs synchronously after DOM updates but before paint, useful for measuring layout or synchronizing UI changes.

What are controlled and uncontrolled components?

Controlled components manage form input values through React state, while uncontrolled components store their own state in the DOM and are accessed using refs. Controlled components provide better control and validation.

What is React.memo?

React.memo is a higher-order component that prevents unnecessary re-renders by memoizing a component. It performs a shallow comparison of props and skips rendering if props have not changed.

What are keys in React and why are they important?

Keys are unique identifiers used in lists to help React track elements during reconciliation. Stable keys allow React to update only changed items, improving performance and preventing UI bugs.

What is batching in React?

Batching is the process of grouping multiple state updates into a single render for performance optimization. React automatically batches updates in event handlers and async operations in modern versions.

What is React Fiber?

React Fiber is the internal reconciliation engine introduced in React 16. It enables interruptible rendering, prioritization of updates, and smoother UI by breaking work into smaller units.

How to Prepare for React Interviews

🧠

Understand, don't memorize

Focus on why React behaves the way it does — rendering patterns, state management, hooks behavior. Interviewers can tell the difference.

💻

Predict output before running

Use output quiz questions to train your mental model. If you can predict what code logs, you truly understand the concept.

🐛

Debug real bugs

Practice with buggy code that produces wrong output silently — not syntax errors. Real interview bugs are always logical, not typos.

📐

Master the core concepts

Async & Effects, Component Logic, Event Loop & Batching, async/await and features cover 90% of React interviews.

⏱️

Practice under time pressure

Use the Sprint feature — 10 questions in 15 minutes. Interview pressure is real and you can train for it.

Related Resources

Ready to practice?

Interactive questions with instant feedback. Predict outputs, find bugs, and master React.

Start Practicing Free →⚡ Daily Sprint