Lead Frontend
​
​
Log inSign up
React interview questionsJavaScript interview questionsTypeScript interview questionsCSS interview questionsHTML interview questionsSenior frontend interview questionsLead frontend engineer interview questionsQuestions by topicCompany guides
© 2026 Lead Frontend. Free educational content, provided as is; it may contain errors. Not affiliated with any company or product named on this site.
TermsPrivacyDisclaimerCopyrightLicenses & credits

React Interview Questions

121 questions with answers

Senior React interviews test two things: how well you understand what React does under the hood (rendering, reconciliation, hooks, effects and state) and whether you can build a real, accessible component under time pressure. This list mixes both: concept questions with interview-ready answers and machine coding questions you solve in a live React editor.

How to prepare

  • Explain the render cycle: what triggers a re-render, and how keys, memoization and context affect it.
  • Know the rules and pitfalls of useEffect, useMemo, useCallback and useRef, and when not to use them.
  • Practise building components end to end: state, keyboard support, ARIA roles and edge cases.
  • Be ready to discuss state management trade-offs: local state, context, reducers and external stores.

React Interview Questions

1.Accordion

Build an accessible accordion with expandable sections and full keyboard support.

UI Coding
Easy
25 min

2.Contact Form

Build a contact form with accessible inline validation, a submitting state and a success message.

UI Coding
Easy
25 min

3.Data Table

Build a paginated users table with a rows-per-page selector and previous/next navigation.

UI Coding
Medium
25 min

4.Digital Clock

Build a ticking digital clock that stays aligned to real seconds, with a 12/24-hour toggle and clean timer teardown.

UI Coding
Easy
20 min

5.File Explorer

Render a nested folder/file tree where folders expand and collapse, sorted folders-first.

UI Coding
Medium
30 min

6.Generate Table

Generate a numbered table from row and column inputs, filled row by row, column by column or in a snake pattern.

UI Coding
Easy
20 min

7.Image Carousel

Build an accessible image carousel with previous/next controls, wrap-around and dot navigation.

UI Coding
Medium
30 min

8.Job Board

Build a paginated job board on a Hacker News-style API: fetch ids, then load job details in parallel pages.

UI Coding
Medium
40 min

9.Like Button

Build a toggle Like button that talks to a flaky API, with pending, error and accessible pressed states.

UI Coding
Easy
20 min

10.Memory Game

Build a card-matching memory game with timed flip-back, move counting and screen-reader friendly announcements.

UI Coding
Medium
40 min

11.Modal Dialog

Build a reusable modal dialog with a portal, labelled dialog semantics, Escape and backdrop dismissal, and focus restoration.

UI Coding
Medium
30 min

12.Modal Dialog II: Focus Trap and Inert Background

Make a modal fully accessible: Tab and Shift+Tab stay inside, the background is inert, and focus is managed from open to close.

UI Coding
Hard
40 min

13.Progress Bars

Each click adds a progress bar that fills from 0 to 100% over two seconds, driven by requestAnimationFrame.

UI Coding
Medium
25 min

14.Selectable Cells (Drag Select)

Build a grid where dragging selects a rectangle of cells, with modifier-key multi-select and a full keyboard equivalent.

UI Coding
Hard
40 min

15.Sign-up Form Validation

Build a sign-up form with on-blur validation, a live password checklist, cross-field checks and a show-password toggle.

UI Coding
Medium
35 min

16.Star Rating

Build a star rating input with hover preview, keyboard support and a clear button, built on native radios.

UI Coding
Easy
20 min

17.Stopwatch

Build an accurate stopwatch with start, stop, lap and reset, based on timestamps rather than counting ticks.

UI Coding
Medium
30 min

18.Tabs

Build a tabs component that shows one panel at a time, with the correct tab roles and selected state.

UI Coding
Easy
20 min

19.Tabs II: Keyboard Accessible

Add roving tabindex, arrow-key navigation and automatic or manual activation to a tabs component.

UI Coding
Medium
30 min

20.Tic-tac-toe

