React interview questions

Review short answers, detailed answers, practical code and common mistakes.

1. How would you explain React Introduction in React during an interview?beginner

React Introduction is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem react introduction solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

function LessonList() {
  const topics = ["React Introduction", "practice", "quiz"];
  return <ul>{topics.map((item) => <li key={item}>{item}</li>)}</ul>;
}
2. How would you explain JSX in React during an interview?beginner

JSX is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem jsx solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

3. How would you explain Components in React during an interview?beginner

Components is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem components solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

4. How would you explain Props in React during an interview?beginner

Props is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem props solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

function StatCard({ label, value }) {
  return <section><strong>{value}</strong><span>{label}</span></section>;
}

export default function Dashboard() {
  return <StatCard label="Paid orders" value={24} />;
}
5. How would you explain State in React during an interview?beginner

State is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem state solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

6. How would you explain Events in React during an interview?beginner

Events is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem events solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

7. How would you explain Lists in React during an interview?beginner

Lists is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem lists solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

function LessonList() {
  const topics = ["Lists", "practice", "quiz"];
  return <ul>{topics.map((item) => <li key={item}>{item}</li>)}</ul>;
}
8. How would you explain Conditional Rendering in React during an interview?beginner

Conditional Rendering is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem conditional rendering solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

9. How would you explain Forms in React during an interview?beginner

Forms is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem forms solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

10. How would you explain useEffect in React during an interview?beginner

useEffect is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem useeffect solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

import { useEffect, useState } from "react";

export function OrdersPanel() {
  const [orders, setOrders] = useState([]);
  useEffect(() => { fetch("/api/orders").then((res) => res.json()).then(setOrders); }, []);
  return <p>{orders.length} orders loaded</p>;
}
11. How would you explain useRef in React during an interview?intermediate

useRef is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem useref solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

12. How would you explain Custom Hooks in React during an interview?intermediate

Custom Hooks is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem custom hooks solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

13. How would you explain Context API in React during an interview?intermediate

Context API is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem context api solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

import { useEffect, useState } from "react";

export function OrdersPanel() {
  const [orders, setOrders] = useState([]);
  useEffect(() => { fetch("/api/orders").then((res) => res.json()).then(setOrders); }, []);
  return <p>{orders.length} orders loaded</p>;
}
14. How would you explain Routing in React during an interview?intermediate

Routing is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem routing solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

15. How would you explain Performance Optimization in React during an interview?intermediate

Performance Optimization is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem performance optimization solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

16. How would you explain Memoization in React during an interview?intermediate

Memoization is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem memoization solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

function LessonList() {
  const topics = ["Memoization", "practice", "quiz"];
  return <ul>{topics.map((item) => <li key={item}>{item}</li>)}</ul>;
}
17. How would you explain API Calls in React during an interview?intermediate

API Calls is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem api calls solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

18. How would you explain Error Boundaries in React during an interview?intermediate

Error Boundaries is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem error boundaries solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

19. How would you explain React Query in React during an interview?intermediate

React Query is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem react query solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

function LessonList() {
  const topics = ["React Query", "practice", "quiz"];
  return <ul>{topics.map((item) => <li key={item}>{item}</li>)}</ul>;
}
20. How would you explain Authentication UI in React during an interview?intermediate

Authentication UI is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem authentication ui solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

21. How would you explain Dashboard Project in React during an interview?advanced

Dashboard Project is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem dashboard project solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

22. How would you explain Composition in React during an interview?advanced

Composition is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem composition solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

function LessonList() {
  const topics = ["Composition", "practice", "quiz"];
  return <ul>{topics.map((item) => <li key={item}>{item}</li>)}</ul>;
}
23. How would you explain Children Props in React during an interview?advanced

Children Props is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem children props solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

24. How would you explain Controlled Inputs in React during an interview?advanced

Controlled Inputs is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem controlled inputs solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

25. How would you explain Reducer Pattern in React during an interview?advanced

Reducer Pattern is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem reducer pattern solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

function LessonList() {
  const topics = ["Reducer Pattern", "practice", "quiz"];
  return <ul>{topics.map((item) => <li key={item}>{item}</li>)}</ul>;
}
26. How would you explain Accessibility in React during an interview?advanced

Accessibility is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem accessibility solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

27. How would you explain Testing Basics in React during an interview?advanced

Testing Basics is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem testing basics solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

28. How would you explain Deployment in React during an interview?advanced

Deployment is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem deployment solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

function LessonList() {
  const topics = ["Deployment", "practice", "quiz"];
  return <ul>{topics.map((item) => <li key={item}>{item}</li>)}</ul>;
}
29. How would you explain TypeScript with React in React during an interview?advanced

TypeScript with React is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem typescript with react solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.

30. How would you explain React Review in React during an interview?advanced

React Review is best explained with its purpose, a small example, and one common mistake.

Start by naming the problem react review solves in React. Then show a short example, discuss the tradeoff, and mention how you would test it in a real codebase.