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

Senior Frontend Interview Questions

238 questions with answers

Senior frontend interviews go deeper than definitions. Interviewers want production-quality code, clear trade-offs and an understanding of performance, accessibility and architecture. This list collects the questions marked highest importance across JavaScript, React and UI coding, algorithms, quizzes and system design.

How to prepare

  • Write clean, tested code and talk through edge cases as you go.
  • Explain performance and accessibility decisions, not just the happy path.
  • Practise at least one frontend system design end to end: requirements, architecture, data, API and optimisations.
  • Follow a study plan so you cover every round, not just your favourite one.

Senior Frontend Interview Questions

1.Array.prototype.filter

Implement Array.prototype.filter with thisArg support and correct handling of sparse arrays.

JS Functions
Easy
10 min

2.Array.prototype.flat

Implement Array.prototype.flat with a depth argument, hole removal and an iterative variant.

JS Functions
Medium
15 min

3.Array.prototype.map

Implement Array.prototype.map, keeping holes in sparse arrays and supporting thisArg.

JS Functions
Easy
10 min

4.Array.prototype.reduce

Implement Array.prototype.reduce, including the no-initial-value rules and sparse arrays.

JS Functions
Easy
15 min

5.Backbone Model

Build an observable Model class with defaults, get/set/unset, per-attribute change events, previous values and silent updates.

JS Functions
Hard
40 min

6.Cache Async (Deduplicate Requests)

Memoize an async function so concurrent calls share one in-flight promise, results expire after a TTL and failures are not cached.

JS Functions
Medium
25 min

7.classnames

Build a CSS class string from strings, numbers, nested arrays and conditional objects.

JS Functions
Medium
20 min

8.Curry

Turn a function of n arguments into one that can be called with those arguments one or several at a time.

JS Functions
Medium
20 min

9.Data Selection

Implement a small query function over an array of records: filtering, multi-key stable sorting, pagination and field projection.

JS Functions
Medium
30 min

10.Debounce

Delay invoking a function until a burst of calls has stopped for a given wait time.

JS Functions
Medium
20 min

11.Deep Clone

Make a deep copy of a JSON-like value so that no nested object or array is shared with the original.

JS Functions
Medium
15 min

12.Deep Equal

Decide whether two JSON-like values are structurally equal, comparing nested objects and arrays by content.

JS Functions
Medium
20 min

13.Event Emitter

Implement an EventEmitter class with on, off and emit, the observer pattern behind Node's events module and DOM events.

JS Functions
Medium
20 min

14.Event Emitter II

Extend an event emitter with once, unsubscribe handles, bulk off and listener counts, with well-defined behaviour during emit.

JS Functions
Medium
25 min

15.Flatten

Flatten a nested array to a given depth, recursively or with an explicit stack.

JS Functions
Medium
20 min

16.Function.prototype.bind

Implement Function.prototype.bind with partial application and correct behaviour under new.

JS Functions
Medium
20 min

17.Get

Safely read a nested value from an object by a dot/bracket path, falling back to a default.

JS Functions
Medium
20 min

18.getElementsByClassName

Find every descendant element that has all of the given class names by walking the DOM tree yourself.

JS Functions
Medium
15 min

19.getElementsByTagName

Return every descendant element with a given tag name (or all of them for "*") by traversing the DOM tree.

JS Functions
Medium
15 min

20.Group By

Group the elements of an array into arrays keyed by the result of an iteratee.

JS Functions
Medium
15 min

21.JSON.stringify

Reimplement JSON.stringify: escaping, undefined and function handling, toJSON, wrapper objects, cycles and BigInt errors.

JS Functions
Hard
40 min

22.List Format

Format a list of names into a readable sentence with options for sorting, de-duplication and an "and N others" cutoff.

JS Functions
Medium
20 min

23.LRU Cache

Implement a fixed-capacity cache that evicts the least recently used entry, with O(1) get and set.

