JavaScript interview questions
406 questions in JavaScript, from warm-ups to staff-level problems — solved in a real workspace with instant test feedback.
406 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 XOR (Symmetric Difference)
Implement lodash xor — return the values that appear in exactly one of the given arrays, with duplicates removed.
20 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
Async CountDown Latch
Implement a countdown latch whose wait resolves once countDown has been called the required number of times.
15 minJavaScript - 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
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
Compose
Implement a function that composes functions right-to-left so the output of each feeds into the next.
15 minJavaScript - EASY
Cookie Store
Implement get/set/remove over document.cookie, handling encoding and expiry.
15 minJavaScript - EASY
Cursor Pagination Fetcher
Fetch successive pages with an opaque cursor, accumulating items and tracking whether more remain.
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
Data Merging
Implement a function that consolidates rows sharing the same user into a single grouped record.
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
Deep Clone DOM
Implement a deep clone of a DOM node and its subtree (element, text, and attributes) without cloneNode.
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
DOM Tree Height
Implement a function that returns the height (max depth) of a DOM element's subtree.
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
Event Delegation
Implement a delegated event listener that matches events bubbling up from descendants against a selector.
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 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
From Pairs
Implement a function that builds an object from an array of [key, value] pair tuples.
15 minJavaScript - EASY
Function Length
Implement a function that returns the number of declared parameters of a given function.
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
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
jQuery.css
Implement a jQuery-style helper that gets or sets inline CSS properties on a DOM element.
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
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
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
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
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
Number of Arguments
Implement a function that returns the count of arguments passed to it at call time.
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
Object.is
Implement Object.is — same-value equality that treats NaN as equal to itself and keeps +0 distinct from -0.
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
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 - 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
Size
Implement a function that returns the element count of any collection — array, string, object, Map, or Set.
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
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.repeat
Implement String.prototype.repeat — join a string n times, throwing RangeError on a negative or infinite count.
15 minJavaScript - EASY
String.prototype.trim
Implement String.prototype.trim — strip leading and trailing whitespace, including Unicode whitespace, from a string.
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
Traverse DOM (BFS)
Implement a breadth-first traversal of a DOM tree, returning elements level by level.
15 minJavaScript - EASY
Type Utilities
Implement a set of helper functions that report the primitive type of any JavaScript value.
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 - EASY
Unique Array
Implement a function that returns a new array with duplicate values removed while preserving original order.
15 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 - EASY
without
Implement without — return a copy of an array with the given values excluded, matched by SameValueZero.
15 minJavaScript - MEDIUM
A/B Test Bucketing
Assign users to weighted experiment variants deterministically, with a traffic gate and independent buckets per experiment.
25 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
Analytics Event SDK
PREMIUMBuild an analytics client that queues tracked events, flushes them in batches, and retries failed sends with backoff.
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
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
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.myReduce
PREMIUMImplement Array.prototype.myReduce — the reduce method from scratch, including the empty-array + initial-value edge cases.
20 minJavaScriptGoogle · Meta · Amazon - 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
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
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
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
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
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
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
Camel Case Keys
Implement a function that returns a new object with every key converted to camelCase, recursing into nested objects.
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
Case Converters
Convert any string between camelCase, snake_case, kebab-case, and PascalCase by tokenizing it into words first.
35 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
Class Variance Authority
Implement a simplified cva that builds class names from base styles, variant tables, and default values.
25 minJavaScript - MEDIUM
classNames
Implement a utility that conditionally joins class name arguments into a single space-separated string.
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
Console Log History
Implement a wrapper that intercepts console.log calls and records their arguments for later inspection.
25 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
Count By
Implement a function that tallies how many array elements map to each key produced by an iteratee.
25 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
CSS Selector Matches
Implement Element.matches: test whether an element satisfies a compound CSS selector (tag, id, class, attribute).
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
Curry IV
PREMIUMExtend curry with placeholder support, so arguments can be supplied in any position across calls.
40 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
Deep Clone
PREMIUMImplement a function that recursively clones a JSON-serializable value without sharing references.
25 minJavaScript - MEDIUM
Deep Freeze
Recursively freeze an object and every nested object and array, making the whole structure deeply immutable.
25 minJavaScript - MEDIUM
Deep Map
PREMIUMImplement a function that walks an arbitrarily nested structure and applies a transform to every leaf value.
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
Dependency Injection Container
Build a DI container that resolves a service dependency graph, caches singletons, and detects circular dependencies.
25 minJavaScriptGoogle · Microsoft · Uber - MEDIUM
DOM Method Chaining
PREMIUMBuild a jQuery-style wrapper whose methods return this so calls like addClass().text() chain.
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
ETag Revalidation Cache
Cache responses by URL and revalidate with an ETag, reusing cached data on a 304 Not Modified.
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
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
Feature Flag Client
PREMIUMEvaluate feature flags with targeting rules and a deterministic percentage rollout that stays sticky per user.
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
Flatten
Implement a function that recursively flattens a nested array into a single-level array.
25 minJavaScript - MEDIUM
flow
Implement flow — compose functions left to right so each output feeds the next.
25 minJavaScript - MEDIUM
Form Serialize
PREMIUMSerialize a form's fields into a nested object, handling checkboxes, multi-selects, and bracket names.
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
Function.prototype.apply
Implement Function.prototype.myApply — invoke the function with a given `this` and an array of arguments.
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
Function.prototype.call
Implement Function.prototype.myCall — invoke the function with a given `this` and a list of arguments.
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
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
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
Group By
Implement a function that buckets array elements into an object keyed by the value an iteratee returns for each.
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
HTML Serializer
Implement a function that serializes a tree-shaped object into a pretty-printed HTML string with indentation.
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
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
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
Identical DOM Trees
Implement a function that recursively compares two DOM trees and returns whether they are structurally equal.
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
instanceof
PREMIUMImplement an instanceof check — walk the prototype chain to see whether a constructor's prototype appears in it.
40 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
IntersectionObserver Polyfill
Implement a scroll/resize-driven fallback that reports when observed elements enter the viewport.
25 minJavaScript - MEDIUM
invert
Implement invert and invertBy — swap an object's keys and values, grouping collisions with invertBy.
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
Is Empty
Implement a function that decides whether a value is empty across arrays, strings, objects, Maps, Sets, and primitives.
20 minJavaScript - MEDIUM
Iterator Helpers
Build lazy, chainable iterator helpers — map, filter, take, drop, and flatMap — that pull one value at a time.
35 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
JSON.stringify
PREMIUMImplement a function that converts a JavaScript value into its JSON string representation.
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
Limit
Implement a function that wraps a callback so it runs at most N times and returns the last result thereafter.
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
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
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
LWW Register / Map CRDT
PREMIUMBuild a last-write-wins map whose entries merge by timestamp with a deterministic node-id tiebreak.
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
Map Async
Implement a function that applies an async mapper to every item in an array and resolves with the results.
25 minJavaScript - MEDIUM
mapKeys / mapValues
Implement mapKeys and mapValues — transform an object's keys or values while preserving its structure.
25 minJavaScript - MEDIUM
Markdown Parser
PREMIUMParse a subset of Markdown (headings, bold, italics, links, code) into an HTML string.
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
Microtask Batch Scheduler
Coalesce all schedule calls made in one synchronous frame into a single flush on the next microtask.
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 Object-relational Mapper
Build a simplified in-memory ORM with model delegates that expose basic CRUD operations.
25 minJavaScript - MEDIUM
Mini Object-relational Mapper II
Extend a simplified in-memory ORM with richer filtering predicates and multi-field sorting.
25 minJavaScript - MEDIUM
Mini Redux
PREMIUMBuild a Redux core with createStore, combineReducers, and applyMiddleware over a subscribe/dispatch loop.
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
negate / overEvery
Implement negate, overEvery, and overSome — build new predicates by combining existing ones.
25 minJavaScript - MEDIUM
Node Registry
Implement a registry that associates values with DOM nodes without leaking memory once nodes are gone.
25 minJavaScript - MEDIUM
Normalized Entity Cache
Store entities flat by id, normalizing nested relations and merging updates immutably.
25 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
Object.assign
Implement Object.assign — copy own enumerable string and symbol properties from sources onto a target, skipping nullish.
25 minJavaScript - MEDIUM
Object.create
PREMIUMImplement Object.create — make a new object with a given prototype and optional property descriptors.
40 minJavaScript - MEDIUM
Observable Store
Build a tiny state store with getState, setState, and subscribe that notifies listeners on change.
25 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
OR-Set CRDT
Build an observed-remove set where a concurrent add and remove converge with the add winning.
25 minJavaScript - MEDIUM
orderBy
Implement orderBy — stably sort objects by multiple keys, each ascending or descending.
25 minJavaScript - MEDIUM
partial
Implement partial and partialRight — pre-fill some of a function's arguments, with placeholder support.
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
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
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
Poll Until
Implement pollUntil — call an async function on an interval until a predicate passes or a timeout elapses.
25 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
Promise Merge
Implement a function that combines the results of two promises into a single value using a merger function.
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 Timeout
Implement a function that races a promise against a timer and rejects if the promise doesn't settle in time.
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
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
PubSub with Wildcards
Implement an event bus whose subscriptions support wildcard segments matching any single topic level.
25 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
Query Selector All
Implement querySelectorAll for descendant-combinator selectors, returning matches in document order.
25 minJavaScript - MEDIUM
Rate Limiter
Implement a sliding-window rate limiter that decides which task timestamps fit within the allowed quota.
25 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 - 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
Resize Observer Mini
Build a polling-based ResizeObserver that reports elements whose content-box size has changed.
25 minJavaScript - MEDIUM
Resumable Interval
Implement an interval helper that exposes start, pause, and resume controls while preserving elapsed progress.
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
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
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
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
Shuffle / Sample Size
Implement lodash shuffle and sampleSize with an unbiased Fisher-Yates swap, taking an injectable RNG so shuffles are testable.
30 minJavaScript - MEDIUM
Signals (signal / computed / effect)
PREMIUMBuild reactive signals with automatic dependency tracking so computed values and effects update on change.
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
Singleton
Implement a Singleton class that always hands back the same instance no matter how many times you construct it.
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
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
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
Squash Object
Implement a function that flattens a nested object into a single-level object using dot-delimited keys.
25 minJavaScript - MEDIUM
SSE Frame Decoder
PREMIUMDecode a Server-Sent Events stream arriving in arbitrary chunks into discrete parsed events.
25 minJavaScript - MEDIUM
Stale-While-Revalidate Cache
PREMIUMReturn cached data instantly, serving stale values while revalidating them in the background.
25 minJavaScript - MEDIUM
Streaming Chat Store Reducer
PREMIUMBuild a pure, immutable reducer that opens an assistant message, appends streamed deltas, and finalizes it.
25 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 - 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
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
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
Tagged Template HTML
PREMIUMImplement an html tagged-template function that interpolates values safely into a DOM fragment.
25 minJavaScript - MEDIUM
Task Runner with Dependencies
Run async tasks in dependency order, executing independent ones in parallel and catching cycles.
30 minJavaScript - MEDIUM
Template Engine
Implement a template renderer that substitutes Mustache-style placeholders with values from a data object.
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
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
Text Search II
Implement a function that wraps every occurrence of any term from a list inside highlight markup.
25 minJavaScript - MEDIUM
The new Operator
PREMIUMImplement newOperator — reproduce the four steps the new keyword performs, honoring the object-return override.
30 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
Throttle
Implement a function that limits how often a wrapped function can be invoked within a time window.
15 minJavaScriptGoogle · Amazon · Meta - MEDIUM
Throttle II
PREMIUMExtend throttle with cancel and flush methods plus leading and trailing edge options.
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
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
Turtle
Build a Turtle class that tracks position and heading as you issue movement and turn commands on a 2D plane.
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
Type Utilities II
Implement helpers that accurately identify non-primitive JavaScript values such as arrays, plain objects, dates, and maps.
25 minJavaScript - 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 By
Implement a function that returns unique values across input arrays using a custom iteratee to determine identity.
25 minJavaScript - MEDIUM
Unsquash Object
Implement a function that rebuilds a nested object from a flat map of dot-delimited keys.
25 minJavaScript - MEDIUM
URLSearchParams
Implement a URLSearchParams-style class with get, getAll, append, set, and toString over an encoded query string.
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 - MEDIUM
Vector Clocks
PREMIUMOrder distributed events with vector clocks, detecting whether two events are causal or concurrent.
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 - 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 - MEDIUM
zip / unzip
Implement zip, unzip, and zipObject — interleave arrays into tuples and back, padding ragged lengths.
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
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
Backbone Model
PREMIUMImplement a Backbone-style Model class that stores attributes and emits change events per key.
40 minJavaScript - HARD
classNames II
PREMIUMExtend the classNames utility to dedupe class names and resolve function arguments lazily.
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
Data Selection
PREMIUMImplement a function that filters an array of row objects by a flexible field-and-condition specification.
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
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
Drag & Drop Sortable
PREMIUMReorder a list by pointer drag, computing the target index from the cursor over item midpoints.
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
Drizzle Query Builder III
PREMIUMExtend an in-memory query builder inspired by Drizzle with innerJoin and leftJoin between related tables.
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
Immer produce()
PREMIUMImplement produce so mutating a draft proxy yields a new immutable state with structural sharing.
40 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
JSON.stringify II
PREMIUMImplement JSON.stringify with full spec support including replacer, indentation, and circular reference detection.
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
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 - HARD
Mini MobX
Build MobX-style observables with autorun and computed that re-run when the data they read changes.
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
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
Operational Transform (Text)
PREMIUMTransform concurrent insert and delete operations so replicas converge to the same text.
40 minJavaScript - HARD
Optimistic Mutation Manager
PREMIUMApply optimistic updates immediately and roll them back on failure, even with concurrent mutations.
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
Reactive Proxy Signals
PREMIUMBuild reactive state with a Proxy that tracks reads and re-runs registered effects on write.
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
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
RxJS-Lite Pipeable Operators
PREMIUMBuild a mini reactive-streams library: a cold Observable and pipeable operators composed with a .pipe() chain.
50 minJavaScript - HARD
Schema Validator III
PREMIUMExtend a tiny schema validator to handle nested object and array shapes plus optional fields.
40 minJavaScript - HARD
Sequence CRDT (RGA)
PREMIUMBuild a replicated growable array for text whose positional-id inserts and deletes converge across replicas.
40 minJavaScript - HARD
Spreadsheet III
PREMIUMBuild a spreadsheet that recomputes dependent cells when inputs change and detects circular references.
40 minJavaScript - HARD
Statechart Engine (XState-lite)
PREMIUMBuild a state-machine engine with events, guards, entry and exit actions, and context updates.
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
structuredClone
PREMIUMImplement structuredClone — deep-clone a value including Map, Set, Date, RegExp, typed arrays, and 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
Styled Text Ranges IV
PREMIUMImplement a function that patches shallow style objects over a text range without clobbering unrelated keys.
40 minJavaScript - HARD
Superjson
PREMIUMImplement serialize and deserialize helpers that round-trip values like Date, Map, Set, and BigInt through JSON.
40 minJavaScript - HARD
Superjson II
PREMIUMBuild serialize and deserialize that preserve referential identity — shared references and circular structures round-trip intact.
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
Test Runner IV
PREMIUMExtend a tiny test runner so it correctly awaits asynchronous specs and asynchronous setup or cleanup hooks.
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
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 - 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 - HARD
Virtual Scroll List
PREMIUMCompute the visible slice and spacer offsets to render only on-screen rows of a huge list.
40 minJavaScript