1-Month Frontend Interview Plan
Four weeks from fundamentals to mid-level depth: closures and async through data structures, DOM, and framework components. Ten questions a week, each with a worked, diagram-backed solution.
40 questions · 4 weeks
Week 1
- 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
Week 2
- 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
Week 3
- 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
Week 4
- 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