D
DevPrepSystematic Prep
DEVPREP CODEX · #20

React Interview Questions

163 curated questions graded from Foundations (Easy) to Practical Patterns (Medium) and Internals & Architecture (Hard).

TOTAL QUESTIONS

163

THEORY QUESTIONS

150

IMPLEMENTATION FOLIOS

13

FREE QUESTIONS

5 / Level

Easy Level·57 Questions Total

Foundations & Core Concepts

Open Full Easy List
Q1What is React, and what are its core features?
  • Definition: An open-source, component-based front-end JavaScript library developed by Facebook for building dynamic user interfaces.
  • Core Features:
    • Component-Based Architecture: UI is broken into reusable, self-contained building blocks (components).
    • Declarative UI: Developer defines what the UI should look like based on current state, and React handles DOM updates.
    • Virtual DOM: In-memory representation of the real DOM used to optimize updates.
    • Unidirectional Data Flow: Data flows one way (parent to child) via props, simplifying debugging.
Q2What is JSX, and how does it work under the hood?
  • Definition: JavaScript XML (JSX) is a syntax extension that allows writing HTML-like code inside JavaScript.
  • Compilation: Browsers cannot read JSX. It is compiled (via Babel/SWC) into pure JavaScript.
    • Prior to React 17: React.createElement(type, props, ...children).
    • React 17+: Compiles to calls from the react/jsx-runtime package (e.g., _jsx('div', { children: 'Hello' })).
  • Output: Returns lightweight JavaScript objects called React Elements which describe the virtual DOM node.
Q3What is the difference between Functional Components and Class Components?
  • Functional Components: Written as plain JavaScript functions. They use Hooks for state and side effects. They are simpler, have less boilerplate, and are the modern standard in React.
  • Class Components: Written as ES6 classes extending React.Component. They manage state via this.state/this.setState and side effects via lifecycle methods (e.g., componentDidMount). They require the this context and have more boilerplate.
Q4What is the Virtual DOM, and how does React use it to optimize performance?
  • Concept: A lightweight, in-memory copy of the real DOM.
  • Reconciliation Process:
    1. Render: When state or props change, React builds a new Virtual DOM tree.
    2. Diffing: React compares the new Virtual DOM tree with the previous one to find differences.
    3. Batching & Patching: React calculates the minimum required changes and updates only those parts in the real DOM, avoiding expensive full-page reflows.
Q5What are props in React, and are they mutable?
  • Definition: Props (short for "properties") are read-only inputs passed from a parent component to a child component.
  • Immutability: Props are strictly immutable. A component must never modify its own props. This maintains unidirectional data flow and predictable UI states.
52 More Easy Questions Locked

Unlock the complete React Easy question bank

Get instant access to all 57 questions, in-depth model answers, code sandboxes, and all 27+ technologies for a single one-time payment.

Unlock All — One-time payment · Lifetime access
DEDICATED LEVEL PAGES

Browse All React Questions by Difficulty

INTERNAL LINKING & DEPENDENCIES

Related Technologies to React

CAREER PATHWAYS

React is a key requirement for these engineering roles:

React Interview Questions — Easy, Medium & Hard | DevPrep | DevPrep