Build a two-player tic-tac-toe game with win and draw detection, a live status and a keyboard-navigable board.

UI Coding
Medium
30 min

21.Toast Notifications

Build a toast system with a context API, live-region announcements, auto-dismiss that pauses on hover or focus, and a visible limit.

UI Coding
Medium
35 min

22.Todo List

Build a todo list with add, complete, delete and filters, using semantic forms and good focus management.

UI Coding
Easy
25 min

23.Tooltip and Popover

Build an accessible hover/focus tooltip and a click-triggered popover, and explain when to use each.

UI Coding
Medium
35 min

24.Traffic Light

Build a traffic light that cycles through configurable states with timers, a pause control and clean effect teardown.

UI Coding
Medium
25 min

25.Transfer List

Move checked items between two lists with per-list select-all and bulk transfer controls.

UI Coding
Medium
30 min

26.Users Database (CRUD)

Build a small users database with search, a keyboard-accessible listbox, and create, update, delete and cancel actions.

UI Coding
Medium
40 min

27.Whack-a-Mole

Build a timed whack-a-mole game with random moles, scoring, a countdown and keyboard play, managing several timers safely.

UI Coding
Medium
35 min

28.Wordle

Build a Wordle clone with physical and on-screen keyboards, correct duplicate-letter scoring and accessible feedback.

UI Coding
Hard
60 min

29.What is the consequence of using array indices as the value for `key`s in React?

Why index keys move state and DOM to the wrong rows, and when they are safe.

Quiz · React
Medium
6 min

30.How do you handle asynchronous data loading in React applications?

Server Components and loaders, query libraries, careful effects, Suspense and use().

Quiz · React
Medium
8 min

31.What are the benefits of using hooks in React?

Reusable stateful logic, co-location by concern, and no classes.

Quiz · React
Easy
5 min

32.What is code splitting in a React application?

Dynamic import, lazy and Suspense, route-level splitting and prefetching.

Quiz · React
Medium
6 min

33.What is the difference between controlled and uncontrolled React components?

Who owns the value, React state or the DOM, and the trade-offs of each.

Quiz · React
Easy
6 min

34.How does virtual DOM in React work? What are its benefits and downsides?

Render, diff with type and key heuristics, commit, and the costs of doing so.

Quiz · React
Medium
7 min

35.How would you optimize the performance of React contexts to reduce rerenders?

Stable values, split contexts, state/dispatch separation and selector-based stores.

Quiz · React
Hard
8 min

36.What is the purpose of the `key` prop in React?

Keys give list items stable identity for reconciliation and state.

Quiz · React
Easy
5 min

37.What are Actions in React 19? Explain `useActionState` and `useFormStatus`

Async transitions for mutations with built-in pending, error and form-reset handling.

Quiz · React
Medium
9 min

38.What are some React anti-patterns?

Derived state, effect chains, nested component definitions, mutation and more.

Quiz · React
Medium
8 min

39.What is the React Compiler and how does it change memoization?

Build-time automatic memoization, its reliance on the Rules of React, and adoption.

Quiz · React
Medium
8 min

40.Explain the composition pattern in React

children, slots and compound components instead of inheritance and prop explosions.

Quiz · React
Medium
7 min

41.What are some pitfalls about using context in React?

Re-render cascades, unstable values, overuse and missing providers.

Quiz · React
Medium
7 min

42.What are some common pitfalls when doing data fetching in React?

Races, missing cleanup, waterfalls, missing caching and stale copies of server data.

Quiz · React
Medium
8 min

43.What are error boundaries in React for?

Containing render errors with fallback UI, what they miss, and React 19 changes.

Quiz · React
Medium
6 min

44.Explain what React hydration is

How React adopts server-rendered HTML and makes it interactive, and what changed in 18 and 19.

Quiz · React
Medium
7 min

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

Non-deterministic render, client-only APIs, locale, invalid nesting, and the fixes.

Quiz · React
Medium
8 min

46.What is reconciliation in React?

How React decides which instances to keep, update or remount, based on type, position and key.

