Top React Interview Questions

Essential React interview questions covering hooks, rendering, patterns, and performance. Each answer links to an interactive visualization.

Showing 66 of 66 questions

  1. 1.What is important to know about JSX & Rendering?easy

    Explain that JSX is not HTML but compiles to JavaScript function calls

    Learn more →
  2. 2.What is important to know about JSX & Rendering?easy

    Know the difference between the classic and automatic JSX transform

    Learn more →
  3. 3.What is important to know about Components & Props?easy

    Explain the one-way data flow and why React enforces it

    Learn more →
  4. 4.What is important to know about Components & Props?easy

    Discuss when to lift state up versus use context to avoid prop drilling

    Learn more →
  5. 5.What is important to know about Children & Composition?easy

    Explain why React favors composition over inheritance

    Learn more →
  6. 6.What is important to know about Children & Composition?easy

    Give examples of the slot pattern for complex layouts

    Learn more →
  7. 7.What is important to know about Conditional Rendering?easy

    Explain the 0 && gotcha and how to fix it with Boolean() or > 0

    Learn more →
  8. 8.What is important to know about Conditional Rendering?easy

    Discuss when to use early returns vs ternaries vs && for clarity

    Learn more →
  9. 9.What is important to know about Lists & Keys?easy

    Explain the reconciliation algorithm and why keys help React diff efficiently

    Learn more →
  10. 10.What is important to know about Lists & Keys?easy

    Describe concrete bugs that happen with index keys in dynamic lists

    Learn more →
  11. 11.What is important to know about useState & State Updates?easy

    Explain batching: React 18 batches all state updates, not just event handlers

    Learn more →
  12. 12.What is important to know about useState & State Updates?easy

    Know why Object.is() comparison means you must create new references for objects

    Learn more →
  13. 13.What is important to know about useEffect & Side Effects?easy

    Explain the mental model: effects synchronize with external systems, not lifecycle events

    Learn more →
  14. 14.What is important to know about useEffect & Side Effects?easy

    Know how to prevent race conditions with AbortController or an ignore flag

    Learn more →
  15. 15.What is important to know about useRef & Mutable References?easy

    Explain the difference between useRef and useState for persisting values

    Learn more →
  16. 16.What is important to know about useRef & Mutable References?easy

    Know when refs are appropriate vs when state is more correct

    Learn more →
  17. 17.What is important to know about useContext & Context API?easy

    Explain the re-render behavior: all consumers re-render when the provider value changes

    Learn more →
  18. 18.What is important to know about useContext & Context API?easy

    Discuss strategies to mitigate context re-renders: splitting, memoizing, selectors

    Learn more →
  19. 19.What is important to know about useReducer & State Machines?medium

    Compare useState vs useReducer: useReducer shines when state transitions are complex or interdependent

    Learn more →
  20. 20.What is important to know about useReducer & State Machines?medium

    Explain how discriminated unions prevent invalid state combinations at the type level

    Learn more →
  21. 21.What is important to know about useMemo & Computed Values?medium

    Explain that useMemo is an optimization, not a semantic guarantee

    Learn more →
  22. 22.What is important to know about useMemo & Computed Values?medium

    Discuss when NOT to use useMemo: simple calculations, primitive values, rarely changing data

    Learn more →
  23. 23.What is important to know about useCallback & Function Stability?medium

    Explain that useCallback without React.memo on children is pointless overhead

    Learn more →
  24. 24.What is important to know about useCallback & Function Stability?medium

    Know that useCallback(fn, deps) is syntactic sugar for useMemo(() => fn, deps)

    Learn more →
  25. 25.What is important to know about useLayoutEffect & Synchronous Effects?medium

    Draw the timeline: render -> DOM mutation -> useLayoutEffect -> paint -> useEffect

    Learn more →
  26. 26.What is important to know about useLayoutEffect & Synchronous Effects?medium

    Give concrete examples where useEffect causes flicker and useLayoutEffect fixes it

    Learn more →
  27. 27.What is important to know about Custom Hooks?medium

    Explain that custom hooks share logic but not state between components

    Learn more →
  28. 28.What is important to know about Custom Hooks?medium

    Compare custom hooks to HOCs and render props as patterns for code reuse

    Learn more →
  29. 29.What is important to know about Virtual DOM & Reconciliation?medium

    Explain the two heuristics: different types rebuild subtrees, keys match list children

    Learn more →
  30. 30.What is important to know about Virtual DOM & Reconciliation?medium

    Discuss why O(n) is achievable instead of O(n^3) generic tree diff

    Learn more →
  31. 31.What is important to know about Component Lifecycle?medium

    Map class lifecycle methods to hooks: componentDidMount -> useEffect with [], componentDidUpdate -> useEffect with deps

    Learn more →
  32. 32.What is important to know about Component Lifecycle?medium

    Explain the shift from lifecycle thinking to synchronization thinking

    Learn more →
  33. 33.What is important to know about Re-render Triggers?medium

    List the three triggers: state change, parent re-render, context change

    Learn more →
  34. 34.What is important to know about Re-render Triggers?medium

    Explain why passing inline objects or functions as props breaks React.memo

    Learn more →
  35. 35.What is important to know about Controlled & Uncontrolled Components?medium

    Explain the trade-off: controlled gives more power but more boilerplate

    Learn more →
  36. 36.What is important to know about Controlled & Uncontrolled Components?medium

    Discuss when uncontrolled is actually the better choice like simple search forms

    Learn more →
  37. 37.What is important to know about Refs & DOM Access?medium

    Explain why refs are an escape hatch and when declarative solutions are better

    Learn more →
  38. 38.What is important to know about Refs & DOM Access?medium

    Know useImperativeHandle for exposing a controlled API through refs

    Learn more →
  39. 39.What is important to know about Error Boundaries?medium

    Know exactly what error boundaries catch and what they do not

    Learn more →
  40. 40.What is important to know about Error Boundaries?medium

    Explain the strategy of multiple boundaries at different granularity levels

    Learn more →
  41. 41.What is important to know about Compound Components?hard

    Compare compound components to configuration-based APIs and explain the flexibility trade-off

    Learn more →
  42. 42.What is important to know about Compound Components?hard

    Reference real-world libraries like Radix UI or Headless UI that use this pattern

    Learn more →
  43. 43.What is important to know about Render Props?hard

    Explain the historical context: render props solved the same problem custom hooks do now

    Learn more →
  44. 44.What is important to know about Render Props?hard

    Know when render props are still useful over custom hooks (when JSX structure is shared)

    Learn more →
  45. 45.What is important to know about Higher-Order Components?hard

    Compare HOCs to hooks: hooks are simpler, compose better, and do not add wrapper elements

    Learn more →
  46. 46.What is important to know about Higher-Order Components?hard

    Know real-world examples like Redux connect() or React Router withRouter()

    Learn more →
  47. 47.What is important to know about Context Patterns?hard

    Explain the split state/dispatch pattern and why it reduces unnecessary re-renders

    Learn more →
  48. 48.What is important to know about Context Patterns?hard

    Discuss when to reach for a library like Zustand over raw context

    Learn more →
  49. 49.What is important to know about Portals?hard

    Explain that events bubble through the React tree, not the DOM tree, for portals

    Learn more →
  50. 50.What is important to know about Portals?hard

    Know the use cases: modals, tooltips, toasts, anything that needs to escape stacking contexts

    Learn more →
  51. 51.What is important to know about React.memo & Shallow Comparison?hard

    Explain that memo is an optimization and should be guided by profiling

    Learn more →
  52. 52.What is important to know about React.memo & Shallow Comparison?hard

    Know the full chain: memo + useCallback + useMemo work together

    Learn more →
  53. 53.What is important to know about Code Splitting & Lazy Loading?hard

    Explain route-level vs component-level splitting and when each is appropriate

    Learn more →
  54. 54.What is important to know about Code Splitting & Lazy Loading?hard

    Know how to handle load failures with error boundaries for lazy components

    Learn more →
  55. 55.What is important to know about Suspense & Data Loading?hard

    Explain the evolution: Suspense for code splitting first, then for data fetching

    Learn more →
  56. 56.What is important to know about Suspense & Data Loading?hard

    Discuss how Suspense eliminates waterfall loading with parallel data fetching

    Learn more →
  57. 57.What is important to know about Concurrent Features?hard

    Explain the difference between useTransition (wraps the setter) and useDeferredValue (wraps the value)

    Learn more →
  58. 58.What is important to know about Concurrent Features?hard

    Know that concurrent rendering is opt-in via createRoot and transitions

    Learn more →
  59. 59.What is important to know about Server Components?hard

    Explain the serialization boundary between Server and Client Components

    Learn more →
  60. 60.What is important to know about Server Components?hard

    Know that Server Components can render Client Components but not vice versa

    Learn more →
  61. 61.What is important to know about React 19 New Hooks?hard

    Explain how useActionState eliminates the useState + isPending + try/catch boilerplate pattern

    Learn more →
  62. 62.What is important to know about React 19 New Hooks?hard

    Know that use() breaks the Rules of Hooks intentionally — it can be conditional because it uses a different internal mechanism

    Learn more →
  63. 63.What is important to know about React Compiler?hard

    Explain that the compiler is a build-time static analysis tool, not a runtime library

    Learn more →
  64. 64.What is important to know about React Compiler?hard

    Know what the compiler replaces (useMemo, useCallback, memo) and what it does not (useEffect, algorithmic optimization)

    Learn more →
  65. 65.What is important to know about Server Actions?hard

    Explain progressive enhancement: Server Action forms work as HTML forms before JS loads, then enhance to async

    Learn more →
  66. 66.What is important to know about Server Actions?hard

    Know the difference between Server Components (data fetching at render) and Server Actions (mutations from interactions)

    Learn more →