QA
⚛️
Frontend

React JS & React 19 Interview Questions

Interview questions covering React fundamentals, custom hooks, React Server Components (RSC), hydration, compiler, and state optimization.

🎯 Ready to test your knowledge?

Take React JS & React 19 Skill Assessment Quiz

First prepare from the 100 learning questions below, then test your skills with 15 random MCQs categorized into Beginner, Intermediate, and Senior levels.

Launch 15-MCQ Quiz →
Experience Level:

Showing 100 Questions

Beginner LevelReact JS & React 19

1. What is JSX and how does it work under the hood?

❓ Context: Explain JSX syntax, how it compiles to JavaScript, and why React 17+ no longer requires importing React in JSX files.

JSX (JavaScript XML) is a syntax extension for JavaScript that allows writing HTML-like markup inside JavaScript files.

How It Works:

1
Browsers cannot understand JSX directly. A compiler like Babel, SWC, or TypeScript transforms JSX into standard JavaScript function calls.
2
Before React 17: JSX compiled to 'React.createElement(component, props, ...children)', which required 'import React from 'react'' in every file.
3
React 17+ (New JSX Transform): Compilers automatically import special functions from 'react/jsx-runtime' ('_jsx' and '_jsxs'). You no longer need to import React just to use JSX!

Rules of JSX:

•
Return a single root element (or use a Fragment '<>...</>').
•
Close all tags ('<img />', '<br />').
•
Use camelCase for attribute names ('className' instead of 'class', 'tabIndex' instead of 'tabindex').
jsx
// JSX syntax in your code
function Profile({ user }) {
  return (
    <div className="card">
      <img src={user.avatar} alt={user.name} />
      <h2>{user.name}</h2>
    </div>
  );
}

// What React 17+ compiler transforms it to (using react/jsx-runtime):
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";

function Profile({ user }) {
  return _jsxs("div", {
    className: "card",
    children: [
      _jsx("img", { src: user.avatar, alt: user.name }),
      _jsx("h2", { children: user.name })
    ]
  });
}
💡JSX compilation to react/jsx-runtime functions in React 17 and 19.
🎯 Interview Key Takeaway

JSX is syntactic sugar for React element creation. React 17+ uses react/jsx-runtime so importing React is optional for JSX.

#JSX#React 19#Compiler#Beginner
Permalink
Beginner LevelReact JS & React 19

2. What is the difference between props and state in React?

Beginner LevelReact JS & React 19

3. How does the useState hook work and what is functional updater syntax?

Beginner LevelReact JS & React 19

4. How does useEffect work and how do dependency arrays control execution?

Beginner LevelReact JS & React 19

5. Why are keys necessary when rendering lists in React and why avoid using array index as key?

Beginner LevelReact JS & React 19

6. What is the useRef hook and how does it differ from useState?

Beginner LevelReact JS & React 19

7. What is the difference between useMemo and useCallback in React?

Beginner LevelReact JS & React 19

8. How does the Context API (createContext, useContext) eliminate prop drilling?

Beginner LevelReact JS & React 19

9. How does the new useActionState hook in React 19 handle form submissions and pending states?

Beginner LevelReact JS & React 19

10. How does useFormStatus allow child components to read parent form pending status in React 19?

Beginner LevelReact JS & React 19

11. How does the useOptimistic hook in React 19 render instant UI updates before server confirmation?

Beginner LevelReact JS & React 19

12. What is the difference between Controlled and Uncontrolled components in React forms?

Beginner LevelReact JS & React 19

13. How does React.memo optimize re-rendering of functional components?

Beginner LevelReact JS & React 19

14. What is an Error Boundary in React and why must it be written as a Class Component?

Beginner LevelReact JS & React 19

15. What are React Fragments (<>...</>) and why are they preferable to container <div> tags?

Beginner LevelReact JS & React 19

16. What are the common patterns for conditional rendering in React (&&, ternary, early return)?

Beginner LevelReact JS & React 19

17. How does React SyntheticEvent system work and how does it normalize cross-browser events?

Beginner LevelReact JS & React 19

18. What is React StrictMode and why does it run effects and render functions twice in development?

Beginner LevelReact JS & React 19

19. What is a Custom Hook and what rules must custom hooks follow?

Beginner LevelReact JS & React 19

20. What is the Virtual DOM and why is it faster than direct DOM manipulation?

Beginner LevelReact JS & React 19

21. How does the children prop enable component composition and slot layouts?

Beginner LevelReact JS & React 19

22. Why must React render functions be pure and idempotent?

Beginner LevelReact JS & React 19

23. How does automatic batching work in React 18 and 19 across async operations?

Beginner LevelReact JS & React 19

24. When should you use flushSync to force immediate DOM updates?

Beginner LevelReact JS & React 19