JS Functions
Medium
25 min

24.Map Async

Map over a list with an async callback, running every call in parallel and keeping the results in input order.

JS Functions
Medium
15 min

25.Map Async with Limit

Map over a list with an async callback while never running more than a given number of calls at once.

JS Functions
Hard
30 min

26.Memoize

Cache a function's results by argument so repeated calls with the same input skip the work.

JS Functions
Medium
15 min

27.Middlewares

Compose async middleware functions into one onion-style pipeline where each step can run code before and after next().

JS Functions
Medium
25 min

28.Promise.all

Implement Promise.all: resolve with every result in order, or reject on the first failure.

JS Functions
Medium
20 min

29.Promise.any

Implement Promise.any: fulfill with the first success, or reject with an AggregateError.

JS Functions
Medium
20 min

30.Promise Implementation

Build a Promises/A+-style MyPromise with then, catch, finally, chaining and thenable adoption.

JS Functions
Hard
45 min

31.Promise Pool

Build a concurrency-limited task queue: tasks can be added at any time and at most N run at once.

JS Functions
Hard
30 min

32.Promise Timeout

Wrap a promise so it rejects with a TimeoutError if it doesn't settle in time, without leaking timers.

JS Functions
Medium
15 min

33.Promisify

Convert a Node-style callback function into one that returns a promise.

JS Functions
Medium
15 min

34.Pub/Sub Store (Mini Redux)

Implement createStore with getState, dispatch and subscribe: the core of Redux in about 50 lines.

JS Functions
Medium
25 min

35.Retry with Backoff

Retry a failing async operation with exponential backoff and a predicate that decides which errors are worth retrying.

JS Functions
Medium
20 min

36.Signals (Fine-Grained Reactivity)

Implement createSignal, createEffect, createMemo, batch and untrack with automatic dependency tracking and glitch-free updates.

JS Functions
Hard
60 min

37.Spreadsheet Evaluator

Build a spreadsheet engine: parse cell formulas, evaluate references and ranges, recompute dependents on change and detect cycles.

JS Functions
Hard
60 min

38.Squash Object

Flatten a nested object into a single level whose keys are dot-separated paths.

JS Functions
Medium
20 min

39.Table of Contents

Build a nested table of contents from the h1–h6 headings in a document, generating unique anchor ids and rendering it as nested lists.

JS Functions
Hard
35 min

40.Throttle

Limit a function to at most one call per wait window, with leading and trailing calls.

JS Functions
Medium
20 min

41.Undo/Redo History

Implement an undoable value with past and future stacks, redo invalidation, no-op detection and a bounded history size.

JS Functions
Medium
20 min

42.Unique Array

Remove duplicate values from an array while keeping the first occurrence of each, in order.

JS Functions
Easy
10 min

43.Query String Parse and Stringify

Parse a URL query string into an object (with repeated keys as arrays) and serialise it back, handling encoding, + as space and malformed input.

JS Functions
Medium
25 min

44.Virtual DOM Diff (Keyed Children)

Patch the real DOM from an old and a new virtual tree, reusing nodes by type and key and moving keyed children instead of recreating them.

JS Functions
Hard
50 min

45.Virtual DOM: createElement and render

Implement h() to build virtual DOM nodes and render() to turn them into real DOM, with attributes, styles, events and function components.

JS Functions
Hard
35 min

46.Accordion

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

UI Coding
Easy
25 min

47.Contact Form

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

UI Coding
Easy
25 min

48.Data Table

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

UI Coding
Medium
25 min

49.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

50.File Explorer

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

UI Coding
Medium
30 min

51.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

52.Image Carousel

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

UI Coding
Medium
30 min

53.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

54.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

55.Memory Game

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

UI Coding
Medium
40 min

56.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

57.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

58.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

59.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

60.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

61.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

62.Stopwatch

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

UI Coding
Medium
30 min

63.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

64.Tabs II: Keyboard Accessible

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

