Frontend interview practice
Frontend Interview Questions & Coding Practice
Practice 685 real-world questions covering JavaScript, algorithms, React, and UI components. Find a challenge by skill and difficulty, or follow a guided preparation plan for your next frontend interview.
Frontend interview practice questions
- JavaScriptCoding exercise
Array findLast / findLastIndex
EASYImplement findLast and findLastIndex — scan an array from the end for the last element matching a predicate.
15 minPractice - JavaScriptCoding exercise
Array.prototype.at
EASYImplement Array.prototype.myAt — return the element at a given index, supporting negative offsets from the end.
15 minPractice - JavaScriptCoding exercise
Array.prototype.every
EASYImplement Array.prototype.every — return false as soon as an element fails the predicate, true when empty.
15 minPractice - JavaScriptCoding exercise
Array.prototype.filter
EASYImplement Array.prototype.filter from scratch as a method on the array prototype.
15 minAmazon · Apple · Canva +1Practice - JavaScriptCoding exercise
Array.prototype.flat
EASYImplement Array.prototype.flat — flatten nested arrays to a given depth (default 1, Infinity for all levels), dropping holes.
15 minPractice - JavaScriptCoding exercise
Array.prototype.forEach
EASYImplement Array.prototype.forEach — run a callback on each element as (value, index, array), skipping sparse holes.
15 minPractice - JavaScriptCoding exercise
Array.prototype.includes
EASYImplement Array.prototype.includes — test membership with SameValueZero so NaN matches, honoring negative fromIndex.
15 minPractice - JavaScriptCoding exercise
Array.prototype.indexOf
EASYImplement Array.prototype.indexOf — first index of a value by strict equality, supporting a negative fromIndex.
15 minPractice - JavaScriptCoding exercise
Array.prototype.some
EASYImplement Array.prototype.some — return true as soon as any element passes the predicate, false when empty.
15 minPractice - JavaScriptCoding exercise
Array.prototype.square
EASYImplement a custom Array.prototype.square method that returns a new array with each value squared.
15 minByteDance · LinkedIn · UberPractice - JavaScriptCoding exercise
Chunk
EASYImplement a function that splits an array into groups of a given size, with the last group holding the remainder.
15 minPractice - JavaScriptCoding exercise
Clamp
EASYImplement a function that constrains a number to lie within an inclusive minimum and maximum range.
15 minPractice - JavaScriptCoding exercise
Compact
EASYImplement a function that returns a new array with every falsy value stripped out.
15 minPractice - JavaScriptCoding exercise
Data Merging
EASYImplement a function that consolidates rows sharing the same user into a single grouped record.
15 minCoinbase · Meta · OpenAI +3Practice - JavaScriptCoding exercise
Difference
EASYImplement a function that returns the elements from the first array that do not appear in the second.
15 minPractice - JavaScriptCoding exercise
Drop Right While
EASYImplement a function that drops trailing array elements as long as a predicate keeps returning truthy.
15 minPractice - JavaScriptCoding exercise
Drop While
EASYImplement a function that drops leading array elements as long as a predicate keeps returning truthy.
15 minPractice - JavaScriptCoding exercise
Fill
EASYImplement a function that replaces array elements with a given value between an optional start and end index.
15 minPractice - AlgorithmsCoding exercise
Find Duplicates in Array
EASYImplement a function that checks whether an array contains any duplicate numbers.
15 minPractice - JavaScriptCoding exercise
Find Index
EASYImplement a function that returns the index of the first array element matching a predicate, or -1 if none match.
15 minPractice - JavaScriptCoding exercise
Find Last Index
EASYImplement a function that returns the index of the last array element matching a predicate, or -1 if none match.
15 minPractice - AlgorithmsCoding exercise
Find Missing Number in Sequence
EASYImplement a function that returns the single missing number from a sorted sequence of integers.
15 minPractice - AlgorithmsCoding exercise
First Bad Version
EASYFind 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 minPractice - JavaScriptCoding exercise
From Pairs
EASYImplement a function that builds an object from an array of [key, value] pair tuples.
15 minPractice - JavaScriptCoding exercise
In Range
EASYImplement a function that checks whether a number lies within a half-open range, swapping bounds when needed.
15 minPractice - JavaScriptCoding exercise
Intersection
EASYImplement a function that returns the unique values present in every input array.
15 minPractice - JavaScriptCoding exercise
Key By
EASYImplement lodash keyBy — index a collection into an object keyed by an iteratee's return, keeping the last item for each key.
15 minPractice - JavaScriptCoding exercise
List Format
EASYImplement a function that joins an array of strings into a grammatical list with commas and a conjunction.
15 minDropboxPractice - JavaScriptCoding exercise
Map.groupBy
EASYImplement Map.groupBy — group an iterable into a Map whose keys can be any value, preserving key insertion order.
15 minPractice - JavaScriptCoding exercise
Max By
EASYImplement a function that returns the array element producing the largest value when run through an iteratee.
15 minPractice - JavaScriptCoding exercise
Mean
EASYImplement a function that computes the arithmetic mean of the numbers in an array.
15 minPractice - JavaScriptCoding exercise
Min By
EASYImplement a function that returns the array element producing the smallest value when run through an iteratee.
15 minPractice - JavaScriptCoding exercise
nth
EASYImplement 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 minPractice - AlgorithmsCoding exercise
Optimal Stock Trading
EASYImplement a function that computes the maximum profit obtainable from one buy and one sell of a stock.
15 minPractice - AlgorithmsCoding exercise
Pair Sum
EASYImplement a function that finds two numbers in an array that add up to a given target.
15 minPractice - JavaScriptCoding exercise
Range
EASYImplement a function that builds an array of numbers from start up to end, stepping by a given increment.
15 minPractice - JavaScriptCoding exercise
Range Right
EASYImplement a function that builds an array of numbers from end down to start in descending order.
15 minPractice - JavaScriptCoding exercise
String.prototype.repeat
EASYImplement String.prototype.repeat — join a string n times, throwing RangeError on a negative or infinite count.
15 minPractice - JavaScriptCoding exercise
Sum By / Mean By
EASYImplement lodash sumBy and meanBy — total and average an array by an iteratee that maps each element to a number.
15 minPractice - JavaScriptCoding exercise
takeWhile
EASYImplement take and takeWhile — grab the leading n elements, or the leading run that satisfies a predicate.
15 minPractice