On this page
30 sections · 327 questions
React Interview Handbook
From fundamentals to Fiber internals, performance and real production scenarios.
JSXHooksStateFiberConcurrencySuspenseReduxSecurityPerf
React Interview Handbook
Every question from both interview banks, answered in plain English with React code. Each answer gives you a short reply you can say out loud, a deeper explanation, an example, common mistakes and follow-up questions.
30 sections327 questions2 parts
🚀 How to use this handbook
- Question Bank covers concepts from React basics to internals. Go through it in order.
- Scenario-Based covers "what would you do if..." questions: root cause, fix and how to verify it.
- Press / anywhere to search all questions.
Question Bank
Section 01React Fundamentals32 questions
- 01What is React?
- 02React Architecture
- 03React basic setup and advanced configurations
- 04What is JSX?
- 05How many types of components are there in React? (Functional vs Class)
- 06What are stateless and stateful components in React?
- 07What is Rendering in React?
- 08Explain the virtual DOM and its benefits
- 09Describe the component lifecycle in both class and functional components
- 10What are the key differences between Redux and Context API?
- 11Explain how you would structure a large-scale React application
- 12What are controlled vs. uncontrolled components?
- 13How does React handle events differently from standard DOM events?
- 14Explain the concept of lifting state up
- 15What are React portals and when would you use them?
- 16Describe how you would test a React component
- 17How does React's reconciliation algorithm work?
- 18What is the difference between useMemo and useCallback?
- 19How would you implement code splitting in a React application?
- 20Explain the difference between client-side and server-side rendering in React
- 21What are higher-order components (HOCs) and how do they compare to render props?
- 22How does React's concurrent rendering improve performance?
- 23What are some common pitfalls when using useEffect?
- 24How would you manage forms in a React application efficiently?
- 25What is Suspense in React, and how does it work with data fetching?
- 26How does React handle hydration in server-rendered applications?
- 27Flow of data in React
- 28What is memoization in React?
- 29What is debouncing and what are its applications in React?
- 30What are the new hooks introduced in React v19?
- 31What is a React Fragment and why use it?
- 32What is StrictMode and why does my component render twice?
Section 02State & Props9 questions
- 01State & Props
- 02Difference between State and Props
- 03What is setState in React?
- 04Why is state immutable in React?
- 05Which function is used for updating the state of a component?
- 06What is the advantage of choosing props over states?
- 07Give an example of a stateless component
- 08What is Props Validation?
- 09What are the different data types available in React.PropTypes?
Section 03Component Types & Patterns12 questions
- 01What are controlled and uncontrolled components?
- 02What are controlled & uncontrolled events?
- 03How can we directly access DOM in React? (Refs)
- 04What are inline functions in React?
- 05What is conditional rendering in React?
- 06What are Pure Components in React?
- 07What are Higher Order Components (HOC) and their uses?
- 08What is Prop Drilling?
- 09Avoiding prop drilling: Context API vs event emitters vs composition patterns
- 10Building scalable component architecture (Container-Presenter pattern, compound components, render props)
- 11What are error boundaries and what can't they catch?
- 12What is forwardRef and how did React 19 change it?
Section 04Events17 questions
- 01What is event delegation?
- 02How does React handle events?
- 03What is a synthetic event in React?
- 04Explain the event flow lifecycle
- 05What is event bubbling and event capturing?
- 06Difference between native event and synthetic event
- 07Why does React use synthetic events?
- 08How does event delegation work in React?
- 09Difference between onClick in React and onclick in HTML
- 10How to handle multiple events in React?
- 11What is event pooling in React?
- 12What happens when state updates inside an event handler?
- 13Are React events synchronous or asynchronous?
- 14How to optimize event handlers in React?
- 15What is a passive event listener?
- 16How does batching work in React events?
- 17Explain priority of events in React Fiber
Section 05React Lifecycle & Hooks13 questions
- 01Explain the React component lifecycle
- 02What is the cleanup function in useEffect?
- 03Mounting vs Updating vs Unmounting
- 04When will the render method fire?
- 05Scenario-based questions from React lifecycle
- 06React latest features
- 07React Hooks (useState, useEffect, useReducer, useContext)
- 08What is useLayoutEffect and why do we need it?
- 09How do you prevent an infinite loop in useEffect?
- 10How do you stop memory leaks in React?
- 11How do you cancel an API request when a component unmounts?
- 12What are custom hooks and how do you build one?
- 13What is useId and when should you use it?
Section 06State Management15 questions
- 01What is State in React?
- 02What are Different Types of State in React?
- 03Scenario: How do you decide where to keep state?
- 04Explain Redux Toolkit Architecture
- 05Why Redux Toolkit Instead of Redux?
- 06How will you manage authentication in a React application?
- 07Your dashboard has 50 components. Updating one component causes many components to re-render. How will you optimize?
- 08You have a table displaying 10,000 users. Updating one row re-renders the entire table. How will you solve?
- 09Product list is used in Navbar, Sidebar, and Product page. How will you manage it?
- 10Context API vs Redux Toolkit
- 11You used Context API but every component is re-rendering. Why?
- 12How do you manage state in a complex React application?
- 13What is Normalization in Redux?
- 14How will you manage chat state?
- 15What is Immer?
Section 07Internals: Fiber & Reconciliation15 questions
- 01What is React Fiber?
- 02Why did React introduce the Fiber architecture?
- 03Explain React's reconciliation algorithm.
- 04How does React decide which components need to re-render?
- 05What is the difference between reconciliation and rendering?
- 06How does React compare two Virtual DOM trees?
- 07What is the role of keys during reconciliation?
- 08What happens if keys are unstable?
- 09Why shouldn't we use array indexes as keys?
- 10What is the Render phase and Commit phase?
- 11Can React pause rendering? How?
- 12What is interruptible rendering?
- 13How does Fiber improve user experience?
- 14How does React schedule work internally?
- 15What are Fiber nodes?
Section 08Internals: Virtual DOM vs Real DOM10 questions
- 01What is the Virtual DOM?
- 02What is the Real DOM?
- 03Why does React use a Virtual DOM?
- 04Does React always update the Real DOM after every state change?
- 05What actually triggers a re-render?
- 06What is the difference between re-rendering and DOM updates?
- 07How does React minimize DOM operations?
- 08Does React compare HTML strings?
- 09Is Virtual DOM always faster?
- 10What are the limitations of the Virtual DOM?
Section 09Internals: Rendering, Batching & Concurrency10 questions
- 01What is batching in React?
- 02What is automatic batching in React 18?
- 03How was batching different before React 18?
- 04What is concurrent rendering?
- 05Does concurrent rendering make React multithreaded?
- 06What is interruptible rendering?
- 07What are render priorities?
- 08What are urgent vs non-urgent updates?
- 09What is React Scheduler?
- 10How does React avoid blocking the main thread?
Section 10Internals: React 18 Concurrent Features16 questions
- 01What is startTransition?
- 02What is useTransition?
- 03What is useDeferredValue?
- 04Difference between startTransition and useDeferredValue?
- 05What is a transition update?
- 06What are urgent updates?
- 07How does React prioritize updates?
- 08How do transitions improve UX?
- 09Can transitions replace debouncing?
- 10Why do uncontrolled components fix typing lag?
- 11Why doesn't useRef cause a re-render?
- 12How does Suspense improve UX?
- 13How does hydration work?
- 14How does React batch updates?
- 15Why must a key be stable?
- 16What is a real case for useCallback + useMemo?
Section 11Internals: Suspense10 questions
- 01What is React Suspense?
- 02How does Suspense work internally?
- 03How is Suspense different from React.lazy()?
- 04What is a Suspense boundary?
- 05What causes Suspense to show a fallback?
- 06Can Suspense work with data fetching?
- 07What happens when multiple Suspense boundaries exist?
- 08How does nested Suspense work?
- 09What is SuspenseList?
- 10How does streaming SSR use Suspense?
Section 13React + Redux12 questions
- 01What is Redux?
- 02Why do we need Redux?
- 03Redux Architecture
- 04Difference between Redux and Flux
- 05Concept of Connect and Provider: how to connect React with Redux
- 06What is mapStateToProps and mapDispatchToProps?
- 07What is store in Redux?
- 08What is Reducer?
- 09What are combined reducers?
- 10Concept of Redux Thunk
- 11What is redux-saga?
- 12What is Context API? How is it different from Redux?
Section 14Security in React10 questions
- 01What is XSS (Cross-Site Scripting) and how do you prevent it in React?
- 02What is CSRF (Cross-Site Request Forgery) and how do you mitigate it?
- 03How do you securely store JWT tokens in a React app?
- 04What are the risks of storing tokens in localStorage/sessionStorage?
- 05How do you prevent clickjacking attacks in React apps?
- 06Explain Content Security Policy (CSP) and its role in React security.
- 07How do you handle user input safely in React forms?
- 08How do you implement secure authentication and token refresh flow in React?
- 09What is the difference between HttpOnly and Secure cookies?
- 10How do you prevent sensitive data leaks in client-side logs or error messages?
Section 15API, Async Handling & Networking9 questions
- 01How do you send multiple API requests on a single button click?
- 02How do you handle errors if multiple requests are sent simultaneously?
- 03If a token is saved in localStorage, anyone can misuse it — what should you do?
- 04Can you share multiple ways to intercept API requests in React projects?
- 05How do you call and handle responses from AI APIs like OpenAI, Hugging Face, or Google Cloud AI?
- 06How do you handle rate-limiting or large payloads when consuming AI services?
- 07What is WebSocket?
- 08What is the use of the headers in the HTTP request?
- 09What happens when we hit a URL in the browser?
Section 17React Advanced: Application Behavior7 questions
- 01How do you prevent a login page from being accessible after the user is logged in?
- 02How do you handle API errors gracefully in the UI?
- 03A component is fetching the same data multiple times unnecessarily. How do you fix it?
- 04How do you handle a form with 20+ fields efficiently?
- 05Your React app needs to support dark mode. How do you implement it?
- 06How do you handle offline and online state gracefully in React with service workers?
- 07Production is not getting the latest deployed update unless in incognito mode. How do you solve this?
Section 18Browser, Rendering & Web Fundamentals9 questions
- 01Difference between SSR and CSR?
- 02What is Service Worker?
- 03What is hydration and dehydration?
- 04What is Critical Rendering Path (CRP)?
- 05What events can we use when a website is loading? An in-depth overview of CRP
- 06What are semantic HTML elements?
- 07What is srcset in HTML?
- 08Difference between display: none and visibility: hidden
- 09What are render-blocking resources?
Section 19SPA, Architecture & System Design12 questions
- 01Why migrate from Angular to React? What challenges did you face?
- 02What is the difference between GraphQL and REST API?
- 03How do you decide which library to use in a project?
- 04What is Webpack and how does it create bundles?
- 05What is Suspense in React?
- 06What are loaders and actions?
- 07What is flushSync and when does React flush updates?
- 08What are preload, preconnect, prefetch, and prerender?
- 09How can you do caching on a website?
- 10What are ETag, Cache-Control and DocumentFragment?
- 11How do you optimize assets? What is image compression? WebP vs PNG vs JPG
- 12What is the Critical Rendering Path?
Section 20SPA Behavior & Browser Mechanics8 questions
- 01What happens behind the scenes when a Single Page Application loads?
- 02How many times does the HTML file load in an SPA vs an MPA?
- 03If you use document.querySelector() and update a DOM element, does the page reload in traditional apps?
- 04Why does navigation in SPAs not trigger a full page reload?
- 05How does React update the view when the URL changes without reloading the document?
- 06How are assets (JS, CSS) handled in SPAs, and how does it impact performance?
- 07Why are SPAs less SEO-friendly by default?
- 08What are the strategies to make SPAs SEO-compatible?
Section 30Latest React Features (React 19 to 19.3)17 questions
- 01What is new in React since React 18?
- 02What are Actions in React 19?
- 03What is useActionState and how do you use it?
- 04What is useFormStatus and why must it be in a child component?
- 05What is useOptimistic and how does optimistic UI work in React 19?
- 06What is the use() API and how is it different from other hooks?
- 07What is useEffectEvent and what problem does it solve?
- 08What is the <Activity> component in React 19.2?
- 09What is the React Compiler and does it replace useMemo and useCallback?
- 10What are React Server Components and Server Functions?
- 11How does React 19 handle document metadata, stylesheets and resource preloading?
- 12What smaller API improvements came with React 19?
- 13What is <ViewTransition> in React 19.3?
- 14What are Fragment refs in React 19.3?
- 15What are browser() and Trusted Types support in React 19.3?
- 16What debugging and SSR improvements came in React 19.1 and 19.2?
- 17How do you migrate an app from React 18 to React 19?
Scenario-Based
Section 22Scenarios: Rendering & Batching5 questions
- 01A user types in a search box while a huge table is rendering. How can React keep typing smooth?
- 02Multiple setState calls happen in one event. How many renders occur?
- 03An API response updates five different states. How can React optimize this?
- 04A page freezes while rendering a large chart. How would concurrent rendering help?
- 05A slow component blocks button clicks. How would you improve responsiveness?
Section 23Scenarios: Effects & Stale Closures7 questions
- 01Your API is called infinitely. What could be wrong?
- 02A timer keeps using an old state value. Why?
- 03An event listener always logs outdated data. Why?
- 04You navigate away from a page, but an API request still updates state. How would you fix it?
- 05A WebSocket connection remains active after leaving the page. What should you do?
- 06Your effect depends on an object that changes every render. How do you solve it?
- 07Why does adding a function to the dependency array cause repeated execution?
Section 24Scenarios: Memoization & Re-renders9 questions
- 01A child wrapped with React.memo still re-renders. Why?
- 02You used useMemo everywhere, but performance became worse. Why?
- 03A callback prop causes unnecessary renders. How would you fix it?
- 04Expensive calculations execute on every render. How would you optimize them?
- 05A dashboard contains many charts. Which optimization techniques would you apply?
- 06When would removing useMemo actually improve performance?
- 07A parent component re-renders, but none of its props changed. Will the child re-render?
- 08A state update doesn't change the UI. Will React still perform reconciliation?
- 09Updating one input causes 100 components to render. Why?
Section 25Scenarios: DOM, Reconciliation & Keys8 questions
- 01How would you verify whether React actually updated the DOM?
- 02A component re-renders, but the browser doesn't repaint. Why?
- 03A list of 5,000 items updates every second. How does React efficiently update the UI?
- 04You change one item in a large list, but the whole list appears to re-render. How would you investigate?
- 05Two sibling components update at different priorities. How does Fiber handle this?
- 06You accidentally use random keys (Math.random()) in a list. What happens internally?
- 07Your application freezes while rendering a large dashboard. How can Fiber help solve this?
- 08Why does changing keys cause components to lose their state?
Section 26Scenarios: Concurrent Features & Suspense11 questions
- 01A search input filters 50,000 records. How would you keep typing responsive?
- 02A dashboard performs expensive filtering. How would you prioritize updates?
- 03A chart takes two seconds to render. How can you keep the UI interactive?
- 04Which updates should be wrapped inside startTransition?
- 05When would useDeferredValue be a better choice than debouncing?
- 06A page contains three independent API sections. How would you use Suspense?
- 07One slow component blocks the entire page. How would Suspense help?
- 08Where would you place Suspense boundaries in a dashboard?
- 09A lazy-loaded component fails to load. How should the UI behave?
- 10How can Suspense improve the perceived loading experience?
- 11Why is a single Suspense boundary around the whole app usually not ideal?
Section 27Scenarios: Production & Debugging12 questions
- 01You notice a memory leak in a production SPA — how do you identify and fix it?
- 02A component breaks when upgrading a library version — how do you manage dependencies?
- 03How would you debug a performance bottleneck in a React app using DevTools?
- 04You need to migrate a legacy frontend codebase to a modern framework — what's your plan?
- 05How do you ensure secure handling of sensitive user data on the client side?
- 06Users report intermittent UI glitches in different browsers — how would you troubleshoot?
- 07A critical UI feature is failing during peak traffic — how do you mitigate the issue?
- 08How would you implement a robust frontend monitoring and logging system?
- 09You need to render a large dataset without blocking the main thread — how do you approach it?
- 10How would you implement A/B testing without affecting current users?
- 11A CSS animation is janky on mobile devices — how do you identify and fix the issue?
- 12How do you handle real-time updates in a React application efficiently?
Section 28Scenarios: Performance Debugging10 questions
- 01Your React application suddenly becomes slow after adding new features. How would you identify and fix the issue?
- 02A page takes 8-10 seconds to load. How would you optimize it?
- 03Your dashboard has 100+ components. Updating one widget causes the entire dashboard to re-render. How would you solve it?
- 04A parent component re-renders frequently, causing all child components to re-render. How would you optimize it?
- 05Your React application consumes too much memory after prolonged usage. How would you debug it?
- 06How would you profile a React application's performance?
- 07How would you identify unnecessary re-renders?
- 08A component performs expensive calculations on every render. How would you optimize it?
- 09A search input becomes sluggish when filtering a large dataset. How would you fix it?
- 10How would you optimize rendering for a list containing 100,000 items?
Section 29Scenarios: Scalability, Bundles & Metrics11 questions
- 01What does "scalable web applications" mean in your experience?
- 02What challenges have you faced when building for large user traffic?
- 03How do you optimize performance of an application?
- 04What is lazy loading?
- 05How do you optimize large bundle size in a React application?
- 06What is Tree Shaking?
- 07What is a memory leak?
- 08What is the difference between repaint and reflow?
- 09What are Core Web Vitals?
- 10Explain the performance metrics, classified into categories
- 11How do you handle caching in React?