UI Coding
Medium
30 min

65.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

66.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

67.Todo List

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

UI Coding
Easy
25 min

68.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

69.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

70.Transfer List

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

UI Coding
Medium
30 min

71.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

72.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

73.Wordle

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

UI Coding
Hard
60 min

74.Best Time to Buy and Sell Stock

Find the largest gain from one buy followed by one later sell in a price history.

Algorithms
Easy
15 min

75.Binary Search

Find a value's index in a sorted array in logarithmic time.

Algorithms
Easy
15 min

76.Binary Tree Traversals

Return the pre-order, in-order and post-order traversals of a binary tree.

Algorithms
Easy
20 min

77.Breadth-First Search

Find the fewest clicks between two pages of a site with breadth-first search.

Algorithms
Medium
20 min

78.Climbing Stairs

Count the ways to reach the top taking one or two steps at a time, the gentlest intro to DP.

Algorithms
Easy
15 min

79.Coin Change

Find the fewest coins (or credit packs) that add up exactly to an amount, using dynamic programming.

Algorithms
Medium
25 min

80.Course Schedule

Decide whether a set of lessons with prerequisites can all be completed, by detecting cycles.

Algorithms
Medium
25 min

81.Depth-First Search

Traverse a graph depth-first from a start node and return the order nodes are visited.

Algorithms
Medium
20 min

82.Kth Largest Element

Find the k-th largest value without fully sorting, using a size-k heap or quickselect.

Algorithms
Medium
25 min

83.Binary Tree Level Order Traversal

Group a tree's values by depth, row by row, using breadth-first search.

Algorithms
Medium
20 min

84.Longest Substring Without Repeating Characters

Find the length of the longest run of characters with no repeats using a sliding window.

Algorithms
Medium
20 min

85.Lowest Common Ancestor

Find the closest shared ancestor of two nodes in a DOM-like tree.

Algorithms
Medium
25 min

86.Maximum Subarray

Find the contiguous stretch with the largest sum using Kadane's algorithm.

Algorithms
Medium
20 min

87.Meeting Rooms II

Find the minimum number of rooms (or calendar columns) needed so no two overlapping meetings share one.

Algorithms
Medium
25 min

88.Merge Intervals

Collapse overlapping calendar events into the minimal set of busy blocks.

Algorithms
Medium
20 min

89.Merge Sort

Sort an array of numbers with the divide-and-conquer merge sort algorithm in O(n log n).

Algorithms
Medium
25 min

90.Min Heap

Implement a binary min-heap priority queue with a custom comparator.

Algorithms
Medium
30 min

91.Number of Islands

Count connected regions of filled cells in a grid with flood fill.

Algorithms
Medium
20 min

92.Queue

Build a first-in, first-out queue class with O(1) enqueue and dequeue.

Algorithms
Easy
15 min

93.Stack

Build a last-in, first-out stack class, the structure behind undo history and the call stack.

Algorithms
Easy
10 min

94.Top K Frequent Elements

Return the k most frequent values in a list, faster than sorting everything.

Algorithms
Medium
20 min

95.Topological Sort

Order modules so each one comes after everything it imports, and detect circular imports.

Algorithms
Medium
30 min

96.Two Sum

Find the two items in a list whose values add up to a target, in a single pass with a hash map.

Algorithms
Easy
15 min

97.Valid Parentheses

Check that every bracket in a code snippet is closed by the right kind, in the right order.

Algorithms
Easy
15 min

98.Validate Binary Search Tree

Check whether a binary tree satisfies the BST ordering rule across whole subtrees, not just parent and child.

Algorithms
Medium
20 min

99.How do you abort a web request using `AbortController` in JavaScript?

Cancelling fetch with signals, timeouts, AbortSignal.any and cleaning up in effects.

Quiz · JavaScript
Medium
6 min

100.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

101.What is async/await and how does it simplify asynchronous code?

