Practice mode

Pick a question. Write code. Get it stuck in your head.

Your code autosaves per question. Come back tomorrow and your half-finished attempt is still here.

JavaScripthard

Async Task Pool — Run Promises with a Concurrency Limit

Run many async tasks but cap how many run at once. The classic concurrency-limiting question covering Promise.race, queues, and backpressure.

Reactmedium

Build a useDebounce Hook — Debounce a Value in React

Write a useDebounce React hook that returns a value only after it stops changing for a delay. Covers useEffect cleanup, timers, and dependency arrays.

Reactmedium

Build a useFetch Hook — Data Fetching with Cleanup

Write a useFetch React hook returning { data, error, loading }, with cleanup that ignores stale responses and aborts in-flight requests. Covers race conditions and AbortController.

Reacteasy

Build a usePrevious Hook — Track a Value's Last Render

Write a usePrevious React hook that returns a prop or state value from the previous render. Covers useRef, render vs effect timing, and why refs survive renders.

JavaScriptmedium

Implement an EventEmitter — on, off, emit, once

Build a pub/sub EventEmitter with on, off, emit, and once. Covers the observer pattern, Map/Set storage, and safe removal during emit.

JavaScripteasy

Implement chunk(arr, size) — Split an Array into Groups

Split an array into consecutive chunks of a given size, handling a ragged last chunk and invalid sizes. A quick array-manipulation warm-up.

JavaScripteasy

Implement classNames() — The clsx Utility

Recreate the classnames/clsx helper: join strings, arrays, and conditional objects into a single className string. A practical React-adjacent question.

JavaScriptmedium

Implement compose and pipe — Function Composition

Build compose (right-to-left) and pipe (left-to-right) to chain unary functions. Covers reduce, reduceRight, and functional pipelines.

JavaScriptmedium

Implement curry(fn) — Currying in JavaScript

Build a curry function that collects arguments until the original function's arity is met, then invokes it. Covers fn.length, closures, and partial application.

JavaScriptmedium

Implement debounce(fn, wait) — Frontend Interview Question

The most-asked JavaScript interview question. Implement debounce with cancel, leading-edge, and trailing-edge options. Covers closures, this binding, and edge cases.

JavaScripthard

Implement deepClone(obj) — Handle Cycles, Maps, Sets, Dates

Senior-level JavaScript interview question. Build a deep clone that handles circular references, Date, Map, Set, RegExp, and symbol keys — without using structuredClone.

JavaScriptmedium

Implement deepEqual(a, b) — Structural Equality

Write a deep equality check for nested objects and arrays, handling primitives, key counts, and recursion. A common follow-up to deep clone.

JavaScripteasy

Implement flatten(arr, depth) — Flatten a Nested Array

Flatten an arbitrarily nested array to a given depth without using Array.prototype.flat. Covers recursion, reduce, and depth control.

JavaScriptmedium

Implement get(obj, path, default) — Safe Deep Access

Recreate lodash.get: read a nested value by a dot/bracket path string or array, returning a default when the path is missing. Covers parsing and safe traversal.

JavaScripteasy

Implement groupBy(arr, key) — Group an Array

Group an array of items into buckets by a key function or property name. A clean reduce question that mirrors lodash.groupBy.

JavaScripteasy

Implement memoize(fn) — Cache Results Without Breaking the Contract

Implement a memoize function that caches results of function calls to avoid re-computation — while preserving `this`, handling tricky argument types, and respecting the original function's contract.

JavaScripteasy

Implement once(fn) — Run a Function a Single Time

Write once so a function runs at most once and returns the cached result on every later call. A clean closures warm-up.

JavaScriptmedium

Implement Promise.all — Frontend Interview Question

Reimplement Promise.all from scratch: resolve with an ordered results array, reject on the first failure, and handle non-promise values and the empty case.

JavaScriptmedium

Implement retry(fn, retries, delay) — Retry a Promise

Retry a promise-returning function on failure with exponential backoff. Covers recursion over promises, backoff, and stopping conditions.

JavaScriptmedium

Implement throttle(fn, wait) — Frontend Interview Question

Implement throttle so a function fires at most once per time window. Covers leading vs trailing edges, this binding, and how it differs from debounce.