25. What is a Higher-Order Component (HOC) and how does it compare to custom hooks?

Beginner LevelReact JS & React 19

26. What is the Render Props pattern in React?

Beginner LevelReact JS & React 19

27. What is dangerouslySetInnerHTML and how do you prevent XSS vulnerabilities?

Beginner LevelReact JS & React 19

28. Compare CSS Modules, Styled Components, and Tailwind CSS in React.

Beginner LevelReact JS & React 19

29. How does React 19 simplify ref handling by making ref a standard prop?

Beginner LevelReact JS & React 19

30. How do you use React DevTools Profiler to diagnose slow renders?

Intermediate LevelReact JS & React 19

31. When should you use useReducer instead of useState for state management?

Intermediate LevelReact JS & React 19

32. How does useImperativeHandle customize the instance value exposed to parent refs?

Intermediate LevelReact JS & React 19

33. How do you optimize Context API to prevent widespread re-rendering?

Intermediate LevelReact JS & React 19

34. How do you unit test custom React hooks using React Testing Library?

Intermediate LevelReact JS & React 19

35. What causes React hydration mismatch errors and how do you fix them?

Intermediate LevelReact JS & React 19

36. How does React Suspense work for asynchronous data fetching and fallback UIs?

Intermediate LevelReact JS & React 19

37. How does useTransition keep the UI responsive during heavy state updates?

Intermediate LevelReact JS & React 19

38. How does useDeferredValue defer re-rendering of non-critical UI parts?

Intermediate LevelReact JS & React 19

39. What is useSyncExternalStore and why do Redux and Zustand rely on it?

Intermediate LevelReact JS & React 19

40. What is the exact execution timing difference between useLayoutEffect and useEffect?

Intermediate LevelReact JS & React 19

41. Why should you use TanStack Query (React Query) instead of useEffect for data fetching?

Intermediate LevelReact JS & React 19

42. How do list virtualization libraries (TanStack Virtual) render massive datasets?

Intermediate LevelReact JS & React 19

43. How does the Compound Components design pattern work in React?

Intermediate LevelReact JS & React 19

44. What is state colocation and why is it the first step in React performance tuning?

Intermediate LevelReact JS & React 19

45. How does Immer.js simplify immutable state updates in React and Redux?

Intermediate LevelReact JS & React 19

46. Why do events from a React Portal bubble up to the React parent instead of the DOM parent?

Intermediate LevelReact JS & React 19

47. What causes stale closures in React hooks and how do you resolve them?

Intermediate LevelReact JS & React 19

48. How do you programmatically reset an Error Boundary when route or props change?

Intermediate LevelReact JS & React 19

49. How does React 19 improve interoperability with custom Web Components?

Intermediate LevelReact JS & React 19

50. How do you identify and fix memory leaks from unmounted React components?

Intermediate LevelReact JS & React 19

51. How does the new React 19 use() API unwrap Promises and Contexts conditionally?

Intermediate LevelReact JS & React 19

52. How do you build a custom useDebounce hook for search input optimization?

Intermediate LevelReact JS & React 19

53. Why prefer @testing-library/user-event over fireEvent in React unit tests?

Intermediate LevelReact JS & React 19

54. How does React verify component purity using double execution in development?

Intermediate LevelReact JS & React 19

55. How do dynamic imports with React.lazy reduce initial Total Blocking Time (TBT)?

Intermediate LevelReact JS & React 19

56. Why did TypeScript completely replace PropTypes for React component validation?

Intermediate LevelReact JS & React 19

57. How do you announce dynamic React state changes to screen readers using ARIA live regions?

Intermediate LevelReact JS & React 19

58. What is the difference between React Server Components (RSC) and Client Components in React 19?

Intermediate LevelReact JS & React 19

59. How do React 19 Server Actions process server-side mutations from inline form actions?

Intermediate LevelReact JS & React 19

60. How does the use() hook in React 19 replace useContext for conditional Context consumption?

Intermediate LevelReact JS & React 19

61. How do React 19 resource loading APIs (preload, preinit, prefetchDNS) optimize page performance?

Intermediate LevelReact JS & React 19

62. How does React 19 support native document metadata tags (<title>, <meta>, <link>) inside components?

Intermediate LevelReact JS & React 19

63. How do Finite State Machines eliminate impossible UI states in React?

Intermediate LevelReact JS & React 19

64. What is the Container/Presenter component pattern and why has it evolved?

Intermediate LevelReact JS & React 19

65. What is the difference between Render Phase and Commit Phase in React rendering lifecycle?

Intermediate LevelReact JS & React 19

66. Why are modern React teams transitioning from runtime CSS-in-JS to Zero-Runtime CSS solutions?

Intermediate LevelReact JS & React 19