Syntax over promises: sequential vs parallel awaits, error handling, top-level await and pitfalls.

Quiz · JavaScript
Medium
7 min

102.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

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

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

Quiz · React
Easy
5 min

104.What is code splitting in a React application?

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

Quiz · React
Medium
6 min

105.How do you decide where to code-split a large front-end app, and what can go wrong?

Route, component and vendor splitting, request waterfalls, chunk granularity and caching trade-offs.

Quiz · Performance
Medium
9 min

106.What are some common security headers and their purpose?

CSP, HSTS, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, COOP and friends.

Quiz · Security
Medium
7 min

107.What are the common pitfalls of using the `this` keyword?

Lost receivers, callbacks, nested functions, arrow methods on objects and class field trade-offs.

Quiz · JavaScript
Easy
5 min

108.Explain the differences between CommonJS modules and ES modules in JavaScript

Static imports vs runtime require, live bindings, loading semantics, tree-shaking and interop in Node.

Quiz · JavaScript
Medium
8 min

109.How would you design and roll out a Content Security Policy for an existing production app?

Strict nonce-based CSP, strict-dynamic, report-only rollout, reporting, and the directives that matter.

Quiz · Security
Hard
11 min

110.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

111.What are the Core Web Vitals today, how are they measured, and what are the thresholds?

LCP, INP and CLS: what each one captures, the p75 thresholds, and lab vs field data.

Quiz · Performance
Medium
8 min

112.When does the browser send a CORS preflight, and how do credentialed cross-origin requests work?

Simple vs preflighted requests, the response headers involved, credentials mode, caching preflights and debugging.

Quiz · Web & Browser
Medium
9 min

113.What are the most common misconceptions about CORS as a security mechanism?

Why CORS relaxes rather than adds protection, origin reflection bugs, null origins and what actually protects APIs.

Quiz · Security
Hard
9 min

114.Walk through the critical rendering path. What blocks rendering, and how do you shorten it?

HTML parsing, CSSOM, render-blocking vs parser-blocking resources, the preload scanner and first paint.

Quiz · Web & Browser
Medium
9 min

115.Compare CSR, SSR, SSG, ISR and streaming SSR. How do you choose a rendering strategy per page?

Trade-offs in TTFB, LCP, INP, freshness, cost and complexity, with a per-route decision framework.

Quiz · Web & Browser
Hard
11 min

116.What is CSRF, and is SameSite=Lax enough to prevent it in 2025?

How CSRF works, SameSite modes and browser defaults, same-site vs same-origin, and layered defences.

Quiz · Security
Hard
10 min

117.What are CSS container queries, and how do they change component design compared with media queries?

container-type, named containers, container query units, style queries and the containment trade-offs.

Quiz · CSS
Medium
8 min

118.How do CSS custom properties differ from Sass/Less variables, and how would you use them for theming?

Runtime vs compile-time, inheritance and scoping, @property typing, fallbacks and design-token architecture.

Quiz · CSS
Medium
8 min

119.Explain the concept of debouncing and throttling

Run after activity stops versus at most once per interval, with implementations and use cases.

Quiz · Performance
Easy
6 min

120.How do you handle errors in asynchronous operations?

try/catch with await, .catch, unhandled rejections, fetch HTTP errors, aggregation and retries.

Quiz · JavaScript
Easy
7 min

121.What is the event loop? Explain the difference between the macrotask and microtask queues.

How JavaScript schedules callbacks, promises and rendering on a single thread.

Quiz · JavaScript
Medium
8 min

122.What is the first rule of ARIA, and what are the most common ARIA mistakes you see in code reviews?

Native first, ARIA changes semantics not behaviour, and the recurring misuse patterns in component libraries.

Quiz · HTML
Medium
8 min

123.How do you decide between Flexbox and Grid, and what problem does subgrid solve?

Content-out vs layout-in thinking, intrinsic sizing, auto-fit/minmax, subgrid alignment and accessibility of visual reordering.

