React Interview Prep

Common interview questions.

React Interview Prep

Prepare for your React interview with these common questions.

  • What is the Virtual DOM? It's a lightweight copy of the real DOM. React updates it first to determine the most efficient way to update the browser's DOM.
  • Difference between State and Props? Props are passed from parent to child and are read-only. State is managed within the component and can change.
  • What are Hooks? Functions that let you use state and other React features in functional components.
  • What is the 'key' prop? A unique identifier used by React to identify which items have changed, added, or removed in a list.
  • What is Prop Drilling? Passing data through multiple layers of components to reach a deeply nested child. Solved by Context or Redux.

Example

// Interview Q&A