Hard frontend interview questions
110 questions at hard difficulty. Build the muscle for real frontend interviews with a runnable editor and explained solutions.
110 questions
- UI / FrameworksUI challenge4 variants
Accordion III
HARDBuild a fully accessible accordion with keyboard navigation per the ARIA authoring practices guide.
40 minAmazonPractice - JavaScriptCoding exercise
Async Event Emitter
HARDBuild an emitter whose emit awaits async listeners, with once, off, and serial or parallel dispatch.
40 minPremium questionPractice - JavaScriptCoding exercise
async parallel / series
HARDImplement Node-style async runners — run error-first tasks in parallel or in series and collect their results.
40 minPremium questionPractice - JavaScriptCoding exercise
Async Read-Write Lock
HARDImplement a read-write lock that allows many concurrent readers or one exclusive writer without starving writers.
40 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Auth Code Input
HARDBuild a six-cell auth code input that handles typing, paste, backspace, and arrow-key navigation across fields.
40 minPremium questionApplePractice - UI / FrameworksUI challenge4 variants
Autocomplete III
HARDBuild a production autocomplete with async fetch, debounce, keyboard navigation, caching, and match highlighting.
40 minPremium questionPractice - JavaScriptCoding exercise
Backbone Model
HARDImplement a Backbone-style Model class that stores attributes and emits change events per key.
40 minAirbnbPractice - AlgorithmsCoding exercise
Binary Search Tree
HARDBuild a binary search tree with insert, search, and delete operations preserving the BST invariant.
40 minPremium questionPractice - AlgorithmsCoding exercise
Binary Tree Maximum Total Path
HARDImplement a function that returns the maximum sum of node values along any path in a binary tree.
40 minPremium questionPractice - AlgorithmsCoding exercise
Binary Tree Serialization and Deserialization
HARDImplement functions that convert a binary tree to a string and reconstruct the same tree back from that string.
40 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Calendar Scheduler
HARDBuild an accessible week-view scheduler with add/remove controls, live announcements, and spatial keyboard navigation.
75 minPremium questionPractice - JavaScriptCoding exercise
classNames II
HARDExtend the classNames utility to dedupe class names and resolve function arguments lazily.
40 minPractice - JavaScriptCoding exercise
Cooperative Scheduler
HARDRun a queue of tasks in time slices, yielding control between them so the main thread stays responsive.
40 minPremium questionPractice - JavaScriptCoding exercise
Curry III
HARDImplement a curry helper that turns a variadic function into one that can be called repeatedly with any number of arguments.
40 minPremium questionQualcommPractice - JavaScriptCoding exercise
Data Selection
HARDImplement a function that filters an array of row objects by a flexible field-and-condition specification.
40 minAmazon · Meta · OpenAI +3Practice - UI / FrameworksUI challenge4 variants
Data Table III
HARDBuild a generic, reusable data table that supports column-driven sorting and pagination for any dataset.
40 minAmazon · Palantir · StripePractice - UI / FrameworksUI challenge4 variants
Data Table IV
HARDBuild a generalized data table component that supports pagination, column sorting, and per-column filtering.
40 minAmazon · Databricks · Palantir +7Practice - UI / FrameworksUI challenge4 variants
Data Table V
HARDBuild a data table with sortable columns, pagination, and row selection over a dataset.
40 minPremium questionPractice - JavaScriptCoding exercise
DataLoader
HARDBatch and cache load(key) calls made in one tick into a single batch function call, preserving order.
40 minPremium questionPractice - JavaScriptCoding exercise
Deep Clone II
HARDImplement a deep clone that copies nested values and correctly handles circular references using a visited map.
40 minByteDance · TikTokPractice - JavaScriptCoding exercise
Deep Equal
HARDImplement a function that determines whether two values are structurally equal across nested objects and arrays.
40 minGooglePractice - AlgorithmsCoding exercise
Dijkstra's Algorithm
HARDImplement Dijkstra's algorithm to compute shortest paths from a source vertex in a weighted graph.
40 minPremium questionPractice - JavaScriptCoding exercise
Drag & Drop Sortable
HARDReorder a list by pointer drag, computing the target index from the cursor over item midpoints.
40 minPremium questionPractice - JavaScriptCoding exercise
Drizzle Query Builder
HARDBuild an in-memory query builder inspired by Drizzle with table helpers, filters, sorting, and pagination.
40 minPremium questionPractice - JavaScriptCoding exercise
Drizzle Query Builder II
HARDExtend an in-memory query builder inspired by Drizzle with select projections and column aliases.
40 minPremium questionPractice - JavaScriptCoding exercise
Drizzle Query Builder III
HARDExtend an in-memory query builder inspired by Drizzle with innerJoin and leftJoin between related tables.
40 minPremium questionPractice - AlgorithmsCoding exercise
Extraterrestrial Language
HARDGiven words sorted in an unknown alphabet's order, reconstruct the alphabet.
40 minAirbnb · Facebook · GooglePractice - AlgorithmsCoding exercise
Fenwick Tree (Binary Indexed Tree)
HARDBuild a Fenwick tree for logarithmic prefix-sum queries and point updates, using the lowest-set-bit trick to walk responsibility ranges.
40 minPremium questionPractice - AlgorithmsCoding exercise
Find Words in Grid
HARDImplement a function that returns every word from a dictionary that can be traced through adjacent cells in a grid.
40 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Gantt Chart
HARDBuild a Gantt chart that renders tasks as bars positioned across a timeline by start and duration.
40 minPremium questionPractice - JavaScriptCoding exercise
getElementsByTagNameHierarchy
HARDImplement a function that finds all DOM elements matching an ancestor-to-descendant tag-name hierarchy.
40 minDropbox · GooglePractice - AlgorithmsCoding exercise
Heap
HARDImplement a binary heap data structure supporting push, pop, peek, and heapify with the standard ordering invariant.
40 minPremium questionPractice - AlgorithmsCoding exercise
Heap Sort
HARDImplement heap sort by building a max-heap and repeatedly extracting the largest element.
40 minPremium questionPractice - JavaScriptCoding exercise
HTML Tokenizer & Parser
HARDTokenize an HTML string and build a nested node tree, handling attributes, void, and nested tags.
40 minPremium questionPractice - JavaScriptCoding exercise
Idle Task Scheduler
HARDRun a queue of tasks in time-sliced batches, yielding between slices to keep the frame responsive.
40 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Image Carousel III
HARDBuild an image carousel that smoothly transitions between images while keeping the DOM footprint minimal.
40 minAirbnb · Amazon · ByteDance +7Practice - UI / FrameworksUI challenge4 variants
Image Cropper
HARDBuild an image cropper with a draggable, resizable crop region over an image.
40 minPremium questionPractice - JavaScriptCoding exercise
Immer produce()
HARDImplement produce so mutating a draft proxy yields a new immutable state with structural sharing.
40 minPremium questionPractice - JavaScriptCoding exercise
Integer to English Words
HARDSpell out a non-negative integer in English words — break it into groups of three digits and name each group with its scale word.
40 minPremium questionPractice - JavaScriptCoding exercise
JSON.parse
HARDImplement JSON.parse — a recursive-descent parser that turns a JSON string into the corresponding JavaScript value.
40 minAmazon · Google · Microsoft +1Practice - JavaScriptCoding exercise
JSON.stringify II
HARDImplement JSON.stringify with full spec support including replacer, indentation, and circular reference detection.
40 minAmazon · Google · Netflix +1Practice - JavaScriptCoding exercise
Keyed DOM Reconcile
HARDReconcile two keyed child lists into a minimal set of DOM inserts, moves, and removals.
40 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Lazy Tree View
HARDBuild a collapsible tree that lazily loads a node's children the first time it is expanded.
40 minPremium questionPractice - AlgorithmsCoding exercise
Linked Lists Combine K Sorted
HARDMerge k pre-sorted singly-linked lists into one sorted list in O(n log k) time.
40 minPremium questionAmazon · Google · MetaPractice - JavaScriptCoding exercise
Lowest Hiding Element
HARDImplement a function that finds the deepest common ancestor whose hiding would conceal every target element.
40 minPremium questionPractice - JavaScriptCoding exercise
Map Async Limit
HARDImplement an async map that processes an array with a bounded number of in-flight tasks.
40 minAdobe · Anthropic · Apple +7Practice - AlgorithmsCoding exercise
Median of Two Sorted Arrays
HARDFind the median of two sorted arrays in logarithmic time by binary-searching for the partition that splits all the elements into equal halves.
40 minPremium questionPractice - JavaScriptCoding exercise
Middlewares
HARDImplement an async middleware composer that chains functions Koa-style, threading a shared context through next.
40 minByteDance · TikTokPractice - UI / FrameworksUI challenge4 variants
Minesweeper
HARDBuild Minesweeper with flood-fill reveal, flagging, and win/lose detection.
40 minPremium questionPractice - JavaScriptCoding exercise
Mini MobX
HARDBuild MobX-style observables with autorun and computed that re-run when the data they read changes.
40 minPremium questionPractice - JavaScriptCoding exercise
Mini Object-relational Mapper III
HARDBuild a simplified in-memory ORM with field selection and eagerly included related records.
40 minPremium questionOpenAIPractice - JavaScriptCoding exercise
Mini React Query Core
HARDBuild a framework-agnostic query cache with request dedup, staleTime, subscribers, and invalidation.
40 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Modal Dialog IV
HARDBuild a fully accessible modal dialog with focus trapping, focus restoration, and keyboard support.
40 minPremium questionAmazon · TikTokPractice - AlgorithmsCoding exercise
N-Queens
HARDPlace N queens on an N×N board so none attack another — a classic backtracking search that places one queen per row and prunes column and diagonal conflicts.
40 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Nested Checkboxes
HARDBuild a nested checkbox tree where parent state reflects its children and toggling a parent cascades down.
40 minGoogle · MetaPractice - AlgorithmsCoding exercise
Number Stream Median
HARDImplement a data structure that ingests integers one at a time and reports the running median in logarithmic time.
40 minPremium questionPractice - JavaScriptCoding exercise
Observable
HARDImplement a minimal Observable with subscribe/unsubscribe and of/from plus map and filter operators.
40 minPractice - JavaScriptCoding exercise
Operational Transform (Text)
HARDTransform concurrent insert and delete operations so replicas converge to the same text.
40 minPremium questionPractice - JavaScriptCoding exercise
Optimistic Mutation Manager
HARDApply optimistic updates immediately and roll them back on failure, even with concurrent mutations.
40 minPremium questionPractice - JavaScriptCoding exercise
Partial JSON Parser
HARDParse a truncated JSON string into the best-valid value so far by completing open strings and containers.
40 minPremium questionPractice - AlgorithmsCoding exercise
Persistent Immutable List
HARDBuild an immutable list where every update returns a new version that shares unchanged nodes with the old one — structural sharing over a cons list.
40 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Progress Bars IV
HARDBuild progress bars that fill concurrently up to three at a time, and let the user pause and resume each one.
40 minPremium questionUberPractice - JavaScriptCoding exercise
Reactive Proxy Signals
HARDBuild reactive state with a Proxy that tracks reads and re-runs registered effects on write.
40 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Realtime Search with Cache
HARDBuild a search box that caches results per query and dedupes in-flight requests.
40 minPremium questionPractice - JavaScriptCoding exercise
Redux-Saga Effect Runner
HARDBuild a redux-saga-style interpreter that runs a generator of declarative effects and resumes it with each result.
50 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Rich Text Editor
HARDBuild a contenteditable rich-text editor with bold/italic/list formatting and a live toolbar state.
40 minPremium questionPractice - JavaScriptCoding exercise
Rich Text to HTML
HARDImplement a function that converts a list of styled text ranges into a canonical, properly nested HTML string.
40 minPremium questionMetaPractice - JavaScriptCoding exercise
RxJS-Lite Pipeable Operators
HARDBuild a mini reactive-streams library: a cold Observable and pipeable operators composed with a .pipe() chain.
50 minPremium questionPractice - JavaScriptCoding exercise
Schema Validator III
HARDExtend a tiny schema validator to handle nested object and array shapes plus optional fields.
40 minPremium questionPractice - AlgorithmsCoding exercise
Segment Tree
HARDBuild a segment tree over an array for logarithmic range-sum queries and point updates, each tree node holding the aggregate of its slice.
40 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Selectable Cells
HARDBuild a grid where you click and drag across cells to select a rectangular range of them.
40 minPremium questionPractice - JavaScriptCoding exercise
Sequence CRDT (RGA)
HARDBuild a replicated growable array for text whose positional-id inserts and deletes converge across replicas.
40 minPremium questionPractice - AlgorithmsCoding exercise
Shortest Substring Containing Characters
HARDImplement a function that returns the smallest window of a string that contains every character of another string.
40 minPremium questionPractice - AlgorithmsCoding exercise
Skip List
HARDBuild a skip list — a sorted set layered with express lanes of linked lists so search, insert, and delete run in expected logarithmic time.
40 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Spreadsheet Grid
HARDBuild a grid of cells with formula evaluation and dependent-cell recalculation.
40 minPremium questionPractice - JavaScriptCoding exercise
Spreadsheet III
HARDBuild a spreadsheet that recomputes dependent cells when inputs change and detects circular references.
40 minPremium questionDiscord · OpenAIPractice - JavaScriptCoding exercise
Statechart Engine (XState-lite)
HARDBuild a state-machine engine with events, guards, entry and exit actions, and context updates.
40 minPremium questionPractice - JavaScriptCoding exercise
Streaming Markdown State Machine
HARDRender markdown-so-far to HTML, holding and closing unclosed bold, inline code, and fenced code blocks.
40 minPremium questionPractice - JavaScriptCoding exercise
structuredClone
HARDImplement structuredClone — deep-clone a value including Map, Set, Date, RegExp, typed arrays, and circular references.
40 minPremium questionPractice - JavaScriptCoding exercise
Styled Text Ranges
HARDImplement a slice operation over text annotated with overlapping style ranges, preserving alignment.
40 minPremium questionFigmaPractice - JavaScriptCoding exercise
Styled Text Ranges III
HARDImplement a function that replaces a text range and keeps the surrounding style ranges normalized.
40 minPremium questionFigmaPractice - JavaScriptCoding exercise
Styled Text Ranges IV
HARDImplement a function that patches shallow style objects over a text range without clobbering unrelated keys.
40 minPremium questionFigmaPractice - AlgorithmsCoding exercise
Sudoku Solver
HARDFill a 9×9 Sudoku grid by backtracking — try each digit in the next empty cell, checking its row, column, and 3×3 box, and undo on a dead end.
40 minPremium questionPractice - JavaScriptCoding exercise
Superjson
HARDImplement serialize and deserialize helpers that round-trip values like Date, Map, Set, and BigInt through JSON.
40 minAnthropic · OpenAIPractice - JavaScriptCoding exercise
Superjson II
HARDBuild serialize and deserialize that preserve referential identity — shared references and circular structures round-trip intact.
40 minPremium questionAnthropic · OpenAIPractice - JavaScriptCoding exercise
Table of Contents
HARDImplement a function that walks an HTML document's headings and builds a nested table of contents.
40 minGooglePractice - UI / FrameworksUI challenge4 variants
Tabs III
HARDBuild a fully accessible tabs component with arrow-key navigation per the ARIA authoring guide.
40 minAirbnb · AmazonPractice - JavaScriptCoding exercise
Test Runner IV
HARDExtend a tiny test runner so it correctly awaits asynchronous specs and asynchronous setup or cleanup hooks.
40 minPremium questionMetaPractice - UI / FrameworksUI challenge4 variants
Tetris
HARDBuild Tetris with falling tetrominoes, rotation, line clears, and scoring.
40 minPremium questionPractice - JavaScriptCoding exercise
Text Between Nodes
HARDImplement a function that gathers the text content lying between two DOM nodes in document order.
40 minPremium questionMetaPractice - UI / FrameworksUI challenge4 variants
Tic-tac-toe II
HARDBuild a generalized tic-tac-toe game on an N x N board where M consecutive marks wins.
40 minAmazon · Apollo · Apple +4Practice - JavaScriptCoding exercise
Tooltip Positioning Engine
HARDCompute a tooltip's position around an anchor, flipping and shifting to stay inside the viewport.
40 minPremium questionPractice - AlgorithmsCoding exercise
Topological Sort
HARDImplement a function that returns a topological ordering of nodes in a directed acyclic graph.
40 minPremium questionSnapPractice - UI / FrameworksUI challenge4 variants
Transfer List II
HARDBuild a transfer list with bulk select, deselect, and the ability to add new items to either side.
40 minTikTokPractice - JavaScriptCoding exercise
Undo / Redo Manager II
HARDBuild a class that tracks draft values and commits them as batch checkpoints for undo and redo navigation.
40 minAnthropic · FigmaPractice - JavaScriptCoding exercise
Undoable Database II
HARDBuild a user database that buffers draft mutations and commits them as batch undo and redo checkpoints.
40 minAnthropic · FigmaPractice - JavaScriptCoding exercise
useDebouncedCallback
HARDImplement a hook returning a debounced callback with cancel and flush, always calling the latest function.
40 minPremium questionPractice - JavaScriptCoding exercise
useDraggable
HARDImplement a pointer-based drag hook that tracks an element's x/y offset with start/move/end handlers.
40 minPremium questionPractice - JavaScriptCoding exercise
useForm
HARDImplement a form-state hook managing values, touched, errors, validation, and submission.
40 minPremium questionPractice - JavaScriptCoding exercise
useInfiniteScroll
HARDImplement a hook that loads more pages when a sentinel element scrolls into view, guarding against duplicate loads.
40 minPremium questionPractice - JavaScriptCoding exercise
useResizeObserver
HARDImplement a hook that reports a ref'd element's content-box size via ResizeObserver.
40 minPremium questionPractice - JavaScriptCoding exercise
useSWR
HARDImplement a stale-while-revalidate data hook with an in-memory cache, dedup, and revalidation shared across components.
40 minPremium questionPractice - JavaScriptCoding exercise
useThrottledCallback
HARDImplement a hook returning a throttled version of a callback that runs at most once per interval, with leading/trailing calls.
40 minPremium questionPractice - JavaScriptCoding exercise
useUndoRedo
HARDImplement an undo/redo state hook exposing undo, redo, canUndo, canRedo over past/present/future stacks.
40 minPremium questionPractice - JavaScriptCoding exercise
useVirtualList
HARDImplement a windowing hook that renders only the visible rows of a long list, with correct spacer offsets.
40 minPremium questionPractice - JavaScriptCoding exercise
useWebSocket
HARDImplement a WebSocket hook exposing connection status, last message, and send, with auto-reconnect and cleanup.
40 minPremium questionPractice - JavaScriptCoding exercise
Virtual Scroll List
HARDCompute the visible slice and spacer offsets to render only on-screen rows of a huge list.
40 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Virtualized List
HARDBuild a windowed list that renders only the visible rows of a large dataset for smooth scrolling.
40 minPremium questionMeta · TekionPractice - AlgorithmsCoding exercise
Wildcard Matching
HARDDecide whether a string matches a pattern containing `?` (any single character) and `*` (any sequence) — a two-dimensional dynamic-programming match over string and pattern.
40 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Wordle
HARDBuild the Wordle word-guessing game with row-by-row guesses and per-letter color feedback.
40 minRamp · TekionPractice