Quiz · CSS
Medium
8 min

124.How do you handle errors using try...catch blocks?

How try/catch works with sync and async code, and how to catch errors usefully.

Quiz · JavaScript
Easy
5 min

125.What are some best practices for handling sensitive data in JavaScript?

What never belongs in the client, token storage, transport, logging and memory hygiene.

Quiz · Security
Medium
7 min

126.What causes Cumulative Layout Shift (CLS) and how do you fix it?

Session windows, the usual culprits (images, ads, fonts, injected banners) and how to debug shifts.

Quiz · Performance
Medium
8 min

127.How do you find and fix a poor INP (Interaction to Next Paint)?

Input delay, processing time and presentation delay: finding the slow interaction and fixing each phase.

Quiz · Performance
Hard
10 min

128.Your field LCP is 4.1 s on mobile. How do you diagnose and improve it?

Breaking LCP into TTFB, resource load delay, load duration and render delay, and fixing each part.

Quiz · Performance
Hard
10 min

129.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

130.How does the native <dialog> element work, and what does showModal() give you over a custom modal?

Top layer, inertness, focus handling, Escape, ::backdrop, form method=dialog and remaining gaps.

Quiz · HTML
Medium
8 min

131.Design an HTTP caching strategy for a web app: Cache-Control, ETag and stale-while-revalidate.

Immutable hashed assets, revalidated HTML, CDN vs browser caches, validators and common caching incidents.

Quiz · Web & Browser
Hard
10 min

132.How do you make an HTTP request using the Fetch API?

GET and POST with fetch, checking response.ok, timeouts and cancellation.

Quiz · JavaScript
Easy
6 min

133.How would you set up image optimisation for a large, image-heavy site?

Formats, responsive images, lazy loading, priority hints, image CDNs and governance at scale.

Quiz · Performance
Medium
9 min

134.How do you import and export modules in JavaScript?

Named, default, namespace, re-export and dynamic imports, and live bindings.

Quiz · JavaScript
Easy
5 min

135.What are the various data types in JavaScript?

The seven primitives plus objects, typeof quirks, and value vs reference semantics.

Quiz · JavaScript
Easy
5 min

136.What are modules and why are they useful?

Scope isolation, explicit dependencies, tree shaking and code splitting with ES modules.

Quiz · JavaScript
Easy
5 min

137.What are some common performance bottlenecks in JavaScript applications?

Large bundles, long tasks, layout thrashing, memory leaks, network waterfalls and over-rendering.

Quiz · Performance
Medium
7 min

138.Explain the concept of lazy loading and how it can improve performance

Deferring images, iframes, code and data until needed, and when not to.

Quiz · Performance
Easy
5 min

139.Explain the concept of lexical scoping

Scope decided by where code is written, the scope chain, and how it enables closures.

Quiz · JavaScript
Easy
5 min

140.What is a long task, and what are the ways to break one up and yield to the main thread?

The 50 ms rule, setTimeout vs scheduler.yield vs postTask, isInputPending, Workers and the LoAF API.

Quiz · Performance
Hard
10 min

141.Explain the Observer pattern and its use cases

Subjects notifying subscribers: event emitters, EventTarget, stores and their pitfalls.

Quiz · JavaScript
Medium
6 min

142.How can you optimize network requests for better performance?

Fewer, smaller, earlier, cached and prioritised requests.

Quiz · Performance
Hard
7 min

143.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

144.Explain preload, prefetch, preconnect, dns-prefetch and modulepreload. When does each help or hurt?

Resource hints, speculation rules and 103 Early Hints, with the costs of over-hinting.

Quiz · Performance
Medium
9 min

145.How is `Promise.all()` different from `Promise.allSettled()`?

Fail-fast vs wait-for-everything, result shapes, and where any and race fit in.

Quiz · JavaScript
Medium
5 min

146.Explain the different states of a Promise