Quiz · React
Medium
7 min

47.What are React Server Components and how do they differ from SSR?

Server-only components that ship no JS, the use client boundary, and how RSC complements SSR.

Quiz · React
Hard
10 min

48.Explain server-side rendering of React applications and its benefits

Per-request HTML, hydration, streaming SSR and the trade-offs against CSR and SSG.

Quiz · React
Medium
8 min

49.How do you decide between using React state, context, and external state managers?

Classify state as server, URL, local or shared, then pick the simplest fitting tool.

Quiz · React
Hard
8 min

50.What is React Strict Mode and what are its benefits?

Development-only checks: double rendering, effect re-runs, ref checks and deprecation warnings.

Quiz · React
Medium
6 min

51.What is React Suspense and what does it enable?

Declarative loading boundaries for lazy code, data, streaming SSR and selective hydration.

Quiz · React
Medium
8 min

52.How does Suspense work for data fetching, and why doesn't it work with `useEffect`?

Suspense-enabled sources, render-as-you-fetch, and cached promises.

Quiz · React
Hard
9 min

53.What does the `use` API do in React 19 and how is it different from other hooks?

Reading promises and context during render, conditional calls, and the cached-promise rule.

Quiz · React
Medium
7 min

54.What is the `useCallback` hook in React and when should it be used?

Stable function identities, when they matter, and the React Compiler.

Quiz · React
Medium
6 min

55.What is the `useMemo` hook in React and when should it be used?

Caching expensive calculations and stable identities, and when not to bother.

Quiz · React
Medium
6 min

56.What is the `useRef` hook in React and when should it be used?

A persistent mutable box for DOM nodes and values that don't affect rendering.

Quiz · React
Easy
6 min

57.Explain `useTransition` and `useDeferredValue` and when to use each

Marking updates as non-urgent so concurrent React keeps input responsive.

Quiz · React
Hard
9 min

58.What are the rules of React hooks?

Top-level only, React functions only, why call order matters, and lint enforcement.

Quiz · React
Easy
6 min

59.What is the purpose of callback function argument format of `setState()` in React and when should it be used?

Updater functions compute next state from the latest queued state.

Quiz · React
Medium
6 min

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

Props are inputs owned by the parent; state is memory owned by the component.

Quiz · React
Easy
5 min

61.Why do my effects run twice in development, and how should I fix it?

Strict Mode's mount-unmount-mount check and how to write symmetric cleanups.

Quiz · React
Easy
6 min

62.How do you test React applications?

A layered strategy built on Testing Library, user-event, MSW and E2E tests.

Quiz · React
Medium
8 min

63.What does the dependency array of `useEffect` affect?

When effects re-synchronize, Object.is comparison, and stale closures.

Quiz · React
Medium
7 min

64.What is the difference between `useEffect` and `useLayoutEffect` in React?

Effect timing relative to paint, and when blocking paint is worth it.

Quiz · React
Medium
7 min

65.Explain what happens when the `useState` setter function is called in React

Enqueue, schedule, batch, render, reconcile, commit, and the state snapshot.

Quiz · React
Medium
7 min

66.What is JSX and how does it work?

How JSX compiles to element-creating calls and the rules that follow.

Quiz · React
Easy
5 min

67.What does re-rendering mean in React?

Render vs commit, what triggers re-renders, and when they become a problem.

Quiz · React
Easy
6 min

68.What is React? Describe the benefits of React

What React is, why teams choose it, and its honest trade-offs.

Quiz · React
Easy
5 min

69.What is virtual DOM in React?

An in-memory description of the UI that React diffs to update the real DOM.

Quiz · React
Easy
5 min

70.Why does React recommend against mutating state?

Reference equality, memoization, snapshots and concurrent rendering all assume immutability.

Quiz · React
Easy
6 min

71.Accordion II: Single Open, Controlled

Extend an accordion so only one section is open at a time, with optional collapsing and a controlled API.

UI Coding
Medium
25 min

72.Analog Clock

