React JS: 100+ Comprehensive Interview & Viva Questions and Answers

This curated collection of 100+ Technical Questions & Detailed Answers covers everything from college viva-voce examinations (BCA, BSc Computer Science, MCA, B.Tech IT) to technical interviews at leading tech firms.

Section 1: Core Fundamentals & Architecture (Q1–Q20)

Q1: What is React and who created it?

Answer: React is an open-source, component-based front-end JavaScript library maintained by Meta (Facebook). It was invented by Jordan Walke and released in 2013 for building high-performance, reactive user interfaces.

Q2: What is the Virtual DOM and how does it work?

Answer: The Virtual DOM is a lightweight in-memory representation of the real DOM. When state changes, React creates a new Virtual DOM tree, diffs it against the previous tree using an O(n) heuristic algorithm, and surgically updates only the altered nodes in the browser DOM.

Q3: What are the primary differences between Props and State?

Answer: Props are read-only, immutable configuration parameters passed from parent to child. State is internal, mutable component memory managed via useState/useReducer that triggers re-renders when mutated.

Q4: What is JSX and why is it compiled?

Answer: JSX stands for JavaScript XML. It is a syntax extension that combines HTML-like tags with JavaScript. Browsers cannot execute JSX directly; build tools compile JSX into React.createElement() function calls.

Q5: What are SyntheticEvents in React?

Answer: SyntheticEvents are React's cross-browser wrappers around native DOM events, standardizing event handling across Chrome, Safari, Firefox, and Edge.

Section 2: React Hooks Deep Dive (Q21–Q50)

Q21: What are the two fundamental Rules of Hooks?

Answer: 1. Only call hooks at the top level (never inside loops, conditions, or nested functions). 2. Only call hooks from React functional components or custom hooks.

Q22: How does the dependency array in useEffect work?

Answer: Omitted: runs after every render. Empty []: runs once on mount. [a, b]: runs on mount and whenever variables 'a' or 'b' change value.

Q23: What is the purpose of the cleanup function in useEffect?

Answer: The cleanup function clears timers (clearInterval), removes event listeners, and cancels active network subscriptions to prevent memory leaks before unmounting or re-running.

Q24: What is the difference between useMemo and useCallback?

Answer: useMemo caches the computed return value of an expensive function. useCallback caches the function definition reference itself to prevent child re-renders.

Q25: When should you use useRef instead of useState?

Answer: Use useRef when you need to store a mutable value that does NOT trigger a re-render when changed (e.g. DOM references, timer IDs, or previous state).

Section 3: State Management & Routing (Q51–Q75)

Q51: What is Prop Drilling and how do you resolve it?

Answer: Prop drilling is passing data through multiple intermediate components that don't need it. It is resolved using React Context API or state libraries like Redux Toolkit and Zustand.

Q52: What is Redux Toolkit (RTK) and why is it preferred over legacy Redux?

Answer: RTK simplifies Redux by combining reducers and action creators via createSlice, integrating Immer for safe mutation syntax, and bundling Redux Thunk out-of-the-box.

Q53: What does the Outlet component do in React Router v6?

Answer: <Outlet /> acts as a dynamic placeholder inside parent layout routes where child route components are rendered upon matching.

Section 4: React 19, Fiber & Senior Engineering (Q76–Q100+)

Q76: What is React Fiber?

Answer: React Fiber is the reimplementation of React's core reconciler. It models units of work as a linked list of Fiber nodes, enabling incremental rendering, time-slicing, and prioritization of user interactions.

Q77: What are React Server Components (RSC)?

Answer: RSC are components that run exclusively on the server and add 0 KB JavaScript to client bundles. They query databases directly and stream HTML chunks to the browser.

Q78: What does useOptimistic do in React 19?

Answer: useOptimistic allows you to show immediate UI feedback before an async server request completes, automatically rolling back if the request fails.

Next Step: Practice Projects & Exercises

Now apply your theoretical knowledge by building practical capstone projects in React Practice Projects & Exercises.

Explore Related React JS Tutorials

Accelerate your React mastery by studying these tightly connected core tutorials:

React JS Master Class →

Review foundational concepts and architecture.

Hands-on Projects & Exercises →

Practical interview coding assignments.

React Cheat Sheet →

Quick syntax lookups and API quick reference.

Fiber Engine Internals →

Crucial senior engineer interview topic.

Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

You may also like this!