Pending, fulfilled and rejected, what settled and resolved really mean, and why state is immutable.

Quiz · JavaScript
Medium
5 min

147.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

148.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

149.What are some React anti-patterns?

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

Quiz · React
Medium
8 min

150.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

151.Explain the composition pattern in React

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

Quiz · React
Medium
7 min

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

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

Quiz · React
Medium
7 min

153.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

154.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

155.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

156.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

157.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

158.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

159.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

160.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

161.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

162.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

163.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

164.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

165.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

166.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

167.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

168.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

169.Explain reflow (layout), repaint and compositing. How do you avoid layout thrashing and janky animations?

Which CSS changes trigger which pipeline stages, forced synchronous layout, will-change and layer costs.

Quiz · Web & Browser
Medium
9 min

170.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

171.Explain the concept of scope in JavaScript

Global, module, function and block scope, the scope chain, shadowing and the temporal dead zone.

Quiz · JavaScript
Easy
6 min

172.How can you implement secure authentication and authorization in JavaScript applications?

Session cookies vs tokens, OAuth/OIDC with PKCE, passkeys, and server-enforced authorization.

Quiz · Security
Hard
9 min

173.Why does semantic HTML matter, and how do landmark elements help assistive technology users?

Implicit roles, landmark navigation, headings, buttons vs links, and the cost of div soup.

Quiz · HTML
Easy
7 min

174.What are Sets and Maps and how are they used?

Unique-value collections and keyed collections with any key type, plus new Set methods.

Quiz · JavaScript
Easy
5 min

175.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

176.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

177.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

178.How can you test asynchronous code in JavaScript?

Awaiting promises, asserting rejections, fake timers and waiting for UI updates.

Quiz · JavaScript
Medium
6 min

179.How do you test React applications?

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

Quiz · React
Medium
8 min

180.What is the difference between `any`, `unknown` and `never` in TypeScript?

The escape hatch, the safe top type, and the empty bottom type.

Quiz · TypeScript
Easy
6 min

181.What are conditional types and the `infer` keyword in TypeScript?

Type-level branching, pattern matching with infer, and distribution over unions.

Quiz · TypeScript
Hard
9 min

182.What are discriminated unions in TypeScript and how do you enforce exhaustive handling?

Tagged unions that make impossible states unrepresentable, checked with never.

Quiz · TypeScript
Medium
7 min

183.Explain generics and generic constraints in TypeScript

Type parameters that preserve relationships, constraints, defaults, const and NoInfer.

Quiz · TypeScript
Medium
8 min

184.What is the difference between an interface and a type alias in TypeScript?

Declaration merging and extends vs unions, tuples and type-level computation.

Quiz · TypeScript
Easy
6 min

185.Explain `keyof`, `typeof` and indexed access types in TypeScript

Deriving key unions, value types and property types from existing code.

Quiz · TypeScript
Medium
6 min

186.What does the `satisfies` operator do in TypeScript and how is it different from a type annotation or `as`?

Validate against a type while keeping precise inference.

Quiz · TypeScript
Medium
6 min

187.What does `strict` mode enable in TypeScript, and which extra flags are worth turning on?

The strict family, noUncheckedIndexedAccess, exactOptionalPropertyTypes and migration strategy.

Quiz · TypeScript
Medium
7 min

188.What is structural typing in TypeScript and what are its implications?

Compatibility by shape, excess property checks, and when you need nominal types.

Quiz · TypeScript
Easy
6 min

189.What is the difference between a type assertion and a type annotation in TypeScript?

Checking vs overriding the compiler, non-null assertions, and safer alternatives.

Quiz · TypeScript
Easy
6 min

190.How does type narrowing work in TypeScript, and how do you write type guards?

Control-flow narrowing, user-defined and inferred type predicates, and assertion functions.

Quiz · TypeScript
Medium
7 min

191.Do TypeScript types exist at runtime? How do you validate external data?

