Deliberate practice
Turn concepts into instincts.
76 challenges across 10 topics. Solve, run automated checks, inspect failures, and compare approaches after you've tried.
21 broken-code exercises covering syntax, reference, type, scope, async, and mutation bugs.
Sum Two Numbers
Return the sum of two numbers passed as arguments.
Temperature Converter
Convert a Celsius temperature to Fahrenheit using F = C * 9/5 + 32.
Calculate Discount
Return the final price after applying a percentage discount.
Even or Odd
Return "even" or "odd" for a given integer.
Positive, Negative, or Zero
Return "positive", "negative", or "zero" for a number.
Largest of Three Numbers
Return the largest of three numbers.
Leap Year Checker
Return true if a year is a leap year (divisible by 4, but not by 100 unless also by 400).
Grade Calculator
Convert a numeric score (0-100) into a letter grade: A (90+), B (80+), C (70+), D (60+), else F.
Reverse a String
Return the supplied text in reverse order.
Count Characters
Return the number of characters in a string, including spaces.
Count Vowels
Count vowels (a, e, i, o, u) regardless of letter case.
Palindrome Check
Ignore case and non-alphanumeric characters, then detect whether the text is a palindrome.
Capitalize Words
Capitalize the first letter of every word in a sentence.
Remove Spaces
Remove all whitespace from a string.
Character Frequency
Return an object counting how many times each character appears in a string.
Longest Word
Return the longest word in a sentence.
String Compression
Compress consecutive repeated characters, e.g. 'aaabcc' → 'a3b1c2'. Only compress runs of length 1+.
Anagram Checker
Return true if two strings are anagrams of each other, ignoring case and spaces.
Find Maximum
Return the largest number in an array without sorting the input.
Find Minimum
Return the smallest number in an array.
Sum Array
Return the sum of all numbers in an array.
Average Array
Return the average of the numbers in an array, or 0 for an empty array.
Remove Duplicates
Return a new array containing each value once, preserving first-seen order.
Second Largest
Return the second largest distinct value in an array of numbers.
Reverse Array
Return a new array with the elements in reverse order, without mutating the input.
Flatten an Array
Flatten an arbitrarily nested array into one flat array.
Chunk Array
Split an array into chunks of a given size, with the last chunk possibly smaller.
Rotate Array
Rotate an array to the right by k positions.
Array Intersection
Return the values that appear in both arrays, without duplicates.
Array Difference
Return the values in the first array that do not appear in the second.
Unique Values by Key
Given an array of objects, return one object per distinct value of a given key, keeping the first occurrence.
Calculator Function
Write calculate(a, b, operator) supporting "+", "-", "*", "/".
Callback Exercise
Write applyOperation(a, b, callback) that calls callback with a and b and returns the result.
Higher-Order Function
Write withCallCount(fn) returning a wrapped function that tracks how many times it has been called via a .calls property.
Function Composition
Write compose(...fns) returning a function that applies the given functions right-to-left.
Custom Map
Reimplement Array.prototype.map as myMap(array, callback) without using the built-in .map.
Custom Filter
Reimplement Array.prototype.filter as myFilter(array, predicate) without using the built-in .filter.
Custom Reduce
Reimplement Array.prototype.reduce as myReduce(array, reducer, initialValue) without using the built-in .reduce.
Object Property Counter
Return the number of own properties on an object.
Group Users by Role
Group an array of users into an object keyed by their role.
Merge Objects
Merge two objects into a new one; properties in the second override the first.
Deep Property Lookup
Write getPath(obj, "a.b.c") that safely reads a dot-separated nested path, returning undefined if any part is missing.
Transform API Data
Given raw API-shaped records { id, first_name, last_name }, return { id, fullName } objects.
Inventory Calculator
Given an array of { name, price, quantity } items, return the total inventory value.
FizzBuzz
Return "Fizz" for multiples of 3, "Buzz" for multiples of 5, "FizzBuzz" for both, else the number.
Factorial
Return n! (the product of all positive integers up to n). 0! is 1.
Fibonacci
Return the nth Fibonacci number (0-indexed: fib(0) = 0, fib(1) = 1).
Prime Checker
Return true if a number is prime.
Binary Search
Return the index of a target in a sorted array, or -1 if not found, using binary search.
Linear Search
Return the index of the first occurrence of a target value, or -1 if not found.
Bubble Sort
Implement bubble sort: repeatedly swap adjacent out-of-order elements until the array is sorted ascending.
Frequency Counter Pattern
Using the frequency counter pattern (not nested loops), return true if two arrays contain the same values with the same frequency, regardless of order.
Two Sum
Return the indices of the two numbers that add up to a target, using a single pass (not nested loops).
Missing Number
Given an array containing n distinct numbers from 0 to n, return the one number missing from the range.
Destructuring Challenge
Write summarizeUser(user) that destructures name and a defaulted role ('learner') and returns a summary string.
Spread / Rest Challenge
Write sum(...numbers) using rest parameters to add any number of arguments.
Optional Chaining
Write getCity(user) that safely returns user.address.city, or undefined if address is missing, using optional chaining.
Closures Challenge
Write makeCounter(start) returning { increment, decrement, value } that all share one private counter.
Implement Memoize
Cache a pure function's results by its arguments so repeated calls avoid repeated work.
Implement Debounce
Return a debounced wrapper that delays calling fn until calls have stopped for `delay` ms.
Implement Throttle
Return a throttled wrapper that calls fn at most once per `interval` ms, running immediately on the first call.
Promise Chain
Write doubleThenAddOne(value) that wraps value in a Promise, doubles it, then adds one, using .then() chaining.
Promise.all Aggregation
Write sumResolved(promises) that awaits every Promise in the array concurrently and returns their sum.
Sequential Fetching
Write fetchSequential(ids, fetcher) that awaits fetcher(id) for each id one at a time, in order, returning the results array.
Parallel Fetching
Write fetchParallel(ids, fetcher) that starts every fetcher(id) call concurrently and returns results in the original id order.
Async Retry
Write retry(fn, attempts) that calls fn() (which returns a Promise), retrying on rejection up to `attempts` total tries before finally rejecting.
Fetch Error Handling
Write safeFetchJSON(fetchImpl, url) that awaits fetchImpl(url), throws if response.ok is false, and otherwise returns the parsed JSON.
Timeout Wrapper
Write withTimeout(promise, ms) that resolves/rejects with the original promise, or rejects with an Error if it takes longer than ms.
Counter Logic
Write createCounter(start) returning { increment, decrement, value } — the state logic behind a UI counter button.
Character Counter Logic
Write charsRemaining(text, limit) returning how many characters remain before a max-length limit, never negative.
Toggle State
Write toggleClassList(classes, className) that adds className if absent, or removes it if present, returning the new array.
Form Validation Logic
Write validateSignupForm({ email, password }) returning an errors object with a message per invalid field (email must contain @, password must be 8+ characters).
Dynamic List Reducer
Write applyListAction(items, action) supporting {type:'add',item} and {type:'remove',id} — the state logic behind a dynamic UI list.
Search Filter
Write searchItems(items, query) returning items whose name includes the query, case-insensitively.
Event Delegation Resolver
Write resolveDelegatedTarget(items, clickedId) returning the item whose id matches clickedId, or null — the lookup behind a delegated click handler.
Repair the Total
Fix the misspelled identifiers so the function returns a total.