React Hard technical 0 views 2 min read

How does React Fiber works? Explain in detail.

Peer-reviewed by HireXTech Technical Panel Updated for 2025/2026 hiring Editorial standards
Practise this track
Interviewer Expectations for this Question
01
Core Competency

Assesses fundamental understanding of React conventions, runtime behavior, and memory/performance considerations.

02
Evaluation Criteria

Hiring managers look for precision, avoidance of ambiguous jargon, and ability to explain trade-offs under real production conditions.

Comprehensive Model Answer Verified Solution

React Fiber is the core engine that enables advanced features like concurrent rendering, prioritization, and interruptibility in React. Here's how it works:

### 1. Fiber Tree Structure

Each component in your app is represented by a Fiber node in a tree structure. A Fiber node contains:

  • Component type
  • Props & state
  • Pointers to parent, child, and sibling nodes
  • Effect tags to track changes (e.g., update, placement)
  • This forms the Fiber Tree, a data structure React uses instead of the traditional call stack.

### 2. Two Phases of Rendering

#### A. Render Phase (work-in-progress)

  • React builds a work-in-progress Fiber tree.
  • It walks through each component (begin phase), calculates what needs to change, and collects side effects (complete phase).
  • This phase is interruptible—React can pause it and resume later.

#### B. Commit Phase

  • React applies changes to the Real DOM.
  • Runs lifecycle methods (e.g., componentDidMount, useEffect).
  • This phase is non-interruptible but fast.

### 3. Work Units and Scheduling

  • React breaks rendering into units of work (small tasks).
  • These units are scheduled based on priority using the React Scheduler.
  • If time runs out (e.g., user starts typing), React can pause and yield control back to the browser.

### 4. Double Buffering with Two Trees

  • React maintains two trees:
  • Current Tree – what's visible on the screen.
  • Work-In-Progress Tree – the next version being built in memory.
  • Only after the new tree is fully ready, React commits it, making it the new current tree.

### 5. Concurrency and Prioritization

  • React can prepare multiple versions of UI at once (e.g., during slow data loading).
  • Updates can be assigned priorities, so urgent updates (like clicks) are handled faster than background work.

Candidate Response Strategy & Interview Tips

  1. Start with a concise one-sentence summary: Deliver a direct, confident answer first before expanding into nuances.
  2. Demonstrate real-world trade-offs: Discuss where this approach excels and when you would avoid it in production systems.
  3. Discuss complexity & edge cases: Proactively explain time/space complexity or boundary conditions (null values, scale limits).
  4. Prepare for interviewer follow-ups: Technical hiring panels frequently probe deeper into concurrency, backward compatibility, or alternative libraries.
Related Topics & Skills
Spotted an error or have an alternative solution?