Type erasure, trust boundaries, schema validation and type stripping.

Quiz · TypeScript
Medium
7 min

192.How do you type event handlers in React with TypeScript?

Synthetic event types, handler aliases, target vs currentTarget, and DOM listener types.

Quiz · TypeScript
Easy
6 min

193.How do you type React component props in TypeScript?

Props types, ReactNode children, native element props, exclusive variants and React.FC.

Quiz · TypeScript
Easy
7 min

194.Which built-in TypeScript utility types do you use most, and how do they work?

Partial, Pick, Omit, Record, ReturnType, Awaited and friends, plus their pitfalls.

Quiz · TypeScript
Easy
7 min

195.Explain the difference between unit testing, integration testing, and end-to-end testing

Scope, speed, confidence and cost of each level, with front-end examples.

Quiz · JavaScript
Medium
6 min

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

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

Quiz · React
Medium
7 min

197.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

198.Explain the different ways the `this` keyword can be bound

Default, implicit, explicit and new binding, arrow functions, and the precedence between them.

Quiz · JavaScript
Medium
6 min

199.WebSockets vs Server-Sent Events vs long polling: how do you choose a real-time transport?

Directionality, infrastructure, reconnection, scaling and HTTP/2 implications for each real-time option.

Quiz · Web & Browser
Medium
9 min

200.What are Promises and how do they work?

Promise objects, chaining, error propagation, microtask scheduling and Promise.withResolvers.

Quiz · JavaScript
Easy
7 min

201.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

202.What happens, end to end, when you type a URL into the browser and press Enter?

From URL parsing, HSTS and DNS through TLS, HTTP/2 or HTTP/3, caching, parsing and rendering.

Quiz · Web & Browser
Medium
12 min

203.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

204.What is the use of `Promise.all()`

Running independent async work in parallel, fail-fast semantics and concurrency limits.

Quiz · JavaScript
Easy
5 min

205.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

206.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

207.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

208.Where should a browser app store JWTs or session tokens: localStorage, memory or cookies?

XSS vs CSRF exposure, HttpOnly cookies, in-memory access tokens with refresh rotation, and the BFF pattern.

Quiz · Security
Hard
10 min

209.Why does React recommend against mutating state?

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

Quiz · React
Easy
6 min

210.How do you write unit tests for JavaScript code?

Arrange-act-assert, testing behaviour not implementation, isolation and edge cases.

Quiz · JavaScript
Medium
6 min

211.Explain stored, reflected and DOM-based XSS. Does using React make you safe?

The three XSS classes, what JSX escaping does and doesn't cover, and defence in depth.

Quiz · Security
Medium
9 min

212.Autocomplete / Typeahead Component

Design a reusable, accessible autocomplete component with debounced search, caching, race handling and keyboard navigation.

System Design
Medium
45 min

213.Chat Application (e.g. Messenger)

Design a real-time web messenger with conversations, delivery and read receipts, typing indicators and offline support.

System Design
Hard
45 min

214.Collaborative Document Editor (e.g. Google Docs)

Design a real-time collaborative rich-text editor with presence, comments, offline edits and version history.

System Design
Hard
60 min

215.Collaborative Spreadsheet (e.g. Google Sheets)

Design a browser spreadsheet with a virtualized grid, formula engine, dependency graph and real-time co-editing.

System Design
Hard
60 min

216.Data Table / Data Grid Component

Design a reusable data table with sorting, filtering, pagination, selection, column resizing and virtualization.

System Design
Hard
45 min

217.Design System at Scale

Design a company-wide design system (tokens, components, docs, tooling) consumed by dozens of teams across multiple frameworks and brands.

System Design
Hard
60 min

218.Collaborative Design / Drawing Tool (e.g. Figma, Canva)

Design a multiplayer vector canvas with an infinite viewport, shape editing, hit testing, cursors and undo.

System Design
Hard
60 min

219.Dropdown Menu Component

