0% found this document useful (0 votes)
3 views2 pages

React Interview Questions Part1

The document outlines key React interview questions and answers, covering topics such as event handling, synthetic events, inline conditional expressions, the 'key' prop, and the Virtual DOM. It explains the differences between Shadow DOM and Virtual DOM, introduces React Fiber as the new reconciliation engine, and highlights its goal of enabling incremental rendering for improved responsiveness. Overall, it serves as a concise guide for understanding fundamental React concepts.

Uploaded by

42khan0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

React Interview Questions Part1

The document outlines key React interview questions and answers, covering topics such as event handling, synthetic events, inline conditional expressions, the 'key' prop, and the Virtual DOM. It explains the differences between Shadow DOM and Virtual DOM, introduces React Fiber as the new reconciliation engine, and highlights its goal of enabling incremental rendering for improved responsiveness. Overall, it serves as a concise guide for understanding fundamental React concepts.

Uploaded by

42khan0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

React Interview Questions & Answers

12. What is the difference between HTML and React event handling?

Answer: In React, event names are camelCase (e.g., onClick instead of onclick), and you

pass a function reference rather than a string. React also uses a SyntheticEvent

wrapper for cross-browser compatibility.

13. What are synthetic events in React?

Answer: SyntheticEvent is a wrapper around the browser’s native event. It ensures that

events have consistent properties across different browsers.

14. What are inline conditional expressions?

Answer: They allow you to conditionally render elements directly within JSX using

logical (&&) or ternary (? :) operators.

15. What is the 'key' prop and what is its benefit when used in arrays of elements?

Answer: The 'key' prop helps React identify which items have changed, are added, or

are removed. It improves rendering performance and helps avoid rendering bugs.

16. What is the Virtual DOM?

Answer: The Virtual DOM is a lightweight JavaScript object that represents the real

DOM. React uses it to optimize rendering by diffing and batching updates.

17. How does the Virtual DOM work?

Answer: React creates a virtual copy of the real DOM. When the state changes, React

compares the new Virtual DOM with the old one (diffing), calculates the most efficient

way to update the real DOM, and applies those changes.

18. What is the difference between Shadow DOM and Virtual DOM?
Answer: Shadow DOM is a browser technology used for encapsulating styles and

markup in web components. Virtual DOM is a concept used by React for efficient

rendering.

19. What is React Fiber?

Answer: React Fiber is the new reconciliation engine in React 16+. It enables features

like concurrency, prioritization, and pause/resume rendering.

20. What is the main goal of React Fiber?

Answer: To enable incremental rendering, improving responsiveness by splitting

rendering work into chunks that can be paused and resumed.

You might also like