Draw a ticking analog clock in SVG with correctly rotated hour, minute and second hands and an accessible name.

UI Coding
Medium
30 min

73.Auth Code Input

Build a one-time-code input split into digit boxes with auto-advance, backspace, arrow keys and paste support.

UI Coding
Medium
30 min

74.Autocomplete / Typeahead

Build an accessible combobox that searches an async API with debouncing, caching and race-condition handling.

UI Coding
Hard
45 min

75.Birth Year Histogram

Bucket a list of birth years into a bar-chart histogram with adjustable bucket size and an accessible data-table view.

UI Coding
Medium
30 min

76.Connect Four

Build Connect Four with gravity drops, last-move win detection, column-based keyboard controls and announced moves.

UI Coding
Hard
50 min

77.Data Table II: Sorting and Filtering

Add sortable column headers and a search filter to a paginated users table.

UI Coding
Medium
35 min

78.Data Table III: Generic Columns

Turn a users-only table into a reusable DataTable driven by column definitions with renderers, sorting and typed filters.

UI Coding
Hard
50 min

79.Date Picker

Build a date input with a calendar dialog following the WAI-ARIA date picker pattern: grid keyboard navigation, focus trap and return.

UI Coding
Hard
60 min

80.Dice Roller

Roll a chosen number of six-sided dice, draw each face with CSS pips and announce the total accessibly.

UI Coding
Easy
20 min

81.Drag-and-Drop Sortable List

Build a reorderable list with pointer dragging and a full keyboard alternative: pick up, move, drop or cancel, with announcements.

UI Coding
Hard
55 min

82.Dropdown Menu

Build an accessible menu button: open and close, arrow-key and typeahead navigation, outside click and focus return.

UI Coding
Medium
35 min

83.File Explorer II: Keyboard Tree

Turn a file explorer into a WAI-ARIA tree view with roving focus, arrow-key navigation and type-ahead.

UI Coding
Hard
45 min

84.Flight Booker

Build a one-way or return flight form with date constraints, disabled states and a booking confirmation.

UI Coding
Easy
20 min

85.Grid Lights

Build a grid of toggle lights that, once all are lit, switch off one by one in reverse activation order.

UI Coding
Medium
30 min

86.Hello World Counter

Build a counter with increment, decrement and reset that never drops below zero and announces its value.

UI Coding
Easy
10 min

87.Holy Grail Layout

Build the classic header, three columns and footer layout with CSS Grid, landmarks, a sticky footer and responsive stacking.

UI Coding
Easy
20 min

88.Image Carousel II: Infinite Transitions

Extend the image carousel with sliding animations that loop seamlessly in both directions.

UI Coding
Hard
45 min

89.Infinite Scroll Feed

Build a cursor-paginated feed that loads more posts as you scroll, with abort handling, retries and the ARIA feed pattern.

UI Coding
Medium
40 min

90.Kanban Board

Build a kanban board with normalised state, adding and deleting cards, and moving cards between columns by pointer or keyboard.

UI Coding
Hard
60 min

91.Mortgage Calculator

Calculate the monthly payment, total cost and total interest of a fixed-rate loan as the user types.

UI Coding
Easy
20 min

92.Multi-step Form Wizard

Build a three-step sign-up wizard with per-step validation, a progress indicator, focus management and a review step.

UI Coding
Medium
45 min

93.Nested Checkboxes

Build a checkbox tree where parents reflect their children as checked, unchecked or indeterminate.

UI Coding
Medium
30 min

94.Pixel Art Editor

Build a 16×16 pixel-art editor with a colour palette, draw/erase tools, click-and-drag painting and keyboard drawing.

UI Coding
Medium
35 min

95.Progress Bar

Build a reusable, accessible progress bar that clamps its value and shows the percentage.

UI Coding
Easy
15 min

96.Progress Bars II: Concurrency Limit

Extend the progress bars so at most three fill at once while the rest wait in a queue.

UI Coding
Medium
25 min

97.Progress Bars III: Pause and Resume

