Questions
Search and filter 640 frontend interview questions.
- EASY
Array findLast / findLastIndex
Implement findLast and findLastIndex — scan an array from the end for the last element matching a predicate.
15 minJavaScript - EASY
Array.prototype.at
Implement Array.prototype.myAt — return the element at a given index, supporting negative offsets from the end.
15 minJavaScript - EASY
Array.prototype.every
Implement Array.prototype.every — return false as soon as an element fails the predicate, true when empty.
15 minJavaScript - EASY
Array.prototype.filter
Implement Array.prototype.filter from scratch as a method on the array prototype.
15 minJavaScript - EASY
Array.prototype.flat
Implement Array.prototype.flat — flatten nested arrays to a given depth (default 1, Infinity for all levels), dropping holes.
15 minJavaScript - EASY
Array.prototype.forEach
Implement Array.prototype.forEach — run a callback on each element as (value, index, array), skipping sparse holes.
15 minJavaScript - EASY
Array.prototype.includes
Implement Array.prototype.includes — test membership with SameValueZero so NaN matches, honoring negative fromIndex.
15 minJavaScript - EASY
Array.prototype.indexOf
Implement Array.prototype.indexOf — first index of a value by strict equality, supporting a negative fromIndex.
15 minJavaScript - EASY
Array.prototype.some
Implement Array.prototype.some — return true as soon as any element passes the predicate, false when empty.
15 minJavaScript - EASY
Array.prototype.square
Implement a custom Array.prototype.square method that returns a new array with each value squared.
15 minJavaScript - EASY
Chunk
Implement a function that splits an array into groups of a given size, with the last group holding the remainder.
15 minJavaScript - EASY
Clamp
Implement a function that constrains a number to lie within an inclusive minimum and maximum range.
15 minJavaScript - EASY
Compact
Implement a function that returns a new array with every falsy value stripped out.
15 minJavaScript - EASY
Data Merging
Implement a function that consolidates rows sharing the same user into a single grouped record.
15 minJavaScript - EASY
Difference
Implement a function that returns the elements from the first array that do not appear in the second.
15 minJavaScript - EASY
Drop Right While
Implement a function that drops trailing array elements as long as a predicate keeps returning truthy.
15 minJavaScript - EASY
Drop While
Implement a function that drops leading array elements as long as a predicate keeps returning truthy.
15 minJavaScript - EASY
Fill
Implement a function that replaces array elements with a given value between an optional start and end index.
15 minJavaScript - EASY
Find Duplicates in Array
Implement a function that checks whether an array contains any duplicate numbers.
15 minAlgorithms - EASY
Find Index
Implement a function that returns the index of the first array element matching a predicate, or -1 if none match.
15 minJavaScript - EASY
Find Last Index
Implement a function that returns the index of the last array element matching a predicate, or -1 if none match.
15 minJavaScript - EASY
Find Missing Number in Sequence
Implement a function that returns the single missing number from a sorted sequence of integers.
15 minAlgorithms - EASY
First Bad Version
Find the first failing version among 1..n where a monotonic isBad check flips from false to true — a boundary binary search using the fewest checks.
15 minAlgorithms - EASY
From Pairs
Implement a function that builds an object from an array of [key, value] pair tuples.
15 minJavaScript - EASY
In Range
Implement a function that checks whether a number lies within a half-open range, swapping bounds when needed.
15 minJavaScript - EASY
Intersection
Implement a function that returns the unique values present in every input array.
15 minJavaScript - EASY
Key By
Implement lodash keyBy — index a collection into an object keyed by an iteratee's return, keeping the last item for each key.
15 minJavaScript - EASY
List Format
Implement a function that joins an array of strings into a grammatical list with commas and a conjunction.
15 minJavaScript - EASY
Map.groupBy
Implement Map.groupBy — group an iterable into a Map whose keys can be any value, preserving key insertion order.
15 minJavaScript - EASY
Max By
Implement a function that returns the array element producing the largest value when run through an iteratee.
15 minJavaScript - EASY
Mean
Implement a function that computes the arithmetic mean of the numbers in an array.
15 minJavaScript - EASY
Min By
Implement a function that returns the array element producing the smallest value when run through an iteratee.
15 minJavaScript - EASY
nth
Implement nth — return the element at index n, counting from the end when n is negative, so head is nth(0) and last is nth(-1).
15 minJavaScript - EASY
Optimal Stock Trading
Implement a function that computes the maximum profit obtainable from one buy and one sell of a stock.
15 minAlgorithms - EASY
Pair Sum
Implement a function that finds two numbers in an array that add up to a given target.
15 minAlgorithms - EASY
Range
Implement a function that builds an array of numbers from start up to end, stepping by a given increment.
15 minJavaScript - EASY
Range Right
Implement a function that builds an array of numbers from end down to start in descending order.
15 minJavaScript - EASY
String.prototype.repeat
Implement String.prototype.repeat — join a string n times, throwing RangeError on a negative or infinite count.
15 minJavaScript - EASY
Sum By / Mean By
Implement lodash sumBy and meanBy — total and average an array by an iteratee that maps each element to a number.
15 minJavaScript - EASY
takeWhile
Implement take and takeWhile — grab the leading n elements, or the leading run that satisfies a predicate.
15 minJavaScript - EASY
Text Search
Implement a function that wraps occurrences of a search term within a string in highlight markup.
15 minJavaScript - EASY
times
Implement times — invoke a function n times and collect the results into an array.
15 minJavaScript - EASY
Unique Array
Implement a function that returns a new array with duplicate values removed while preserving original order.
15 minJavaScript - EASY
without
Implement without — return a copy of an array with the given values excluded, matched by SameValueZero.
15 minJavaScript - EASY
Array XOR (Symmetric Difference)
Implement lodash xor — return the values that appear in exactly one of the given arrays, with duplicates removed.
20 minJavaScript - EASY
Move Zeroes
Move all zeroes to the end of an array in place while keeping the non-zero elements in their original order.
20 minAlgorithmsMeta · Google - EASY
Cancellable Interval
Implement a setInterval wrapper that returns a function which stops the interval when invoked.
15 minJavaScript - EASY
Cancellable Timeout
Implement a setTimeout wrapper that returns a function you can call to cancel the pending callback.
15 minJavaScript - EASY
Compose
Implement a function that composes functions right-to-left so the output of each feeds into the next.
15 minJavaScript - EASY
Cycle
Implement a function that, given several values, returns a function that yields each one in turn and loops forever.
15 minJavaScript - EASY
Debounce
Implement a function that delays invoking another function until a specified period of inactivity has passed.
15 minJavaScriptGoogle · Amazon · Meta - EASY
Make Counter
Implement a factory that takes a starting integer and returns a function that returns the next value on each call.
15 minJavaScript - EASY
Number of Arguments
Implement a function that returns the count of arguments passed to it at call time.
15 minJavaScript - EASY
Once
Implement a function that wraps a callback so it runs at most one time and reuses that result thereafter.
15 minJavaScript - EASY
Promise Waterfall
Run async tasks in sequence, feeding each result into the next, stopping the chain on the first rejection.
15 minJavaScript - EASY
Sleep
Implement a function that returns a promise resolving after the specified number of milliseconds.
15 minJavaScript - EASY
Sliding TTL Cache
Implement a cache whose entries expire a fixed time after their last access, not after being set.
15 minJavaScript - EASY
Typewriter Pacer
Buffer bursty streamed text and emit it one character at a time at a steady cadence, with flush and stop controls.
18 minJavaScript - MEDIUM
Throttle
Implement a function that limits how often a wrapped function can be invoked within a time window.
15 minJavaScriptGoogle · Amazon · Meta - MEDIUM
Array.prototype.myReduce
PREMIUMImplement Array.prototype.myReduce — the reduce method from scratch, including the empty-array + initial-value edge cases.
20 minJavaScriptGoogle · Meta · Amazon - MEDIUM
Analytics Event SDK
PREMIUMBuild an analytics client that queues tracked events, flushes them in batches, and retries failed sends with backoff.
25 minJavaScript - MEDIUM
Async Debounce (Latest Wins)
Implement an async debounce that resolves only the newest call and discards the results of superseded ones.
25 minJavaScript - MEDIUM
Async Memoize with TTL
Implement an async memoize that caches results by key for a TTL and coalesces concurrent calls for the same key.
25 minJavaScript - MEDIUM
Batch Event Flusher
Buffer events and flush them in batches when a size threshold or a max-wait timer is reached.
25 minJavaScript - MEDIUM
before / after
Implement before and after — cap how many times a function runs, or delay invoking it until the Nth call.
25 minJavaScript - MEDIUM
Class Variance Authority
Implement a simplified cva that builds class names from base styles, variant tables, and default values.
25 minJavaScript - MEDIUM
Console Log History
Implement a wrapper that intercepts console.log calls and records their arguments for later inspection.
25 minJavaScript - MEDIUM
Curry
Implement a function that transforms a multi-argument function into a chain of single-argument calls.
25 minJavaScript - MEDIUM
Curry II
Implement a flexible curry where each call can supply any number of arguments until the original arity is reached.
25 minJavaScript - MEDIUM
Debounce II
PREMIUMExtend debounce with cancel and flush methods to abort or immediately invoke pending calls.
25 minJavaScript - MEDIUM
Debounce III
PREMIUMExtend debounce with a maxWait option that forces a call after a maximum delay even under constant activity.
25 minJavaScript - MEDIUM
Dependency Injection Container
Build a DI container that resolves a service dependency graph, caches singletons, and detects circular dependencies.
25 minJavaScriptGoogle · Microsoft · Uber - MEDIUM
Distinct Paths in Grid
Implement a function that counts the number of unique paths a robot can take from the top-left to bottom-right of an m by n grid.
25 minAlgorithms - MEDIUM
flow
Implement flow — compose functions left to right so each output feeds the next.
25 minJavaScript - MEDIUM
Function.prototype.bind
PREMIUMImplement Function.prototype.myBind — return a new function with a fixed `this` and optional preset arguments.
25 minJavaScript - MEDIUM
HTTP Client Interceptors
PREMIUMBuild an axios-style client whose request and response interceptors transform each call as it passes through the chain.
25 minJavaScript - MEDIUM
Limit
Implement a function that wraps a callback so it runs at most N times and returns the last result thereafter.
25 minJavaScript - MEDIUM
Make Counter II
Implement a factory that returns a counter object with methods to read, increment, decrement, and reset its value.
25 minJavaScript - MEDIUM
Memoize
Implement a function that caches results of a single-argument function so repeat calls return instantly.
25 minJavaScript - MEDIUM
Memoize II
PREMIUMImplement a memoize helper that caches results for functions called with any number and type of arguments.
25 minJavaScript - MEDIUM
Memoize III
PREMIUMExtend memoize with a custom key resolver and cache controls (.clear() and .delete(key)).
25 minJavaScript - MEDIUM
Mini Jotai Atoms
Build atom-based state with primitive and derived atoms that recompute and notify subscribers on change.
25 minJavaScript - MEDIUM
Mini Redux
PREMIUMBuild a Redux core with createStore, combineReducers, and applyMiddleware over a subscribe/dispatch loop.
25 minJavaScript - MEDIUM
negate / overEvery
Implement negate, overEvery, and overSome — build new predicates by combining existing ones.
25 minJavaScript - MEDIUM
partial
Implement partial and partialRight — pre-fill some of a function's arguments, with placeholder support.
25 minJavaScript - MEDIUM
Promise Merge
Implement a function that combines the results of two promises into a single value using a merger function.
25 minJavaScript - MEDIUM
Promise Timeout
Implement a function that races a promise against a timer and rejects if the promise doesn't settle in time.
25 minJavaScript - MEDIUM
Promisify
PREMIUMImplement a function that wraps a Node-style error-first callback function so it returns a promise.
25 minJavaScript - MEDIUM
Promisify II
PREMIUMExtend promisify so the wrapped function can override the resolved value via a custom override hook.
25 minJavaScript - MEDIUM
Rate Limiter
Implement a sliding-window rate limiter that decides which task timestamps fit within the allowed quota.
25 minJavaScript - MEDIUM
Redux Middleware (Thunk + Logger)
PREMIUMImplement the curried Redux middleware chain with working thunk and logger middleware.
25 minJavaScript - MEDIUM
Reselect Selectors
PREMIUMBuild memoized selectors that recompute only when their input selections change by reference.
25 minJavaScript - MEDIUM
Resilient Fetch Wrapper
Wrap an async call with retries, backoff, and a per-attempt timeout so transient failures recover.
25 minJavaScript - MEDIUM
Resumable Interval
Implement an interval helper that exposes start, pause, and resume controls while preserving elapsed progress.
25 minJavaScript - MEDIUM
Schema Validator
Implement a small schema library that validates primitives and flat object shapes with composable rules.
25 minJavaScript - MEDIUM
Schema Validator II
Build a tiny schema validation library that supports chainable min and max rules on primitive types.
25 minJavaScript - MEDIUM
Segment Words
Implement a function that decides whether a string can be broken into a sequence of words from a given dictionary.
25 minAlgorithmsAmazon · Google · Meta - MEDIUM
Signals (signal / computed / effect)
PREMIUMBuild reactive signals with automatic dependency tracking so computed values and effects update on change.
25 minJavaScript - MEDIUM
Singleton
Implement a Singleton class that always hands back the same instance no matter how many times you construct it.
25 minJavaScript - MEDIUM
Stale-While-Revalidate Cache
PREMIUMReturn cached data instantly, serving stale values while revalidating them in the background.
25 minJavaScript - MEDIUM
Sum
Implement a curried sum function that accepts numbers one call at a time and returns the running total when invoked with none.
25 minJavaScript - MEDIUM
Test Runner II
Build a small test runner that supports nested describe suites and reports tests with their full spec names.
25 minJavaScript - MEDIUM
Test Runner III
Extend a tiny test runner with beforeEach and afterEach hooks that are inherited from outer suites.
25 minJavaScript - MEDIUM
Throttle II
PREMIUMExtend throttle with cancel and flush methods plus leading and trailing edge options.
25 minJavaScript - MEDIUM
Form Validation Engine
Build a schema-driven form validator with composable per-field rules, cross-field checks, and async validators that report all errors.
30 minJavaScriptStripe · Atlassian · Airbnb - MEDIUM
Curry IV
PREMIUMExtend curry with placeholder support, so arguments can be supplied in any position across calls.
40 minJavaScript - HARD
Cooperative Scheduler
Run a queue of tasks in time slices, yielding control between them so the main thread stays responsive.
40 minJavaScript - HARD
Curry III
PREMIUMImplement a curry helper that turns a variadic function into one that can be called repeatedly with any number of arguments.
40 minJavaScript - HARD
Drizzle Query Builder
PREMIUMBuild an in-memory query builder inspired by Drizzle with table helpers, filters, sorting, and pagination.
40 minJavaScript - HARD
Drizzle Query Builder II
PREMIUMExtend an in-memory query builder inspired by Drizzle with select projections and column aliases.
40 minJavaScript - HARD
Map Async Limit
PREMIUMImplement an async map that processes an array with a bounded number of in-flight tasks.
40 minJavaScript - HARD
Middlewares
PREMIUMImplement an async middleware composer that chains functions Koa-style, threading a shared context through next.
40 minJavaScript - MEDIUM
Array Product Excluding Current
Return an array where each entry is the product of every element except the one at that index, without division and in O(n).
25 minAlgorithmsAmazon · Meta · Microsoft - MEDIUM
Array.prototype.concat
Implement Array.prototype.myConcat — merge arrays and values into a new array, spreading nested arrays one level deep.
25 minJavaScript - MEDIUM
Array.prototype.find
Implement Array.prototype.find and findLast — return the first or last element matching a predicate, or undefined.
25 minJavaScript - MEDIUM
Array.prototype.flatMap
Implement Array.prototype.flatMap — map each element, then flatten the mapped results by one level.
25 minJavaScript - MEDIUM
Array.prototype.map
PREMIUMImplement Array.prototype.myMap — return a new array with the callback applied to each element, skipping holes.
25 minJavaScript - MEDIUM
Array.prototype.reduce
PREMIUMImplement Array.prototype.myReduce — fold an array down to one value, handling sparse arrays and missing initial values.
25 minJavaScript - MEDIUM
Array.prototype.reduceRight
Implement Array.prototype.reduceRight — fold an array right-to-left, throwing on an empty array with no initial value.
25 minJavaScript - MEDIUM
Array.prototype.splice
Implement Array.prototype.splice — remove and insert elements in place, returning the removed ones, with clamped indices.
25 minJavaScript - MEDIUM
classNames
Implement a utility that conditionally joins class name arguments into a single space-separated string.
25 minJavaScript - MEDIUM
Count By
Implement a function that tallies how many array elements map to each key produced by an iteratee.
25 minJavaScript - MEDIUM
Deep Freeze
Recursively freeze an object and every nested object and array, making the whole structure deeply immutable.
25 minJavaScript - MEDIUM
Find Element in Rotated Array
Implement a function that locates a target integer in a sorted array that has been rotated at an unknown pivot.
25 minAlgorithms - MEDIUM
Flatten
Implement a function that recursively flattens a nested array into a single-level array.
25 minJavaScript - MEDIUM
Function.prototype.apply
Implement Function.prototype.myApply — invoke the function with a given `this` and an array of arguments.
25 minJavaScript - MEDIUM
Group By
Implement a function that buckets array elements into an object keyed by the value an iteratee returns for each.
25 minJavaScript - MEDIUM
Intersection By
Implement a function that intersects arrays by comparing values produced by an iteratee, keeping uniqueness.
25 minJavaScript - MEDIUM
Intersection With
Implement a function that intersects arrays using a user-supplied comparator to decide equality between elements.
25 minJavaScript - MEDIUM
Matrix Rotation
Rotate an n×n matrix 90 degrees clockwise and return the result as a new array.
25 minAlgorithmsAmazon · Microsoft · Apple - MEDIUM
Maximum Product in Contiguous Array
Implement a function that finds the contiguous subarray with the largest product, handling negatives and zeros.
25 minAlgorithms - MEDIUM
Maximum Sum in Contiguous Array
Implement a function that finds the contiguous subarray with the largest sum.
25 minAlgorithms - MEDIUM
Maximum Water Trapped Between Walls
Implement a function that finds the maximum amount of water that can be trapped between two walls.
25 minAlgorithms - MEDIUM
orderBy
Implement orderBy — stably sort objects by multiple keys, each ascending or descending.
25 minJavaScript - MEDIUM
partition
Implement partition — split an array into elements that pass a predicate and those that fail, in one pass.
25 minJavaScript - MEDIUM
Partition Equal Subset Sum
Decide whether an array can split into two subsets with equal sums — a subset-sum dynamic-programming problem over half the total.
25 minAlgorithms - MEDIUM
Quickselect
PREMIUMFind the k-th smallest element of an unsorted array in average linear time by partitioning, without fully sorting it.
25 minAlgorithms - MEDIUM
Smallest Element in Rotated Sorted Array
Implement a function that finds the minimum value in a sorted array that has been rotated at an unknown pivot.
25 minAlgorithms - MEDIUM
Union By
Implement a function that returns unique values across input arrays using a custom iteratee to determine identity.
25 minJavaScript - MEDIUM
zip / unzip
Implement zip, unzip, and zipObject — interleave arrays into tuples and back, padding ragged lengths.
25 minJavaScript - MEDIUM
Immutable Array Methods
Implement the ES2023 change-by-copy trio — toSorted, toReversed, and with — that copy an array instead of mutating it.
30 minJavaScript - MEDIUM
Pull / PullAll
Implement lodash pull and pullAll — remove every occurrence of the given values from an array in place, mutating the original.
30 minJavaScript - MEDIUM
Shuffle / Sample Size
Implement lodash shuffle and sampleSize with an unbiased Fisher-Yates swap, taking an injectable RNG so shuffles are testable.
30 minJavaScript - HARD
classNames II
PREMIUMExtend the classNames utility to dedupe class names and resolve function arguments lazily.
40 minJavaScript - HARD
Data Selection
PREMIUMImplement a function that filters an array of row objects by a flexible field-and-condition specification.
40 minJavaScript - HARD
Median of Two Sorted Arrays
PREMIUMFind the median of two sorted arrays in logarithmic time by binary-searching for the partition that splits all the elements into equal halves.
40 minAlgorithms - EASY
Function Length
Implement a function that returns the number of declared parameters of a given function.
15 minJavaScript - EASY
Object Map
Implement a function that returns a new object with every value transformed by a mapper callback.
15 minJavaScript - EASY
Object.entries
Implement Object.entries — return an object's own enumerable string-keyed [key, value] pairs in insertion order.
15 minJavaScript - EASY
Object.fromEntries
Implement Object.fromEntries — build an object from any iterable of [key, value] pairs, with later keys winning.
15 minJavaScript - EASY
Size
Implement a function that returns the element count of any collection — array, string, object, Map, or Set.
15 minJavaScript - EASY
Type Utilities
Implement a set of helper functions that report the primitive type of any JavaScript value.
15 minJavaScript - MEDIUM
Is Empty
Implement a function that decides whether a value is empty across arrays, strings, objects, Maps, Sets, and primitives.
20 minJavaScript - MEDIUM
Camel Case Keys
Implement a function that returns a new object with every key converted to camelCase, recursing into nested objects.
25 minJavaScript - MEDIUM
Compact II
Implement a function that returns a deep copy of an object with all falsy values stripped from nested structures.
25 minJavaScript - MEDIUM
Conforms To
Implement a function that checks whether an object satisfies a source schema of predicate validators.
25 minJavaScript - MEDIUM
Deep Clone
PREMIUMImplement a function that recursively clones a JSON-serializable value without sharing references.
25 minJavaScript - MEDIUM
Deep Merge
PREMIUMImplement a function that recursively merges two objects, combining nested properties rather than overwriting them.
25 minJavaScript - MEDIUM
Deep Omit
PREMIUMImplement a function that returns a copy of a value with the given keys stripped from every nested object.
25 minJavaScript - MEDIUM
Event Emitter
Implement an EventEmitter class supporting on, off, and emit to register and trigger listeners.
25 minJavaScript - MEDIUM
Event Emitter II
PREMIUMImplement an event emitter where subscribe returns a handle whose release method removes that listener.
25 minJavaScript - MEDIUM
Function.prototype.call
Implement Function.prototype.myCall — invoke the function with a given `this` and a list of arguments.
25 minJavaScript - MEDIUM
Get
PREMIUMImplement a function that safely reads a nested object path and returns a default when any segment is missing.
25 minJavaScript - MEDIUM
get / set
Implement get and set — read and write a nested value by a path like 'a.b[0].c', creating missing containers on set.
25 minJavaScript - MEDIUM
invert
Implement invert and invertBy — swap an object's keys and values, grouping collisions with invertBy.
25 minJavaScript - MEDIUM
JSON.stringify
PREMIUMImplement a function that converts a JavaScript value into its JSON string representation.
25 minJavaScript - MEDIUM
localStorage With Expiry
Implement a localStorage wrapper that stores values with a TTL and returns null once an entry has expired.
25 minJavaScript - MEDIUM
mapKeys / mapValues
Implement mapKeys and mapValues — transform an object's keys or values while preserving its structure.
25 minJavaScript - MEDIUM
Mini Object-relational Mapper
Build a simplified in-memory ORM with model delegates that expose basic CRUD operations.
25 minJavaScript - MEDIUM
Object.assign
Implement Object.assign — copy own enumerable string and symbol properties from sources onto a target, skipping nullish.
25 minJavaScript - MEDIUM
pick / omit
Implement pick, omit, pickBy, and omitBy — build a subset of an object by a key list or by a predicate.
25 minJavaScript - MEDIUM
Squash Object
Implement a function that flattens a nested object into a single-level object using dot-delimited keys.
25 minJavaScript - MEDIUM
Turtle
Build a Turtle class that tracks position and heading as you issue movement and turn commands on a 2D plane.
25 minJavaScript - MEDIUM
Type Utilities II
Implement helpers that accurately identify non-primitive JavaScript values such as arrays, plain objects, dates, and maps.
25 minJavaScript - MEDIUM
Unsquash Object
Implement a function that rebuilds a nested object from a flat map of dot-delimited keys.
25 minJavaScript - MEDIUM
ES5 Class Inheritance
Wire up classical inheritance the pre-class way — link prototypes with Object.create, restore the constructor, and call the superclass constructor.
30 minJavaScript - MEDIUM
The new Operator
PREMIUMImplement newOperator — reproduce the four steps the new keyword performs, honoring the object-return override.
30 minJavaScript - MEDIUM
instanceof
PREMIUMImplement an instanceof check — walk the prototype chain to see whether a constructor's prototype appears in it.
40 minJavaScript - MEDIUM
Object.create
PREMIUMImplement Object.create — make a new object with a given prototype and optional property descriptors.
40 minJavaScript - HARD
Backbone Model
PREMIUMImplement a Backbone-style Model class that stores attributes and emits change events per key.
40 minJavaScript - HARD
Deep Clone II
PREMIUMImplement a deep clone that copies nested values and correctly handles circular references using a visited map.
40 minJavaScript - HARD
Deep Equal
PREMIUMImplement a function that determines whether two values are structurally equal across nested objects and arrays.
40 minJavaScript - HARD
Mini Object-relational Mapper III
PREMIUMBuild a simplified in-memory ORM with field selection and eagerly included related records.
40 minJavaScript - HARD
structuredClone
PREMIUMImplement structuredClone — deep-clone a value including Map, Set, Date, RegExp, typed arrays, and circular references.
40 minJavaScript - HARD
Styled Text Ranges IV
PREMIUMImplement a function that patches shallow style objects over a text range without clobbering unrelated keys.
40 minJavaScript - EASY
Balanced Brackets
Implement a function that checks whether a string of brackets is properly opened and closed in order.
15 minAlgorithms - EASY
Roman to Integer
Convert a Roman numeral string to its integer value, handling subtractive pairs like IV and IX.
15 minAlgorithmsAmazon · Microsoft · Adobe - EASY
String.prototype.padStart
Implement String.prototype.padStart — pad a string to a target length on the left, truncating a multi-char pad.
15 minJavaScript - EASY
String.prototype.trim
Implement String.prototype.trim — strip leading and trailing whitespace, including Unicode whitespace, from a string.
15 minJavaScript - MEDIUM
Base Converter
PREMIUMConvert a number's string representation between any two bases from 2 to 36 — parse the digits in the source base, then re-emit them in the target base.
25 minJavaScript - MEDIUM
BigInt String Arithmetic
PREMIUMAdd and multiply arbitrarily large non-negative integers given as decimal strings, using digit-by-digit schoolbook arithmetic with carries.
25 minJavaScript - MEDIUM
Caesar Cipher / ROT13
Shift each letter by a fixed amount with wraparound, preserving case and passing non-letters through — with ROT13 as the self-inverse case.
25 minJavaScript - MEDIUM
Decode Message
Implement a function that counts how many ways a digit string can be decoded into letters using a 1 to 26 mapping.
25 minAlgorithms - MEDIUM
Edit Distance
PREMIUMCompute the minimum number of insertions, deletions, and replacements to turn one string into another — the Levenshtein distance via a 2D dynamic-programming table.
25 minAlgorithms - MEDIUM
Excel Column ↔ Number
Convert between Excel column titles and numbers in both directions — A is 1, Z is 26, AA is 27 — the classic bijective base-26 system with no zero digit.
25 minJavaScript - MEDIUM
Generate Parentheses
Generate every well-formed combination of n pairs of parentheses by backtracking — add an open bracket while any remain, and a close bracket only while it stays balanced.
25 minAlgorithms - MEDIUM
i18n Engine
PREMIUMBuild a translation engine with nested key lookup, variable interpolation, pluralization, and locale fallback.
25 minJavaScript - MEDIUM
ICU Message Formatter
Parse and format ICU MessageFormat strings with plural, select, and nested argument substitution.
25 minJavaScript - MEDIUM
IPv4 / IPv6 Validate
Validate IPv4 dotted-quad and IPv6 addresses, handling octet ranges, leading zeros, and :: zero-group compression.
25 minJavaScript - MEDIUM
Longest Repeating Substring After Replacements
Implement a function that finds the longest substring made of one repeated character allowing up to k swaps.
25 minAlgorithmsGoogle · Amazon · Meta - MEDIUM
Palindrome Partitioning
Split a string every possible way so that each piece is a palindrome — backtrack over cut positions, extending a piece only while it reads the same both ways.
25 minAlgorithms - MEDIUM
Phone Letter Combinations
List every letter string a phone number could spell, mapping each digit to its keypad letters and backtracking through the choices.
25 minAlgorithms - MEDIUM
Roman Numerals ↔ Integer
Convert between Roman numerals and integers in both directions, handling subtractive notation like IV, IX, and XL.
25 minJavaScript - MEDIUM
Round to Precision
Round, floor, and ceil a number to N decimal places without the classic floating-point drift — 1.005 must round to 1.01, not 1.00.
25 minJavaScript - MEDIUM
Run-Length Encoding
Implement run-length encoding: compress runs of repeated characters into count+char pairs, and decode them back.
25 minJavaScript - MEDIUM
Semver Compare
PREMIUMParse and compare two semantic version strings — major, minor, patch, and prerelease — returning -1, 0, or 1 with correct prerelease precedence.
25 minJavaScript - MEDIUM
Slugify
Turn a string into a URL-safe slug: lowercase, strip accents, and collapse non-alphanumeric runs into single hyphens.
25 minJavaScript - MEDIUM
Spreadsheet
Implement a spreadsheet class that resolves numeric cell values and evaluates simple addition formulas.
25 minJavaScript - MEDIUM
Spreadsheet II
Build a spreadsheet class that evaluates left-to-right arithmetic formulas referencing other cells.
25 minJavaScript - MEDIUM
SSE Frame Decoder
PREMIUMDecode a Server-Sent Events stream arriving in arbitrary chunks into discrete parsed events.
25 minJavaScript - MEDIUM
String to Number (parseInt)
Reimplement JavaScript's parseInt — skip leading whitespace, read an optional sign and radix prefix, consume valid digits for the base, and stop at the first invalid character.
25 minJavaScript - MEDIUM
Template Engine
Implement a template renderer that substitutes Mustache-style placeholders with values from a data object.
25 minJavaScript - MEDIUM
Text Search II
Implement a function that wraps every occurrence of any term from a list inside highlight markup.
25 minJavaScript - MEDIUM
Thousands Separator
Group a number's integer digits with separators — 1234567 to 1,234,567 — handling decimals, negatives, and a custom separator.
25 minJavaScript - MEDIUM
Tool-Call Streaming State Machine
PREMIUMTrack streaming LLM tool calls by id, accumulating argument deltas and guarding each pending, running, and done transition.
25 minJavaScript - MEDIUM
Trie (Prefix Tree)
PREMIUMImplement a Trie data structure supporting insert, exact word search, and prefix lookup operations.
25 minAlgorithms - MEDIUM
Truncate String
Implement lodash truncate — cut a string to a maximum length, append an ellipsis, and optionally break on the last word boundary before the limit.
25 minJavaScript - MEDIUM
URLSearchParams
Implement a URLSearchParams-style class with get, getAll, append, set, and toString over an encoded query string.
25 minJavaScript - MEDIUM
Arithmetic Expression Evaluator
Tokenize and evaluate a math expression string with operator precedence, parentheses, and unary minus.
35 minJavaScriptGoogle · Amazon · Microsoft - MEDIUM
Case Converters
Convert any string between camelCase, snake_case, kebab-case, and PascalCase by tokenizing it into words first.
35 minJavaScript - MEDIUM
Object Path set / unset
Implement lodash-style set and unset: write or delete a value at a deep object path, creating containers as needed.
35 minJavaScript - MEDIUM
String replaceAll / matchAll
Implement replaceAll and matchAll — replace every occurrence of a substring or global pattern, and iterate every match with its capture groups.
35 minJavaScript - HARD
Integer to English Words
PREMIUMSpell out a non-negative integer in English words — break it into groups of three digits and name each group with its scale word.
40 minJavaScript - HARD
JSON.parse
PREMIUMImplement JSON.parse — a recursive-descent parser that turns a JSON string into the corresponding JavaScript value.
40 minJavaScript - HARD
Partial JSON Parser
PREMIUMParse a truncated JSON string into the best-valid value so far by completing open strings and containers.
40 minJavaScript - HARD
Streaming Markdown State Machine
PREMIUMRender markdown-so-far to HTML, holding and closing unclosed bold, inline code, and fenced code blocks.
40 minJavaScript - HARD
Superjson
PREMIUMImplement serialize and deserialize helpers that round-trip values like Date, Map, Set, and BigInt through JSON.
40 minJavaScript - HARD
Wildcard Matching
PREMIUMDecide whether a string matches a pattern containing `?` (any single character) and `*` (any sequence) — a two-dimensional dynamic-programming match over string and pattern.
40 minAlgorithms - EASY
Async CountDown Latch
Implement a countdown latch whose wait resolves once countDown has been called the required number of times.
15 minJavaScript - EASY
Cursor Pagination Fetcher
Fetch successive pages with an opaque cursor, accumulating items and tracking whether more remain.
15 minJavaScript - EASY
Promise.race
Implement Promise.race so it settles with the outcome of whichever input promise settles first.
15 minJavaScript - EASY
Promise.reject
Implement a function that returns a Promise already rejected with the given reason.
15 minJavaScript - MEDIUM
Abortable Fetch with Timeout
PREMIUMFetch with a timeout that aborts the request via AbortController and honors an external abort signal.
25 minJavaScript - MEDIUM
Async Mutex
PREMIUMImplement an async mutex whose acquire returns a release function, serializing access so only one holder runs at a time.
25 minJavaScript - MEDIUM
Async Semaphore
PREMIUMImplement an async semaphore that admits up to N concurrent holders and queues the rest until a permit frees.
25 minJavaScript - MEDIUM
Async Task Queue
PREMIUMImplement a task queue that runs async jobs under a concurrency limit and resolves an idle promise when drained.
25 minJavaScript - MEDIUM
Cancellable Promise
PREMIUMWrap a promise so it can be cancelled — the wrapper rejects on cancel and ignores the underlying settlement.
25 minJavaScript - MEDIUM
Circuit Breaker
PREMIUMImplement a circuit breaker that trips open after repeated failures, rejects fast while open, then probes half-open.
25 minJavaScript - MEDIUM
ETag Revalidation Cache
Cache responses by URL and revalidate with an ETag, reusing cached data on a 304 Not Modified.
25 minJavaScript - MEDIUM
Map Async
Implement a function that applies an async mapper to every item in an array and resolves with the results.
25 minJavaScript - MEDIUM
Microtask Batch Scheduler
Coalesce all schedule calls made in one synchronous frame into a single flush on the next microtask.
25 minJavaScript - MEDIUM
Poll Until
Implement pollUntil — call an async function on an interval until a predicate passes or a timeout elapses.
25 minJavaScript - MEDIUM
Promise Pool
Implement a promise pool that runs task factories with a concurrency cap and resolves to their results in order.
25 minJavaScript - MEDIUM
Promise.all
Implement Promise.all so it resolves with an array of results or rejects on the first rejection.
25 minJavaScript - MEDIUM
Promise.allSettled
PREMIUMImplement Promise.allSettled from scratch, resolving to an array of fulfilled or rejected outcomes for each input.
25 minJavaScript - MEDIUM
Promise.any
PREMIUMImplement Promise.any so it resolves with the first fulfilled value or rejects with an AggregateError.
25 minJavaScript - MEDIUM
Promise.resolve
Implement Promise.resolve — wrap a value in a fulfilled promise, returning thenables unchanged and adopting their state.
25 minJavaScript - MEDIUM
Promise.withResolvers
Implement Promise.withResolvers — return a new promise alongside its external resolve and reject functions.
25 minJavaScript - MEDIUM
Retry with Backoff
Implement retry — re-run a failing async function with a delay that grows exponentially between attempts.
25 minJavaScript - MEDIUM
Singleflight
Implement singleflight so concurrent calls for the same key share one in-flight promise instead of duplicating work.
25 minJavaScript - MEDIUM
Test Runner
Implement a minimal test runner that registers cases, runs each one, and reports pass and fail counts.
25 minJavaScript - MEDIUM
Array.fromAsync
Implement Array.fromAsync: build a promise of an array from a sync or async iterable, awaiting each value in order.
30 minJavaScript - MEDIUM
Task Runner with Dependencies
Run async tasks in dependency order, executing independent ones in parallel and catching cycles.
30 minJavaScript - MEDIUM
Idempotency Key Queue
Dedupe by idempotency key: run a task at most once per key, cache the result with a TTL, and retry on failure.
35 minJavaScript - MEDIUM
Long-Polling Client
Build a long-polling loop that re-issues a held request as each returns, advances a cursor, backs off on error, and stops cleanly.
35 minJavaScript - MEDIUM
Online/Offline Flush Manager
Queue writes while offline and flush them in FIFO order when the network returns, retrying failures without dropping or reordering.
35 minJavaScript - MEDIUM
Priority Request Scheduler
PREMIUMSchedule async requests under a concurrency limit, always running the highest-priority waiter next with a stable FIFO tiebreak.
35 minJavaScript - MEDIUM
Reconnecting WebSocket
PREMIUMWrap a WebSocket so it auto-reconnects with exponential backoff, queues sends while down, and re-emits its events.
35 minJavaScript - HARD
async parallel / series
PREMIUMImplement Node-style async runners — run error-first tasks in parallel or in series and collect their results.
40 minJavaScript - HARD
Async Read-Write Lock
Implement a read-write lock that allows many concurrent readers or one exclusive writer without starving writers.
40 minJavaScript - HARD
DataLoader
PREMIUMBatch and cache load(key) calls made in one tick into a single batch function call, preserving order.
40 minJavaScript - HARD
Mini React Query Core
PREMIUMBuild a framework-agnostic query cache with request dedup, staleTime, subscribers, and invalidation.
40 minJavaScript - HARD
Observable
PREMIUMImplement a minimal Observable with subscribe/unsubscribe and of/from plus map and filter operators.
40 minJavaScript - HARD
Optimistic Mutation Manager
PREMIUMApply optimistic updates immediately and roll them back on failure, even with concurrent mutations.
40 minJavaScript - HARD
Test Runner IV
PREMIUMExtend a tiny test runner so it correctly awaits asynchronous specs and asynchronous setup or cleanup hooks.
40 minJavaScript - HARD
Redux-Saga Effect Runner
PREMIUMBuild a redux-saga-style interpreter that runs a generator of declarative effects and resumes it with each result.
50 minJavaScript - HARD
RxJS-Lite Pipeable Operators
PREMIUMBuild a mini reactive-streams library: a cold Observable and pipeable operators composed with a .pipe() chain.
50 minJavaScript - EASY
Staircase Climbing Combinations
Implement a function that counts the distinct ways to climb to the top of a staircase taking one or two steps.
15 minAlgorithms - MEDIUM
0/1 Knapsack
PREMIUMMaximize the value packed into a weight-limited knapsack when each item can be taken at most once — the classic 0/1 dynamic-programming table.
25 minAlgorithms - MEDIUM
Combinations for Target Sum
Implement a function that returns every unique combination of reusable candidates that sums to a target.
25 minAlgorithms - MEDIUM
Count Islands in a Grid
Implement a function that counts the number of distinct islands of connected cells in a 2D binary grid.
25 minAlgorithms - MEDIUM
Deep Map
PREMIUMImplement a function that walks an arbitrarily nested structure and applies a transform to every leaf value.
25 minJavaScript - MEDIUM
Depth-First Search
Implement depth-first traversal of a directed graph, exploring each branch fully before backtracking.
25 minAlgorithms - MEDIUM
Fast Power
Raise a base to an integer exponent in logarithmic time using exponentiation by squaring, handling negative exponents.
25 minAlgorithms - MEDIUM
GCD / LCM
Compute the greatest common divisor with Euclid's algorithm and the least common multiple, for two numbers or a whole list.
25 minAlgorithms - MEDIUM
HTML Serializer
Implement a function that serializes a tree-shaped object into a pretty-printed HTML string with indentation.
25 minJavaScript - MEDIUM
Merge Sort
Implement merge sort recursively by splitting the array and merging the sorted halves back together.
25 minAlgorithms - MEDIUM
Permutations & Subsets
PREMIUMGenerate every permutation and every subset of an array with the same backtracking template — choose, recurse, and undo.
25 minAlgorithms - MEDIUM
Quick Sort
Implement quick sort recursively, partitioning around a pivot and sorting each side independently.
25 minAlgorithms - HARD
JSON.stringify II
PREMIUMImplement JSON.stringify with full spec support including replacer, indentation, and circular reference detection.
40 minJavaScript - HARD
N-Queens
PREMIUMPlace 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 minAlgorithms - HARD
Schema Validator III
PREMIUMExtend a tiny schema validator to handle nested object and array shapes plus optional fields.
40 minJavaScript - HARD
Sudoku Solver
PREMIUMFill 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 minAlgorithms - HARD
Superjson II
PREMIUMBuild serialize and deserialize that preserve referential identity — shared references and circular structures round-trip intact.
40 minJavaScript - EASY
Binary Tree Equal
Implement a function that returns whether two binary trees have identical structure and node values.
15 minAlgorithms - EASY
Binary Tree Maximum Depth
Implement a function that returns the maximum depth from root to leaf in a binary tree.
15 minAlgorithms - EASY
Combine Two Sorted Linked Lists
Implement a function that merges two sorted linked lists into a single sorted linked list.
15 minAlgorithms - EASY
Flip Binary Tree
Implement a function that mirrors a binary tree by swapping the left and right children of every node.
15 minAlgorithms - EASY
Linked List Reversal
Implement a function that reverses a singly linked list in place and returns the new head.
15 minAlgorithms - EASY
Queue
Build a queue data structure supporting enqueue, dequeue, peek, and size in FIFO order.
15 minAlgorithms - EASY
Stack
Build a stack data structure that supports the standard push, pop, peek, and size operations.
15 minAlgorithms - EASY
String Anagram
Implement a function that determines whether two strings are anagrams of each other.
15 minAlgorithms - MEDIUM
A/B Test Bucketing
Assign users to weighted experiment variants deterministically, with a traffic gate and independent buckets per experiment.
25 minJavaScript - MEDIUM
Binary Search Tree Kth Smallest Element
Implement a function that returns the kth smallest value in a binary search tree.
25 minAlgorithms - MEDIUM
Binary Search Tree Lowest Common Ancestor
Implement a function that finds the lowest common ancestor of two nodes in a binary search tree.
25 minAlgorithms - MEDIUM
Binary Tree
Build a binary tree data structure with the essential insert, traverse, and search operations.
25 minAlgorithms - MEDIUM
Binary Tree Level Order Traversal
Implement a function that returns the values of a binary tree grouped by level from top to bottom.
25 minAlgorithms - MEDIUM
Binary Tree Rebuilding from Preorder and Inorder Traversals
Implement a function that reconstructs a binary tree given its preorder and inorder traversal sequences.
25 minAlgorithms - MEDIUM
Binary Tree Subtree
Implement a function that determines whether one binary tree appears as a subtree of another.
25 minAlgorithms - MEDIUM
Bloom Filter
PREMIUMBuild a Bloom filter — a compact probabilistic set that answers membership with no false negatives but possible false positives, using a bit array and several hash functions.
25 minAlgorithms - MEDIUM
Breadth-First Search
Implement breadth-first traversal of a directed graph, visiting nodes level by level from a start vertex.
25 minAlgorithms - MEDIUM
Course Dependency
Implement a function that decides whether a set of courses can be finished given their prerequisite pairs.
25 minAlgorithms - MEDIUM
Delete Nth Node from End of Linked List
Implement a function that removes the nth-from-end node from a singly linked list in one pass.
25 minAlgorithms - MEDIUM
Deque (Double-Ended Queue)
Build a double-ended queue with constant-time push and pop at both the front and the back, backed by a doubly linked list.
25 minAlgorithms - MEDIUM
Feature Flag Client
PREMIUMEvaluate feature flags with targeting rules and a deterministic percentage rollout that stays sticky per user.
25 minJavaScript - MEDIUM
G/PN-Counter CRDT
Build increment and decrement counters that merge by per-node maxima into a conflict-free convergent total.
25 minJavaScript - MEDIUM
Graph Clone
Implement a function that produces a deep copy of a connected, undirected graph given a reference node.
25 minAlgorithms - MEDIUM
Graph Count Connected Components
Implement a function that counts the number of connected components in an undirected graph given its edges.
25 minAlgorithms - MEDIUM
Is the Graph a Tree
Implement a function that determines whether a given undirected graph forms a valid tree.
25 minAlgorithms - MEDIUM
Linked List
Build a singly linked list data structure with the standard insert, remove, and traversal operations.
25 minAlgorithms - MEDIUM
Linked List Detect Cycle
PREMIUMImplement a function that detects whether a singly linked list contains a cycle.
25 minAlgorithms - MEDIUM
Longest Consecutive Number Sequence
Implement a function that returns the length of the longest run of consecutive integers found in an unsorted array.
25 minAlgorithms - MEDIUM
Longest Non-repeating Substring
Implement a function that returns the length of the longest substring containing no duplicate characters.
25 minAlgorithms - MEDIUM
LWW Register / Map CRDT
PREMIUMBuild a last-write-wins map whose entries merge by timestamp with a deterministic node-id tiebreak.
25 minJavaScript - MEDIUM
Map With History
Implement a class that records timestamped writes and returns the most recent value at or before a queried timestamp.
25 minAlgorithms - MEDIUM
Matrix Zeroing
Implement a function that zeroes out every row and column in a matrix that originally contained a zero, ideally in place.
25 minAlgorithms - MEDIUM
Mini Object-relational Mapper II
Extend a simplified in-memory ORM with richer filtering predicates and multi-field sorting.
25 minJavaScript - MEDIUM
Most Common Elements
Implement a function that returns the k most frequent integers in an array, breaking ties consistently.
25 minAlgorithms - MEDIUM
Normalized Entity Cache
Store entities flat by id, normalizing nested relations and merging updates immutably.
25 minJavaScript - MEDIUM
OR-Set CRDT
Build an observed-remove set where a concurrent add and remove converge with the add winning.
25 minJavaScript - MEDIUM
Queue via Two Stacks
Build a FIFO queue out of two LIFO stacks — pour one stack into the other so the reversed order dequeues oldest-first in amortized constant time.
25 minAlgorithms - MEDIUM
Rearrange Linked List
Implement a function that reorders a singly linked list by interleaving nodes from the front and the reversed back half.
25 minAlgorithms - MEDIUM
String Anagram Groups
Implement a function that groups an array of strings so anagrams of each other end up in the same bucket.
25 minAlgorithms - MEDIUM
Styled Text Ranges II
Implement a function that overwrites the style on a given text range and normalizes the resulting range list.
25 minJavaScript - MEDIUM
Task Coordination
Implement a function that schedules tasks with a cooldown between identical ones and returns the minimum total time.
25 minAlgorithms - MEDIUM
Undo / Redo Manager
PREMIUMImplement a class that tracks value history and exposes undo and redo navigation across the timeline.
25 minJavaScript - MEDIUM
Undoable Database
Build a user database class that supports CRUD operations plus undo and redo across the operation history.
25 minJavaScript - MEDIUM
Union-Find (Disjoint Set)
PREMIUMBuild a disjoint-set structure with near-constant-time union and find, using path compression and union by rank to keep the trees flat.
25 minAlgorithms - MEDIUM
Validate Binary Search Tree
Implement a function that determines whether a binary tree satisfies the binary search tree ordering invariant.
25 minAlgorithms - MEDIUM
Word Finder
Implement a data structure that supports adding words and searching with a wildcard character that matches any letter.
25 minAlgorithms - MEDIUM
Iterator Helpers
Build lazy, chainable iterator helpers — map, filter, take, drop, and flatMap — that pull one value at a time.
35 minJavaScript - HARD
Binary Search Tree
PREMIUMBuild a binary search tree with insert, search, and delete operations preserving the BST invariant.
40 minAlgorithms - HARD
Binary Tree Maximum Total Path
PREMIUMImplement a function that returns the maximum sum of node values along any path in a binary tree.
40 minAlgorithms - HARD
Binary Tree Serialization and Deserialization
PREMIUMImplement functions that convert a binary tree to a string and reconstruct the same tree back from that string.
40 minAlgorithms - HARD
Dijkstra's Algorithm
PREMIUMImplement Dijkstra's algorithm to compute shortest paths from a source vertex in a weighted graph.
40 minAlgorithms - HARD
Drizzle Query Builder III
PREMIUMExtend an in-memory query builder inspired by Drizzle with innerJoin and leftJoin between related tables.
40 minJavaScript - HARD
Fenwick Tree (Binary Indexed Tree)
PREMIUMBuild a Fenwick tree for logarithmic prefix-sum queries and point updates, using the lowest-set-bit trick to walk responsibility ranges.
40 minAlgorithms - HARD
Find Words in Grid
PREMIUMImplement a function that returns every word from a dictionary that can be traced through adjacent cells in a grid.
40 minAlgorithms - HARD
Heap
PREMIUMImplement a binary heap data structure supporting push, pop, peek, and heapify with the standard ordering invariant.
40 minAlgorithms - HARD
Heap Sort
PREMIUMImplement heap sort by building a max-heap and repeatedly extracting the largest element.
40 minAlgorithms - HARD
Immer produce()
PREMIUMImplement produce so mutating a draft proxy yields a new immutable state with structural sharing.
40 minJavaScript - HARD
Linked Lists Combine K Sorted
PREMIUMMerge k pre-sorted singly-linked lists into one sorted list in O(n log k) time.
40 minAlgorithmsGoogle · Amazon · Meta - HARD
Number Stream Median
PREMIUMImplement a data structure that ingests integers one at a time and reports the running median in logarithmic time.
40 minAlgorithms - HARD
Persistent Immutable List
PREMIUMBuild 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 minAlgorithms - HARD
Segment Tree
PREMIUMBuild a segment tree over an array for logarithmic range-sum queries and point updates, each tree node holding the aggregate of its slice.
40 minAlgorithms - HARD
Sequence CRDT (RGA)
PREMIUMBuild a replicated growable array for text whose positional-id inserts and deletes converge across replicas.
40 minJavaScript - HARD
Skip List
PREMIUMBuild a skip list — a sorted set layered with express lanes of linked lists so search, insert, and delete run in expected logarithmic time.
40 minAlgorithms - HARD
Spreadsheet III
PREMIUMBuild a spreadsheet that recomputes dependent cells when inputs change and detects circular references.
40 minJavaScript - HARD
Styled Text Ranges
PREMIUMImplement a slice operation over text annotated with overlapping style ranges, preserving alignment.
40 minJavaScript - HARD
Styled Text Ranges III
PREMIUMImplement a function that replaces a text range and keeps the surrounding style ranges normalized.
40 minJavaScript - HARD
Undo / Redo Manager II
PREMIUMBuild a class that tracks draft values and commits them as batch checkpoints for undo and redo navigation.
40 minJavaScript - HARD
Undoable Database II
PREMIUMBuild a user database that buffers draft mutations and commits them as batch undo and redo checkpoints.
40 minJavaScript - EASY
Bubble Sort
Implement bubble sort, repeatedly swapping adjacent out-of-order pairs until the array is sorted.
15 minAlgorithms - EASY
Insertion Sort
Implement insertion sort by building the sorted portion one element at a time from the input.
15 minAlgorithms - EASY
Meeting Calendar
Implement a function that determines whether a person can attend every meeting given their time intervals.
15 minAlgorithms - EASY
Selection Sort
Implement selection sort to order an array by repeatedly picking the smallest remaining element.
15 minAlgorithms - MEDIUM
Binary Search
Implement binary search on a sorted array, returning the index of the target or -1 when absent.
25 minAlgorithms - MEDIUM
Counting / Radix Sort
Sort integers without comparisons — counting sort tallies occurrences into buckets, and radix sort applies it digit by digit from the least significant.
25 minAlgorithms - MEDIUM
Disjoint Intervals
Implement a function that returns the minimum number of intervals to remove so the remaining ones do not overlap.
25 minAlgorithms - MEDIUM
Merge New Interval
Implement a function that inserts a new interval into a sorted list and merges any resulting overlaps.
25 minAlgorithms - MEDIUM
Merge Overlapping Intervals
Implement a function that merges all overlapping intervals in a list and returns the consolidated set in sorted order.
25 minAlgorithms - MEDIUM
Minimum Meeting Rooms Needed
Implement a function that returns the fewest meeting rooms required to host a list of time intervals without conflicts.
25 minAlgorithms - MEDIUM
Reading Order
Implement a function that sorts positioned canvas elements into natural left-to-right, top-to-bottom reading order.
25 minAlgorithms - MEDIUM
Reading Order II
Implement a function that groups misaligned 2D canvas elements into rows, then sorts them into a natural reading order.
25 minAlgorithms - MEDIUM
Triplet Sum
Implement a function that returns every unique triplet of distinct indices whose values sum to zero.
25 minAlgorithms - MEDIUM
Weighted Random Pick
Pick items at random in proportion to their weights using prefix sums and a binary search, with an injectable RNG so picks are testable.
25 minAlgorithms - HARD
Topological Sort
PREMIUMImplement a function that returns a topological ordering of nodes in a directed acyclic graph.
40 minAlgorithms - EASY
Bit Reversal
Implement a function that reverses the order of the bits in the binary representation of a number.
15 minAlgorithms - EASY
Count Set Bits in a Binary Number
Implement a function that counts the number of 1 bits in the binary representation of an integer.
15 minAlgorithms - EASY
Object.is
Implement Object.is — same-value equality that treats NaN as equal to itself and keeps +0 distinct from -0.
15 minJavaScript - EASY
String Palindrome
Implement a function that returns whether a string reads the same forwards and backwards.
15 minAlgorithms - MEDIUM
Bit Counting
Implement a function that returns an array of set-bit counts for every integer from 0 up to n.
25 minAlgorithms - MEDIUM
End of Array Reachable
Implement a function that decides whether you can reach the last index of an array using each element as a max jump.
25 minAlgorithms - MEDIUM
Find the Longest Palindromic Substring
Implement a function that returns the longest palindromic substring contained within a given string.
25 minAlgorithms - MEDIUM
Find Word in Grid
Implement a function that checks whether a target word can be traced through adjacent cells in a 2D character grid.
25 minAlgorithms - MEDIUM
Integer Square Root
Compute the integer square root — the floor of the real square root — using Newton's method, without Math.sqrt.
25 minAlgorithms - MEDIUM
Longest Common Subsequence
Implement a function that returns the length of the longest subsequence common to two input strings.
25 minAlgorithms - MEDIUM
Longest Increasing Subsequence
Implement a function that returns the length of the longest strictly increasing subsequence in an array.
25 minAlgorithms - MEDIUM
Matrix Spiral Traversal
Implement a function that walks a 2D matrix in clockwise spiral order and returns the visited values.
25 minAlgorithms - MEDIUM
Maximal Square
Find the area of the largest all-ones square in a binary matrix, where each cell's square size is one more than the smallest of its top, left, and top-left neighbors.
25 minAlgorithms - MEDIUM
Minimum Coins for Change
Implement a function that returns the fewest coins needed to make a target amount, or -1 when no combination works.
25 minAlgorithms - MEDIUM
Minimum Path Sum
Find the cheapest path from the top-left to the bottom-right of a grid, moving only right or down, by summing each cell with the smaller of the two ways to reach it.
25 minAlgorithms - MEDIUM
Neighborhood Theft
Implement a function that computes the maximum money you can rob from a row of houses without picking two adjacent ones.
25 minAlgorithms - MEDIUM
Neighborhood Theft (Circular)
Implement a function that maximizes loot from houses arranged in a circle without robbing two adjacent ones.
25 minAlgorithms - MEDIUM
Ocean Flow
Implement a function that returns every grid cell from which water can flow to both the Pacific and Atlantic oceans.
25 minAlgorithms - MEDIUM
Palindromic Substrings
Implement a function that counts every palindromic substring within a string, including overlapping occurrences.
25 minAlgorithms - MEDIUM
Prime Check / Sieve
Test whether a number is prime and generate all primes up to n with the Sieve of Eratosthenes.
25 minAlgorithms - MEDIUM
Search a 2D Matrix
Search a matrix whose rows and columns are both sorted by walking a staircase from the top-right corner, eliminating a whole row or column at each step.
25 minAlgorithms - MEDIUM
Streaming Chat Store Reducer
PREMIUMBuild a pure, immutable reducer that opens an assistant message, appends streamed deltas, and finalizes it.
25 minJavaScript - MEDIUM
Sum Without Addition
Implement a function that adds two integers using only bitwise operators, without using + or -.
25 minAlgorithms - MEDIUM
Vector Clocks
PREMIUMOrder distributed events with vector clocks, detecting whether two events are causal or concurrent.
25 minJavaScript - MEDIUM
Base64 atob / btoa
Implement base64 encoding and decoding from scratch — pack bytes into 6-bit groups, map to the alphabet, and handle padding.
35 minJavaScript - MEDIUM
Socket Channel Multiplexing
Run many logical channels over one WebSocket — route each incoming frame to the right channel and clean up on leave.
35 minJavaScript - MEDIUM
WebSocket Session Resume
PREMIUMResume a dropped connection without gaps — track sequence numbers, request a replay from the last seen, and de-duplicate redelivered messages.
40 minJavaScript - HARD
Extraterrestrial Language
PREMIUMGiven words sorted in an unknown alphabet's order, reconstruct the alphabet.
40 minAlgorithmsGoogle · Airbnb · Facebook - HARD
Mini MobX
Build MobX-style observables with autorun and computed that re-run when the data they read changes.
40 minJavaScript - HARD
Operational Transform (Text)
PREMIUMTransform concurrent insert and delete operations so replicas converge to the same text.
40 minJavaScript - HARD
Rich Text to HTML
PREMIUMImplement a function that converts a list of styled text ranges into a canonical, properly nested HTML string.
40 minJavaScript - HARD
Shortest Substring Containing Characters
PREMIUMImplement a function that returns the smallest window of a string that contains every character of another string.
40 minAlgorithms - HARD
Statechart Engine (XState-lite)
PREMIUMBuild a state-machine engine with events, guards, entry and exit actions, and context updates.
40 minJavaScript - EASY
Cookie Store
Implement get/set/remove over document.cookie, handling encoding and expiry.
15 minJavaScript - EASY
Deep Clone DOM
Implement a deep clone of a DOM node and its subtree (element, text, and attributes) without cloneNode.
15 minJavaScript - EASY
DOM Tree Height
Implement a function that returns the height (max depth) of a DOM element's subtree.
15 minJavaScript - EASY
Event Delegation
Implement a delegated event listener that matches events bubbling up from descendants against a selector.
15 minJavaScript - EASY
Generate CSS Selector
Implement a function that builds a unique CSS selector path from the root to a given element.
15 minJavaScript - EASY
Get DOM Tags
Implement a function returning the set of distinct tag names used in a DOM subtree, in document order.
15 minJavaScript - EASY
jQuery.css
Implement a jQuery-style helper that gets or sets inline CSS properties on a DOM element.
15 minJavaScript - EASY
Next Right Sibling
Implement a function that finds the element immediately to the right of a target at the same tree depth.
15 minJavaScript - EASY
Traverse DOM (BFS)
Implement a breadth-first traversal of a DOM tree, returning elements level by level.
15 minJavaScript - MEDIUM
Corresponding Node Across Pages
Implement a function that locates the node in a mirrored DOM tree occupying the same path as a given node.
25 minJavaScript - MEDIUM
CSS Selector Matches
Implement Element.matches: test whether an element satisfies a compound CSS selector (tag, id, class, attribute).
25 minJavaScript - MEDIUM
DOM Method Chaining
PREMIUMBuild a jQuery-style wrapper whose methods return this so calls like addClass().text() chain.
25 minJavaScript - MEDIUM
Finite State Machine
PREMIUMImplement a state machine from a config of states and transitions, with send, guards, and entry actions.
25 minJavaScript - MEDIUM
Form Serialize
PREMIUMSerialize a form's fields into a nested object, handling checkboxes, multi-selects, and bracket names.
25 minJavaScript - MEDIUM
getElementsByClassName
Implement a function that returns all DOM elements containing every one of the specified class names.
25 minJavaScript - MEDIUM
getElementsByStyle
Implement a function that returns all DOM elements whose computed style matches a given property and value.
25 minJavaScript - MEDIUM
getElementsByTagName
Implement a function that walks a DOM tree and returns every descendant element matching a given tag name.
25 minJavaScript - MEDIUM
Hash Router
PREMIUMBuild a client-side router over location.hash with route params and a change subscription.
25 minJavaScript - MEDIUM
History Router
PREMIUMBuild a client-side router over the History API (pushState/popstate) with path params.
25 minJavaScript - MEDIUM
HTML Sanitizer
Implement a simplified HTML sanitizer that strips out unsafe tags and attributes from a given DOM tree.
25 minJavaScript - MEDIUM
Identical DOM Trees
Implement a function that recursively compares two DOM trees and returns whether they are structurally equal.
25 minJavaScript - MEDIUM
IntersectionObserver Polyfill
Implement a scroll/resize-driven fallback that reports when observed elements enter the viewport.
25 minJavaScript - MEDIUM
jQuery Class Manipulation
Implement chainable addClass, removeClass, toggleClass, and hasClass helpers on a DOM element wrapper.
25 minJavaScript - MEDIUM
JSON Path Query
PREMIUMResolve a dotted path with array indices and a wildcard against a nested object, returning matches.
25 minJavaScript - MEDIUM
JSX Runtime
PREMIUMImplement the jsx() factory (type, props, children) that a JSX transform compiles to.
25 minJavaScript - MEDIUM
Lazy Load Images
PREMIUMSwap each image's data-src into src as it nears the viewport, using an IntersectionObserver.
25 minJavaScript - MEDIUM
LRU Cache
PREMIUMImplement a fixed-capacity least-recently-used cache with O(1) get and put via a map plus a linked list.
25 minJavaScript - MEDIUM
Markdown Parser
PREMIUMParse a subset of Markdown (headings, bold, italics, links, code) into an HTML string.
25 minJavaScript - MEDIUM
Mini Template Engine
PREMIUMImplement a string template engine with {{ variable }} interpolation and nested-path lookup.
25 minJavaScript - MEDIUM
Mutation Observer Mini
Build a mini MutationObserver that diffs a subtree on demand and reports added and removed nodes.
25 minJavaScript - MEDIUM
Node Registry
Implement a registry that associates values with DOM nodes without leaking memory once nodes are gone.
25 minJavaScript - MEDIUM
Observable Store
Build a tiny state store with getState, setState, and subscribe that notifies listeners on change.
25 minJavaScript - MEDIUM
PubSub with Wildcards
Implement an event bus whose subscriptions support wildcard segments matching any single topic level.
25 minJavaScript - MEDIUM
Query Selector All
Implement querySelectorAll for descendant-combinator selectors, returning matches in document order.
25 minJavaScript - MEDIUM
Resize Observer Mini
Build a polling-based ResizeObserver that reports elements whose content-box size has changed.
25 minJavaScript - MEDIUM
Tagged Template HTML
PREMIUMImplement an html tagged-template function that interpolates values safely into a DOM fragment.
25 minJavaScript - MEDIUM
Two-Way Binding
Wire an input and a model object so edits to either side stay in sync via events and a setter.
25 minJavaScript - MEDIUM
Virtual DOM Diff
PREMIUMImplement a diff that patches real DOM from an old vnode tree to a new one, minimizing changes.
25 minJavaScript - MEDIUM
Virtual DOM: createElement + render
PREMIUMImplement createElement to build a virtual DOM tree and render to turn it into real DOM nodes.
25 minJavaScript - HARD
Async Event Emitter
PREMIUMBuild an emitter whose emit awaits async listeners, with once, off, and serial or parallel dispatch.
40 minJavaScript - HARD
Drag & Drop Sortable
PREMIUMReorder a list by pointer drag, computing the target index from the cursor over item midpoints.
40 minJavaScript - HARD
getElementsByTagNameHierarchy
PREMIUMImplement a function that finds all DOM elements matching an ancestor-to-descendant tag-name hierarchy.
40 minJavaScript - HARD
HTML Tokenizer & Parser
PREMIUMTokenize an HTML string and build a nested node tree, handling attributes, void, and nested tags.
40 minJavaScript - HARD
Idle Task Scheduler
PREMIUMRun a queue of tasks in time-sliced batches, yielding between slices to keep the frame responsive.
40 minJavaScript - HARD
Keyed DOM Reconcile
PREMIUMReconcile two keyed child lists into a minimal set of DOM inserts, moves, and removals.
40 minJavaScript - HARD
Lowest Hiding Element
PREMIUMImplement a function that finds the deepest common ancestor whose hiding would conceal every target element.
40 minJavaScript - HARD
Reactive Proxy Signals
PREMIUMBuild reactive state with a Proxy that tracks reads and re-runs registered effects on write.
40 minJavaScript - HARD
Table of Contents
PREMIUMImplement a function that walks an HTML document's headings and builds a nested table of contents.
40 minJavaScript - HARD
Text Between Nodes
PREMIUMImplement a function that gathers the text content lying between two DOM nodes in document order.
40 minJavaScript - HARD
Tooltip Positioning Engine
PREMIUMCompute a tooltip's position around an anchor, flipping and shifting to stay inside the viewport.
40 minJavaScript - HARD
Virtual Scroll List
PREMIUMCompute the visible slice and spacer offsets to render only on-screen rows of a huge list.
40 minJavaScript - EASY
useBoolean
Implement a hook that exposes a boolean value alongside setTrue, setFalse, and toggle helpers.
15 minJavaScript - EASY
useClickAnywhere
Implement a hook that fires a callback whenever the user clicks anywhere in the window, cleaning up on unmount.
15 minJavaScript - EASY
useCopyToClipboard
Implement a hook returning the last copied text and an async copy function built on the Clipboard API.
15 minJavaScript - EASY
useCounter
Implement a hook that exposes a numeric count along with increment, decrement, and reset helpers.
15 minJavaScript - EASY
useCounter II
Rewrite useCounter so the returned helpers keep stable identities across renders.
15 minJavaScript - EASY
useCycle
Implement a hook that returns the current value of a sequence and advances to the next on demand.
15 minJavaScript - EASY
useCycleList
Implement a hook that steps through an array with wraparound, exposing the current item and next/prev/set.
15 minJavaScript - EASY
useDefault
Implement a hook that falls back to a default value whenever the underlying state becomes null or undefined.
15 minJavaScript - EASY
useDocumentTitle
Implement a hook that sets document.title and restores the previous title when the component unmounts.
15 minJavaScript - EASY
useEffectOnce
Implement a hook that runs the given effect a single time after mount, regardless of subsequent renders.
15 minJavaScript - EASY
useFavicon
Implement a hook that swaps the page favicon imperatively to a given URL.
15 minJavaScript - EASY
useFocus
Implement a hook that exposes a ref plus a function to focus the attached element on demand.
15 minJavaScript - EASY
useHover
Implement a hook that reports whether a referenced element is currently being hovered.
15 minJavaScript - EASY
useIsFirstRender
Implement a hook that returns true only on the first render and false on every render after.
15 minJavaScript - EASY
useIsMounted
Implement a hook returning a function that reports whether the component is still mounted, to guard async setState.
15 minJavaScript - EASY
useLatest
Implement a hook that returns a ref always holding the newest value, so callbacks and effects can read it without going stale.
15 minJavaScript - EASY
useLocalStorage
Implement a useState-like hook that persists to localStorage, with SSR-safe init and cross-tab sync.
15 minJavaScript - EASY
useObject
Implement a hook that holds an object in state and exposes helpers to merge updates or reset its value.
15 minJavaScript - EASY
usePrevious
Implement a hook that remembers and returns the value a state held on the previous render.
15 minJavaScript - EASY
useRenderCount
Implement a hook that counts how many times a component has rendered, without causing extra renders.
15 minJavaScript - EASY
useSessionStorage
Implement a useState-like hook backed by sessionStorage, with a graceful fallback when it is unavailable.
15 minJavaScript - EASY
useSet
Implement a hook that stores a Set in state and exposes add, delete, has, and clear helpers.
15 minJavaScript - EASY
useStateWithReset
Implement a useState-like hook that also returns a reset function which restores the initial value.
15 minJavaScript - EASY
useToggle
Implement a hook that holds a boolean and returns a stable toggle function to flip its value.
15 minJavaScript - EASY
useUpdateEffect
Implement a useEffect variant that skips the first render and fires only on subsequent updates.
15 minJavaScript - EASY
useWindowSize
Implement a hook that returns the current window width and height, updating on resize.
15 minJavaScript - MEDIUM
createGlobalState
Build a useState shared by every component that calls it, by subscribing React to a store that lives outside it.
25 minJavaScript - MEDIUM
createStore + useSelector
Build a store whose subscribers each re-render only when the slice they selected changes.
25 minJavaScript - MEDIUM
Plugin Hook Registry
Build a WordPress/Tapable-style hook system where plugins tap named actions and filters that run in priority order.
25 minJavaScript - MEDIUM
useArray
Implement a hook that manages an array along with helpers to push, remove, update, and clear items.
25 minJavaScript - MEDIUM
useAsync
Implement a hook that runs an async function and tracks its status, value, and error, with a manual execute trigger.
25 minJavaScript - MEDIUM
useAsyncRetry
Implement an async hook that exposes a retry function to re-run the last operation on demand.
25 minJavaScript - MEDIUM
useBoolean II
Implement an optimized useBoolean hook whose returned setters keep stable identity across renders.
25 minJavaScript - MEDIUM
useBreakpoint
Implement a hook that returns the active responsive breakpoint name derived from the current window width.
25 minJavaScript - MEDIUM
useClickOutside
Implement a hook that fires a callback when a pointer event lands outside a referenced element.
25 minJavaScript - MEDIUM
useControllableValue
PREMIUMImplement a hook that lets one component work both controlled and uncontrolled, deciding the mode from its props.
25 minJavaScript - MEDIUM
useCookieState
Implement a useState backed by a cookie — state the server can also write, with no event when it does.
25 minJavaScript - MEDIUM
useCountdown
Implement a hook that drives a countdown timer with start, pause, and reset controls.
25 minJavaScript - MEDIUM
useDebounce
PREMIUMImplement a hook that returns a debounced version of a value, updating only after a quiet period.
25 minJavaScript - MEDIUM
useDynamicList
Implement a hook that manages a list whose items keep stable keys across inserts, removals, and reorders.
25 minJavaScript - MEDIUM
useEventCallback
Implement a hook returning a stable callback that always sees the latest props and state, avoiding stale closures.
25 minJavaScript - MEDIUM
useEventListener
Implement a hook that attaches and cleans up a browser event listener on a target element or window.
25 minJavaScript - MEDIUM
useFetch
Implement a data-fetching hook exposing data, error, and loading, that refetches when the URL changes and ignores stale responses.
25 minJavaScript - MEDIUM
useGeolocation
Implement a hook wrapping the Geolocation API to expose position, error, and loading state.
25 minJavaScript - MEDIUM
useGetState
Implement a useState variant that also returns a getter for reading the newest state from inside stale closures.
25 minJavaScript - MEDIUM
useIdle
Implement a hook that flags the user as idle after a period without keyboard, pointer, or scroll activity.
25 minJavaScript - MEDIUM
useInputControl
Implement a hook that manages a controlled input value alongside its dirty and touched flags.
25 minJavaScript - MEDIUM
useIntersectionObserver
Implement a hook that reports whether a ref'd element is intersecting the viewport via IntersectionObserver.
25 minJavaScript - MEDIUM
useInterval
Implement a hook that runs a callback on a timer with a configurable, pauseable delay.
25 minJavaScript - MEDIUM
useKeyPress
Implement a hook that returns whether a given key is currently being pressed on the keyboard.
25 minJavaScript - MEDIUM
useList
Implement a hook managing an array with immutable helpers — push, removeAt, updateAt, insertAt, clear, and set.
25 minJavaScript - MEDIUM
useLongPress
Implement a hook that fires a callback after a pointer is held down past a delay, cancelling on early release or move.
25 minJavaScript - MEDIUM
useMap
Implement a hook that wraps a JavaScript Map with set, delete, and clear helpers backed by state.
25 minJavaScript - MEDIUM
useMediaQuery
Implement a hook that returns whether a media query currently matches and updates on changes.
25 minJavaScript - MEDIUM
useMediatedState
Implement a useState-like hook that runs every incoming value through a mediator before committing it.
25 minJavaScript - MEDIUM
useMethods
Implement a hook that turns a map of state transitions into bound, stable action methods over a reducer.
25 minJavaScript - MEDIUM
useNetworkState
Implement a hook that reports online/offline status and connection info from the Network Information API.
25 minJavaScript - MEDIUM
usePagination
Implement a hook that manages page state over a total count, exposing page, pageCount, and next/prev/go with clamping.
25 minJavaScript - MEDIUM
usePreviousDistinct
Implement a hook that remembers the last value that actually differed from the current one, with a customizable comparator.
25 minJavaScript - MEDIUM
useQuery
Implement a hook that tracks the loading, data, and error states of a promise-returning request.
25 minJavaScript - MEDIUM
useQueue
Implement a hook wrapping a FIFO queue with add, remove, clear, and first/last/size accessors.
25 minJavaScript - MEDIUM
useReactive
Implement a hook whose state object you mutate directly, and reckon with what that costs React.
25 minJavaScript - MEDIUM
useScript
Implement a hook that injects an external script tag and reports its loading status, deduping repeated sources.
25 minJavaScript - MEDIUM
useScrollPosition
Implement a hook that tracks the window scroll x/y position with a passive listener, throttled with rAF.
25 minJavaScript - MEDIUM
useSelections
Implement a hook that tracks a multi-select over a list, with an all/none/partial header state that stays honest.
25 minJavaScript - MEDIUM
useStateWithHistory
Implement a useState variant that records value history and exposes back, forward, and go over it.
25 minJavaScript - MEDIUM
useStep
Implement a hook that drives a multi-step flow with next, previous, reset, and bounded index controls.
25 minJavaScript - MEDIUM
useThrottle
PREMIUMImplement a hook that returns a throttled copy of a value, updating at most once per given interval.
25 minJavaScript - MEDIUM
useTimeout
Implement a hook that runs a callback after a given delay and cleans up when the component unmounts.
25 minJavaScript - MEDIUM
useUrlState
Implement a useState that lives in the query string, staying shareable without burying the back button.
25 minJavaScript - MEDIUM
useValidatedState
Implement a useState variant that reports whether the current value passes a validator, without an extra render.
25 minJavaScript - MEDIUM
useWhyDidYouUpdate
Implement a debugging hook that logs which props changed between renders.
25 minJavaScript - HARD
useDebouncedCallback
PREMIUMImplement a hook returning a debounced callback with cancel and flush, always calling the latest function.
40 minJavaScript - HARD
useDraggable
PREMIUMImplement a pointer-based drag hook that tracks an element's x/y offset with start/move/end handlers.
40 minJavaScript - HARD
useForm
PREMIUMImplement a form-state hook managing values, touched, errors, validation, and submission.
40 minJavaScript - HARD
useInfiniteScroll
PREMIUMImplement a hook that loads more pages when a sentinel element scrolls into view, guarding against duplicate loads.
40 minJavaScript - HARD
useResizeObserver
PREMIUMImplement a hook that reports a ref'd element's content-box size via ResizeObserver.
40 minJavaScript - HARD
useSWR
PREMIUMImplement a stale-while-revalidate data hook with an in-memory cache, dedup, and revalidation shared across components.
40 minJavaScript - HARD
useThrottledCallback
PREMIUMImplement a hook returning a throttled version of a callback that runs at most once per interval, with leading/trailing calls.
40 minJavaScript - HARD
useUndoRedo
PREMIUMImplement an undo/redo state hook exposing undo, redo, canUndo, canRedo over past/present/future stacks.
40 minJavaScript - HARD
useVirtualList
PREMIUMImplement a windowing hook that renders only the visible rows of a long list, with correct spacer offsets.
40 minJavaScript - HARD
useWebSocket
PREMIUMImplement a WebSocket hook exposing connection status, last message, and send, with auto-reconnect and cleanup.
40 minJavaScript - EASY
Avatar Group
Build a row of overlapping avatars that collapses the overflow into a plus-N badge.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Basic Autocomplete
Build an autocomplete input that filters a static list and lets you pick a suggestion.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Breadcrumbs
Build a breadcrumb trail from a path array, separating crumbs and marking the current page.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Character Counter Textarea
Build a textarea with a live character counter that warns as it nears a maximum length.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Color Swatch Picker
Build a swatch color picker where clicking a swatch selects it and previews the chosen color.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Contact Form
Build a contact form that posts the user's name, email, and message to a backend endpoint.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Copy to Clipboard Button
Build a button that copies text to the clipboard and shows a transient copied confirmation.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Countdown Timer
Build a countdown timer that ticks down from a start time and can start, pause, and reset.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Counter
Build a counter component that increments a displayed number each time a button is clicked.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
FAQ Disclosure
Build a list of FAQ questions that each expand to reveal an answer on click.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Flight Booker
Build a small form that books either a one-way or return flight, with validation tying the two date fields together.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Generate Table
Build a component that renders a table of sequential numbers given a row count and a column count.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Holy Grail
Build the classic holy grail page layout with a header, footer, and three columns of content.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Like Button
Build a Like button that toggles between liked and unliked states with matching visual feedback.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Modal Dialog
Build a reusable modal dialog component that you can open from a trigger and close with a button.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Mortgage Calculator
Build a calculator that computes the monthly payment for a loan based on principal, rate, and term inputs.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Pagination UI
Build pagination controls with previous/next and numbered pages that report the current page.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Password Strength Meter
Build a password field with a live strength meter that scores the input as you type.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Progress Bar
Build a progress bar component that visualizes the percentage completion of an operation.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Progress Bars
Build a component that renders a list of progress bars which animate from empty to full as they mount.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Segmented Control
Build a segmented control where clicking a segment selects it and highlights the active option.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Temperature Converter
Build a widget that converts between Celsius and Fahrenheit, updating either field as the other changes.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Toast Notification
Build a toast that appears on trigger and auto-dismisses after a few seconds, with manual close.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Toggle Switch
Build an on/off toggle switch that flips state on click and slides its knob to reflect it.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Tooltip
Build a tooltip that shows on hover/focus of a trigger and hides on leave/blur.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Traffic Light
Build a traffic light that cycles green to yellow to red on a timer and loops indefinitely.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Tweet
Build a static tweet component that mirrors the layout of a single post on Twitter.
15 minUI / FrameworksAngularReactHTML / CSS / JSVue - EASY
Accordion
Build an accordion component with stacked sections whose content panels expand and collapse on click.
20 minUI / FrameworksGoogle · Amazon · MetaAngularReactHTML / CSS / JSVue - MEDIUM
Accordion II
Build an accordion component with the correct ARIA roles, states, and properties for screen readers.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Analog Clock
Build an analog clock whose hour, minute, and second hands move smoothly to reflect the current time.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Async Autocomplete
Build an autocomplete that debounces typing, fetches matching results from an API, and handles loading and stale responses.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Autoplay Carousel
Build an image carousel that auto-advances on a timer, pauses on hover, and has manual controls.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Birth Year Histogram
Build a widget that fetches birth year data from an API and renders it as a histogram of bucketed counts.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Combobox
PREMIUMBuild an editable combobox that filters options as you type and supports full keyboard selection.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Command Palette
PREMIUMBuild a keyboard-driven command palette with fuzzy search and arrow-key navigation.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Connect Four
Build a two-player Connect Four game where discs fall to the lowest empty slot and four-in-a-row wins.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Currency Converter
Build a currency converter with two linked amount fields that recompute from an exchange rate.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Data Table
Build a users data table that paginates rows with page-size and page-navigation controls.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Data Table II
Build a users data table that lets you sort by any column in ascending or descending order.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Date Picker
PREMIUMBuild a calendar date picker that renders a month grid, navigates between months, and selects a day.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Dice Roller
Build a dice roller that lets you pick a count of six-sided dice, roll them, and display the resulting faces.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Digital Clock
Build a 7-segment style digital clock that updates to display the current time.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Dropdown Menu
Build an accessible dropdown menu that opens on click, closes on outside-click and Escape, and supports arrow-key navigation.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Emoji Picker
Build an emoji picker with category tabs and a search filter that inserts the chosen emoji.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
File Explorer
Build a file explorer that renders a nested folder hierarchy and lets you expand and collapse directories.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
File Explorer II
Build a file explorer that exposes the correct ARIA tree roles, states, and properties for assistive tech.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
File Explorer III
Build a file explorer that renders the tree as a flat DOM list while preserving nested visual structure.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Grid Lights
Build a grid of cells that light up on click and then deactivate one by one in the reverse order they were activated.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Heatmap Calendar
Build a contribution-style heatmap calendar that colors each day cell by its activity value.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Image Carousel
Build an image carousel that lets you page through a sequence of images with previous and next controls.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Image Carousel II
Build an image carousel with smooth slide transitions between images.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Infinite Scroll List
Build a list that loads more items as the user scrolls near the bottom using an observer.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Job Board
Build a job board that fetches and renders recent Hacker News job postings with paginated loading.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Kanban Board
PREMIUMBuild a three-column board where cards drag between columns and each column's count updates.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Memory Game
Build a memory card-matching game where players flip cards to find matching pairs.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Modal Dialog II
Build a modal dialog with the correct ARIA roles, states, and properties for assistive technology.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Modal Dialog III
Build a modal dialog that closes via the close button, backdrop click, and the Escape key.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Multi-Select
Build a multi-select where chosen options become removable chips and the rest stay in the list.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Multi-Step Form
Build a wizard form with next/back navigation, per-step validation, and a progress indicator.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Nested Comments
PREMIUMBuild a threaded comments tree where each comment can be replied to and collapsed recursively.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Notification Center
Build a notification center with an unread badge, mark-as-read, and dismiss.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
OTP Input
Build a one-time-code input of separate boxes with auto-advance, backspace, and paste handling.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Pixel Art
Build a pixel art editor where you pick a color from a palette and paint individual cells on a grid canvas.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Progress Bars II
Build a list of progress bars that fill in sequence, each one starting only after the previous bar finishes.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Progress Bars III
Build a list of progress bars that fill concurrently with at most three running at the same time.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Range Slider
Build a dual-handle range slider that picks a min and max value by dragging each handle.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Resizable Split Pane
Build two panes split by a draggable divider that resizes them within min and max bounds.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Shopping Cart
Build a cart where quantity changes update line totals and a grand total live.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Signup Form
Build a signup form that validates user details on submit and posts them to a back-end API.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Snake Game
PREMIUMBuild the classic snake game on a grid with keyboard control, growth on eating, and game over.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Sortable List
PREMIUMBuild a list whose items reorder by dragging, with a live drop indicator.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Star Rating
Build an interactive star rating with hover preview and half-star support.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Star Rating
Build a star rating component where users click a star to set the rating shown by filled icons.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Stopwatch
Build a stopwatch widget that measures elapsed time with start, stop, and reset controls.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Tabs
Build a tabs component that shows one panel at a time based on the currently selected tab.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Tabs II
Build a tabs component with the correct ARIA roles, states, and properties for assistive tech.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Tic-tac-toe
Build a two-player tic-tac-toe game that detects wins and draws on a 3x3 board.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Todo List
Build a Todo List component with add and delete actions, with focus on functionality over styling.
25 minUI / FrameworksGoogle · Meta · MicrosoftAngularReactHTML / CSS / JSVue - MEDIUM
Transfer List
Build a component that moves selected items back and forth between two side-by-side lists.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Undoable Counter
Build a counter that keeps a history of values so you can undo and redo each change.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Users Database
Build a CRUD interface to list, filter, create, edit, and delete users backed by local state.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - MEDIUM
Whack-A-Mole
Build the arcade game where moles randomly appear in a grid and players click them to score.
25 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Accordion III
PREMIUMBuild a fully accessible accordion with keyboard navigation per the ARIA authoring practices guide.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Auth Code Input
PREMIUMBuild a six-cell auth code input that handles typing, paste, backspace, and arrow-key navigation across fields.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Autocomplete III
PREMIUMBuild a production autocomplete with async fetch, debounce, keyboard navigation, caching, and match highlighting.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Calendar Scheduler
PREMIUMBuild a week-view scheduler where events render in time slots and can be added by clicking a slot.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Data Table III
PREMIUMBuild a generic, reusable data table that supports column-driven sorting and pagination for any dataset.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Data Table IV
PREMIUMBuild a generalized data table component that supports pagination, column sorting, and per-column filtering.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Data Table V
PREMIUMBuild a data table with sortable columns, pagination, and row selection over a dataset.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Gantt Chart
PREMIUMBuild a Gantt chart that renders tasks as bars positioned across a timeline by start and duration.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Image Carousel III
PREMIUMBuild an image carousel that smoothly transitions between images while keeping the DOM footprint minimal.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Image Cropper
PREMIUMBuild an image cropper with a draggable, resizable crop region over an image.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Lazy Tree View
PREMIUMBuild a collapsible tree that lazily loads a node's children the first time it is expanded.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Minesweeper
PREMIUMBuild Minesweeper with flood-fill reveal, flagging, and win/lose detection.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Modal Dialog IV
PREMIUMBuild a fully accessible modal dialog with focus trapping, focus restoration, and keyboard support.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Nested Checkboxes
PREMIUMBuild a nested checkbox tree where parent state reflects its children and toggling a parent cascades down.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Progress Bars IV
PREMIUMBuild progress bars that fill concurrently up to three at a time, and let the user pause and resume each one.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Realtime Search with Cache
PREMIUMBuild a search box that caches results per query and dedupes in-flight requests.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Rich Text Editor
PREMIUMBuild a contenteditable rich-text editor with bold/italic/list formatting and a live toolbar state.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Selectable Cells
PREMIUMBuild a grid where you click and drag across cells to select a rectangular range of them.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Spreadsheet Grid
PREMIUMBuild a grid of cells with formula evaluation and dependent-cell recalculation.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Tabs III
PREMIUMBuild a fully accessible tabs component with arrow-key navigation per the ARIA authoring guide.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Tetris
PREMIUMBuild Tetris with falling tetrominoes, rotation, line clears, and scoring.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Tic-tac-toe II
PREMIUMBuild a generalized tic-tac-toe game on an N x N board where M consecutive marks wins.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Transfer List II
PREMIUMBuild a transfer list with bulk select, deselect, and the ability to add new items to either side.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Virtualized List
PREMIUMBuild a windowed list that renders only the visible rows of a large dataset for smooth scrolling.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue - HARD
Wordle
PREMIUMBuild the Wordle word-guessing game with row-by-row guesses and per-letter color feedback.
40 minUI / FrameworksAngularReactHTML / CSS / JSVue