67. How do JavaScript Microtasks and Macrotasks interact with React state batching and rendering?

Intermediate LevelReact JS & React 19

68. How do you handle complete form submissions using native FormData API without state overhead?

Intermediate LevelReact JS & React 19

69. What is Declarative Programming in React and how does it contrast with Imperative DOM manipulation?

Intermediate LevelReact JS & React 19

70. How does passing children as props prevent unnecessary re-renders of expensive child subtrees?

Senior LevelReact JS & React 19

71. How does the React 19 Compiler (React Forget) automate memoization at build time?

Senior LevelReact JS & React 19

72. What are critical security vulnerabilities in React Server Actions and how do you secure them?

Senior LevelReact JS & React 19

73. How does the React Server Component wire format stream and reconstruct Virtual DOM over HTTP?

Senior LevelReact JS & React 19

74. What is visual tearing in concurrent rendering and how does React prevent it?

Senior LevelReact JS & React 19

75. How do you architect enterprise micro-frontends using React and Webpack/Vite Module Federation?

Senior LevelReact JS & React 19

76. What are the 4 caching layers in Next.js App Router (RSC Payload, Router Cache, Data Cache, Full Route)?

Senior LevelReact JS & React 19

77. How do you build a custom React renderer (like React Three Fiber) using react-reconciler?

Senior LevelReact JS & React 19

78. Compare Islands Architecture (Astro/Fresh) with React Server Components (RSC).

Senior LevelReact JS & React 19

79. How do you diagnose detached DOM nodes and memory leaks in React SPAs using Chrome DevTools Memory Heap?

Senior LevelReact JS & React 19

80. How do you design a scalable state architecture balancing URL state, server state, global state, and local state?

Senior LevelReact JS & React 19

81. Why cannot you use Context providers or consumers inside React Server Components?

Senior LevelReact JS & React 19

82. How do React 19 Server Actions enable progressive enhancement without JavaScript enabled?

Senior LevelReact JS & React 19

83. How do you build type-safe polymorphic components (<Box as="a" href="...">) in TypeScript?

Senior LevelReact JS & React 19

84. How do you identify and eliminate network rendering waterfalls in Suspense data architectures?

Senior LevelReact JS & React 19

85. How do you configure a shared React component library in a Turborepo/Nx monorepo with tsup/Rollup?

Senior LevelReact JS & React 19

86. How do React 19 asset loading APIs (preload, preinit, prefetchDNS) optimize Critical Rendering Path?

Senior LevelReact JS & React 19

87. How do you integrate enterprise telemetry (Sentry/Datadog) into React Error Boundaries with source maps?

Senior LevelReact JS & React 19

88. How do you debug complex hydration mismatches caused by browser extensions or third-party scripts?

Senior LevelReact JS & React 19

89. How do you write advanced TypeScript type guards and assertions for complex React component props?

Senior LevelReact JS & React 19

90. How does React reduce tree diffing algorithmic complexity from O(n^3) to O(n)?

Senior LevelReact JS & React 19

91. How do you cleanly reset form fields and state after a successful React 19 Server Action submission?

Senior LevelReact JS & React 19

92. How do you prevent prototype pollution and object injection attacks when spreading untrusted props?

Senior LevelReact JS & React 19

93. Why is Mock Service Worker (MSW) the enterprise standard for React API mocking in unit and E2E tests?

Senior LevelReact JS & React 19

94. How does useOptimistic handle complex multi-step rollback workflows when network mutations fail?

Senior LevelReact JS & React 19

95. How do you render 60fps real-time data streams (WebSockets/trading tickers) without freezing React UI?

Senior LevelReact JS & React 19

96. What is the future trajectory of React (React 20, Signals interop, and universal full-stack primitives)?

Senior LevelReact JS & React 19

97. How do you manage server validation errors and field-level feedback with useActionState in React 19?

Senior LevelReact JS & React 19

98. How does React deduplicate identical fetch requests inside Server Component subtrees?

Senior LevelReact JS & React 19

99. How does the experimental useEffectEvent (useEvent) hook solve stale closure issues without triggering effect re-runs?

Senior LevelReact JS & React 19

100. What is the future trajectory of React (React 20, Signals interop, and universal full-stack primitives)?

How to Prepare for React JS & React 19 Technical Interviews in 2026

When interviewing for software engineering positions that utilize React JS & React 19, hiring managers look for a combination of fundamental syntax proficiency, architectural understanding, code optimization techniques, and practical debugging skills.

🌱 Beginner FocusCore syntax, default configurations, standard API definitions, and avoiding common basic errors.
⚡ Intermediate FocusAsync execution patterns, performance profiling, component lifecycle, and state management.
🏆 Senior FocusInternal runtime mechanics, memory leaks, scalability bottlenecks, system design trade-offs, and security mitigation.