React Core & Virtual DOM Interview Questions (React)
10 React Core & Virtual DOM questions from the React track. Read each short answer here, then open a question for the full explanation, examples, common mistakes, and sources.
- Mid-level
What is the Virtual DOM in React, and how does the Reconciliation (Diffing) algorithm work?
The Virtual DOM is a lightweight in-memory representation of the real DOM tree; Reconciliation calculates differences precisely and makes as few direct browser DOM changes as possible.
Read the full explanation - Junior
Why are Keys important when rendering lists, and what are the risks of using the array index as a Key?
Keys let React identify unique items between renders and detect items that were added, removed, or moved; using an Index can cause state issues and mix up input values after changes.
Read the full explanation - Junior
What is JSX, and what happens to it during compilation?
JSX is a JavaScript syntax extension for writing HTML-like structures in code; a compiler such as Babel or SWC turns it into element-creation function calls (React.createElement or the jsx runtime).
Read the full explanation - Mid-level
What are Pure Components and purity in React functions (Pure Functions)?
A pure function or component always produces the same output for the same inputs (Props) without causing external side effects (Side Effects) during Render.
Read the full explanation - Senior
What is the role of React Fiber, and how do Render Phase and Commit Phase differ?
Render calculates changes in memory and Fiber may pause or delay it to keep the interface responsive; Commit synchronously applies all changes to the real DOM without interruption.
Read the full explanation - Mid-level
How do Event Pooling and the SyntheticEvent system work in React?
React provides a unified SyntheticEvent object that wraps native browser events for consistent behavior across browsers, and manages events through Event Delegation at the application root.
Read the full explanation - Mid-level
What are Portals in React, and when should you use them?
Portals render a child in a DOM node outside its parent component's hierarchy while preserving event bubbling and Context as if it were a regular child.
Read the full explanation - Junior
What is StrictMode, and what checks does it perform in development?
StrictMode helps developers detect deprecated practices and hidden problems; it renders components and reruns Effects twice in development.
Read the full explanation - Junior
What is the Lifting State Up principle, and when should you use it?
It means moving shared state to the nearest common Ancestor of components that need to stay in sync with and update the same data.
Read the full explanation - Mid-level
What are Error Boundaries, and how do they handle unexpected errors in a component tree?
They are special components that catch JavaScript errors in their descendant component tree during Render and lifecycle methods, showing a Fallback UI instead of crashing the entire application.
Read the full explanation