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
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-runtimepackage (e.g.,_jsx('div', { children: 'Hello' })).
- Prior to React 17:
- 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 viathis.state/this.setStateand side effects via lifecycle methods (e.g.,componentDidMount). They require thethiscontext 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:
- Render: When state or props change, React builds a new Virtual DOM tree.
- Diffing: React compares the new Virtual DOM tree with the previous one to find differences.
- 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
Browse All React Questions by Difficulty
Easy57 Questions
Core concepts, definitions, basic syntax, and first principles expected in round 1 screening.
VIEW FULL LIST
Medium53 Questions
Real-world mechanisms, state management, edge cases, performance trade-offs, and practical coding.
VIEW FULL LIST
Hard53 Questions
Deep runtime internals, memory models, distributed design, concurrency failure modes, and architectural decisions.
VIEW FULL LIST
INTERNAL LINKING & DEPENDENCIES