Queue-limited progress bars that can be paused and resumed without losing progress, driven by one shared clock.

UI Coding
Hard
40 min

98.Temperature Converter

Two linked inputs, Celsius and Fahrenheit, that update each other and handle invalid input gracefully.

UI Coding
Easy
15 min

99.Tic-tac-toe II: N × N, M in a Row

Generalise tic-tac-toe to a configurable N × N board where M marks in a row win, with an efficient last-move win check.

UI Coding
Hard
45 min

100.Tweet Card

Build a social post card with semantic markup, relative timestamps, compact counts and accessible action buttons.

UI Coding
Easy
25 min

101.Virtualized List

Render a 10,000-row list smoothly by windowing: only the visible rows plus overscan are in the DOM.

UI Coding
Hard
50 min

102.How do you debug React applications?

DevTools, the Profiler, Strict Mode, lint rules and production error reporting.

Quiz · React
Medium
7 min

103.How do you localize React applications?

Message catalogs, ICU MessageFormat, Intl, locale routing, RTL and translation workflow.

Quiz · React
Medium
7 min

104.How has error handling changed in React 19?

Root error callbacks, de-duplicated logging, Action errors and boundaries.

Quiz · React
Medium
7 min

105.How do refs work as a prop in React 19, and what are ref cleanup functions?

ref as a regular prop, the end of forwardRef, and callback ref cleanups.

Quiz · React
Medium
6 min

106.What is React Fiber and how is it an improvement over the previous approach?

Incremental, interruptible reconciliation with priorities, the basis of concurrent React.

Quiz · React
Hard
8 min

107.What is `forwardRef()` in React used for?

Passing refs through components, and why React 19 makes ref a regular prop.

Quiz · React
Medium
5 min

108.What are React Fragments used for?

Grouping children without extra DOM nodes, keyed fragments, and state preservation.

Quiz · React
Easy
4 min

109.What are higher-order components in React?

Component-in, component-out wrappers, their conventions, and why hooks replaced most of them.

Quiz · React
Medium
5 min

110.What is the difference between React Node, React Element, and a React Component?

Components produce elements; elements are one kind of renderable node.

Quiz · React
Medium
6 min

111.Explain one-way data flow of React and its benefits

Props down, events up, one owner per piece of state.

Quiz · React
Easy
5 min

112.What are React Portals used for?

Rendering into another DOM node while staying in the React tree for context and events.

Quiz · React
Medium
5 min

113.What are render props in React and what are they for?

Function props that delegate rendering, and where they still beat hooks.

Quiz · React
Medium
5 min

114.Explain static generation of React applications and its benefits

Build-time HTML on a CDN, its freshness limits, and ISR-style hybrids.

Quiz · React
Medium
6 min

115.How does streaming server-side rendering with Suspense work in React?

Shell first, boundaries streamed later, and selective hydration on the client.

Quiz · React
Hard
10 min

116.What is the `useId` hook in React and when should it be used?

SSR-safe unique ids for accessibility attributes, and why not for keys.

Quiz · React
Easy
4 min

117.How does `useOptimistic` work in React 19?

Optimistic overlays on real state during Actions, with automatic revert.

Quiz · React
Medium
7 min

118.What is the `useReducer` hook in React and when should it be used?

Centralized, testable state transitions with a pure reducer and stable dispatch.

Quiz · React
Medium
6 min

119.How do you reset a component's state in React?

State follows type plus position; change the key or reset explicitly.

Quiz · React
Medium
6 min

120.What is the Flux pattern and what are its benefits?

Unidirectional actions, dispatcher and stores, and how Redux evolved from it.

Quiz · React
Medium
6 min

121.Explain the presentational vs container component pattern in React

Separating logic from view, and how hooks and headless libraries changed it.

Quiz · React
Easy
5 min

More interview questions

JavaScript Interview QuestionsTypeScript Interview QuestionsCSS Interview QuestionsHTML Interview QuestionsSenior Frontend Interview QuestionsLead Frontend Engineer Interview QuestionsQuestions by topic