Design an accessible dropdown/action menu with submenus, typeahead, robust positioning and focus management.

System Design
Medium
45 min

220.E-commerce Marketplace (e.g. Amazon)

Design the front end of a large e-commerce site: search and listing, product detail, cart and checkout, with SEO and Core Web Vitals in mind.

System Design
Hard
45 min

221.Email Client (e.g. Outlook / Gmail)

Design a web email client: folders and threaded inbox, safe rendering of HTML emails, composer with drafts, offline and keyboard-driven workflows.

System Design
Hard
45 min

222.Feature Flag and Experimentation Platform

Design a feature-flag and A/B testing platform with targeting rules, client SDKs, real-time updates, exposure logging and governance.

System Design
Hard
60 min

223.Front-End Monorepo and CI Platform

Design the repository, build, test and CI/CD platform for 30 front-end teams sharing one monorepo, with affected builds, remote caching and governance.

System Design
Hard
60 min

224.Front-End Observability Platform (RUM, Errors, Tracing)

Design an org-wide front-end observability platform covering real user monitoring, error tracking with source maps, and distributed tracing.

System Design
Hard
60 min

225.Image Carousel Component

Design an accessible, performant image carousel with swipe, autoplay, lazy loading and responsive images.

System Design
Medium
45 min

226.Micro-Frontend Platform

Design a platform that lets many teams build, deploy and compose independently released front-ends into one coherent product.

System Design
Hard
60 min

227.Modal Dialog Component

Design an accessible modal dialog: native dialog vs custom, focus trapping, scroll locking, stacking and API.

System Design
Medium
40 min

228.Music Streaming Web Player (e.g. Spotify)

Design a music web app with uninterrupted playback across navigation, a queue, gapless streaming, DRM and multi-device control.

System Design
Hard
45 min

229.News Feed (e.g. Facebook)

Design an infinitely scrolling, personalised social feed with posts, reactions, comments and live updates.

System Design
Medium
45 min

230.Photo Sharing App (e.g. Instagram)

Design a photo-first social app: image feed, profile grid, upload with client-side processing, and likes and comments.

System Design
Medium
45 min

231.Pinterest (Masonry Image Feed)

Design a Pinterest-style home feed: a responsive masonry grid of variable-height pins with infinite scroll and virtualization.

System Design
Hard
45 min

232.Embeddable Poll Widget

Design a poll widget embeddable on many sites, with voting, live results, abuse prevention and isolation.

System Design
Medium
40 min

233.Real-Time Collaborative Whiteboard

Design a Miro/FigJam-style multiplayer whiteboard: canvas rendering at scale, CRDT-based sync, presence, offline, permissions and the multiplayer service.

System Design
Hard
60 min

234.Rich Text Editor Component

Design a reusable rich text editor: document model vs contenteditable, transactions, plugins, paste, IME and accessibility.

System Design
Hard
45 min

235.Travel Booking Site (e.g. Airbnb)

Design a stays marketplace: search with map and date range, listing details, availability calendar and a reliable booking flow.

System Design
Hard
45 min

236.Video Conferencing App (e.g. Zoom, Google Meet)

Design a browser video meeting app with WebRTC, an SFU, simulcast, adaptive layouts, screen sharing and chat.

System Design
Hard
60 min

237.Video Streaming Service (e.g. Netflix)

Design a Netflix-style web client: browse rows of titles, a video player with adaptive bitrate streaming, DRM, and resume playback.

System Design
Hard
45 min

238.Org-Wide Web Performance Program (Core Web Vitals)

Design an organisation-wide web performance program: CWV measurement, budgets, CI gates, ownership, tooling and the roadmap to pass Core Web Vitals across many apps.

System Design
Hard
50 min

More interview questions

React Interview QuestionsJavaScript Interview QuestionsTypeScript Interview QuestionsCSS Interview QuestionsHTML Interview QuestionsLead Frontend Engineer Interview QuestionsQuestions by topic