All practice questions

A large question bank of 100+ practice questions for front end interviews
Solved by ex-interviewers
Test cases
Code in browser
Save the trouble of searching the web for front end interview questions. We have 100+ practice questions in every framework, format, and topic, each with high quality answers and tests from big tech senior / staff engineers.
  • Maximum Product in Contiguous ArrayImplement a function to find the subarray which has the largest product
    Languages
    JavaScriptTypeScript
  • Binary Search TreeImplement a binary search tree data structure including essential BST operations
    Languages
    JavaScriptTypeScript
  • Binary SearchImplement a function that performs binary search on an array of numbers
    Languages
    JavaScriptTypeScript
  • Binary TreeImplement a binary tree data structure including essential operations
    Languages
    JavaScriptTypeScript
  • Breadth-first SearchImplement a breadth-first search algorithm that traverses a directed graph in a breadth-first manner
    Languages
    JavaScriptTypeScript
  • Bubble SortImplement a function that performs a bubble sort
    Languages
    JavaScriptTypeScript
  • Depth-first SearchImplement a depth-first search algorithm that traverses a directed graph in a depth-first manner
    Languages
    JavaScriptTypeScript
  • Dijkstra's AlgorithmImplement Dijkstra's algorithm to find the shortest paths from a source vertex in a graph represented as an adjacency list.
    Languages
    JavaScriptTypeScript
  • Heap SortImplement a function that performs a heap sort
    Languages
    JavaScriptTypeScript
  • HeapImplement a heap data structure containing essential heap operations
    Languages
    JavaScriptTypeScript
  • Insertion SortImplement a function that performs an insertion sort
    Languages
    JavaScriptTypeScript
  • Linked ListImplement a linked list data structure containing the common linked list methods
    Languages
    JavaScriptTypeScript
  • Merge SortImplement a function that performs a recursive merge sort
    Languages
    JavaScriptTypeScript
  • QueueImplement a queue data structure containing the common queue methods
    Languages
    JavaScriptTypeScript
  • Quick SortImplement a function that performs a recursive quick sort
    Languages
    JavaScriptTypeScript
  • Selection SortImplement a function that performs a selection sort
    Languages
    JavaScriptTypeScript
  • StackImplement a stack data structure containing the common stack methods
    Languages
    JavaScriptTypeScript
  • Topological SortImplement a function that performs a topological sort
    Languages
    JavaScriptTypeScript
  • Array.prototype.atPremiumImplement the Array.prototype.at() method
    Languages
    JavaScriptTypeScript
  • Array.prototype.concatPremiumImplement the Array.prototype.concat() method
    Languages
    JavaScriptTypeScript
  • Array.prototype.filterPremiumImplement the Array.prototype.filter() method
    Languages
    JavaScriptTypeScript
  • Array.prototype.mapPremiumImplement the Array.prototype.map() method
    Languages
    JavaScriptTypeScript
  • Array.prototype.reduceImplement the Array.prototype.reduce() method
    Languages
    JavaScriptTypeScript
  • Array.prototype.squarePremiumImplement a custom Array.prototype.square() method that squares the values in an array
    Languages
    JavaScriptTypeScript
  • Backbone ModelPremiumImplement a class resembling Backbone.Model which allows storing of attributes/values and responding to changes in specific attribute values
    Languages
    JavaScriptTypeScript
  • Camel Case KeysPremiumImplement a function to convert all the keys in an object to camel case
    Languages
    JavaScriptTypeScript
  • Cancellable IntervalPremiumImplement a function that acts like setInterval but returns a function to cancel the interval
    Languages
    JavaScriptTypeScript
  • Cancellable TimeoutPremiumImplement a function that acts like setTimeout but returns a function to cancel the pending callback
    Languages
    JavaScriptTypeScript
  • ChunkPremiumImplement a function that creates an array of elements split into smaller groups of a specified size
    Languages
    JavaScriptTypeScript
  • ClampPremiumImplement a function to clamp a number within the inclusive lower and upper bounds
    Languages
    JavaScriptTypeScript
  • Classnames IIPremiumImplement a function that conditionally joins CSS class names together and also handles de-duplication and function values
    Languages
    JavaScriptTypeScript
  • ClassnamesImplement a function that conditionally joins CSS class names together
    Languages
    JavaScriptTypeScript
  • Compact IIPremiumImplement a function that returns an object with all falsey values removed
    Languages
    JavaScriptTypeScript
  • CompactPremiumImplement a function that creates an array with all falsey values removed
    Languages
    JavaScriptTypeScript
  • ComposePremiumImplement a function that takes multiple functions as arguments and returns a new function that applies those functions in reverse
    Languages
    JavaScriptTypeScript
  • Conforms ToPremiumImplement a function that checks if object conforms to source
    Languages
    JavaScriptTypeScript
  • Count ByImplement a function that counts the number of times a value appears in an array based on a function or property name
    Languages
    JavaScriptTypeScript
  • Curry IIPremiumImplement a function that transforms a function that takes multiple arguments into a function that can be repeatedly called with any number of arguments
    Languages
    JavaScriptTypeScript
  • Curry IIIPremiumImplement a function which transforms a function which takes variadic arguments into a function that can be repeatedly called with any number of arguments
    Languages
    JavaScriptTypeScript
  • CurryImplement a function that transforms a function that takes multiple arguments into a function that can be repeatedly called with only one argument at a time
    Languages
    JavaScriptTypeScript
  • CycleImplement a function that takes one or more values and returns a function that cycles through those values each time it is called
    Languages
    JavaScriptTypeScript
  • Data MergingImplement a function to merge rows of data from the same user
    Languages
    JavaScriptTypeScript
  • Data SelectionPremiumImplement a function to filter rows of data matching a specified requirement
    Languages
    JavaScriptTypeScript
  • Debounce IIPremiumImplement a debounce function that comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke them
    Languages
    JavaScriptTypeScript
  • DebounceImplement a function to limit how many times a function can be executed by delaying the execution of the function until after a specified time after its last execution attempt
    Languages
    JavaScriptTypeScript
  • Deep Clone IIPremiumImplement a function that performs a deep copy of a value, but also handles circular references
    Languages
    JavaScriptTypeScript
  • Deep CloneImplement a function that performs a deep copy of a value
    Languages
    JavaScriptTypeScript
  • Deep EqualImplement a function that determines if two values are equal
    Languages
    JavaScriptTypeScript
  • Deep MapPremiumImplement a function to recursively transform values
    Languages
    JavaScriptTypeScript
  • Deep MergePremiumImplement a function that merges two objects together
    Languages
    JavaScriptTypeScript
  • Deep OmitImplement a function that removes specified keys and their corresponding values from an object, including nested objects or arrays
    Languages
    JavaScriptTypeScript
  • DifferencePremiumImplement a function that finds the difference in values between arrays
    Languages
    JavaScriptTypeScript
  • Drop Right WhilePremiumImplement a function that excludes elements from the end of an array until the predicate returns false
    Languages
    JavaScriptTypeScript
  • Drop WhilePremiumImplement a function that excludes elements from the beginning of an array until the predicate returns false
    Languages
    JavaScriptTypeScript
  • Event Emitter IIPremiumImplement a class that can subscribe to and emit events that trigger attached callback functions. Subscription objects are returned and can unsubscribe itself
    Languages
    JavaScriptTypeScript
  • Event EmitterImplement a class that can subscribe to and emit events that trigger attached callback functions
    Languages
    JavaScriptTypeScript
  • FillPremiumImplement a function that fills an array with values within specified indices
    Languages
    JavaScriptTypeScript
  • Find IndexPremiumImplement a function that returns the index of the first element in the array that satisfies the provided testing function
    Languages
    JavaScriptTypeScript
  • Find Last IndexPremiumImplement a function that returns the index of the last element in the array that satisfies the provided testing function
    Languages
    JavaScriptTypeScript
  • FlattenImplement a function that recursively flattens an array into a single level deep
    Languages
    JavaScriptTypeScript
  • From PairsPremiumImplement a function that returns an object composed from key-value pairs
    Languages
    JavaScriptTypeScript
  • Function.prototype.applyPremiumImplement the Function.prototype.apply() function that calls the function with a given `this` value and arguments as an array
    Languages
    JavaScriptTypeScript
  • Function.prototype.bindPremiumImplement the Function.prototype.bind() function that creates a new function with the `this` keyword set to a provided value
    Languages
    JavaScriptTypeScript
  • Function.prototype.callImplement the Function.prototype.call() function that calls the function with a given `this` value and provided arguments
    Languages
    JavaScriptTypeScript
  • Function LengthPremiumImplement a function that returns the number of parameters expected by a function
    Languages
    JavaScriptTypeScript
  • getElementsByClassNameImplement a function to get all DOM elements that contain the specified classes
    Languages
    JavaScriptTypeScript
  • getElementsByStyleImplement a function to get all DOM elements that are rendered using the specified style
    Languages
    JavaScriptTypeScript
  • getElementsByTagNameHierarchyPremiumImplement a function to get all DOM elements that match a tag hierarchy
    Languages
    JavaScriptTypeScript
  • getElementsByTagNamePremiumImplement a function to get all DOM elements that match a tag
    Languages
    JavaScriptTypeScript
  • GetPremiumImplement a function to safely access deeply-nested properties in JavaScript objects
    Languages
    JavaScriptTypeScript
  • Group ByPremiumImplement a function that groups values in an array based on a function or property name
    Languages
    JavaScriptTypeScript
  • HTML SerializerImplement a function to serialize an object into an HTML string with indentation
    Languages
    JavaScriptTypeScript
  • Identical DOM TreesPremiumImplement a function to determine if two DOM trees are the same
    Languages
    JavaScriptTypeScript
  • In RangePremiumImplement a function to check if a number falls between two numbers
    Languages
    JavaScriptTypeScript
  • Intersection ByPremiumImplement a function that returns an array of unique values that are included in all given arrays based on a provided iteratee function
    Languages
    JavaScriptTypeScript
  • Intersection WithPremiumComputes the intersection of arrays using a custom comparator function to determine equality between elements
    Languages
    JavaScriptTypeScript
  • IntersectionPremiumImplement a function that computes the intersection of arrays, returning a new array containing unique values present in all given arrays
    Languages
    JavaScriptTypeScript
  • Is EmptyPremiumImplement a function to check if a value is an empty object, collection, map, or set
    Languages
    JavaScriptTypeScript
  • jQuery Class ManipulationPremiumImplement a set of jQuery-like functions that manipulates classes on a DOM element
    Languages
    JavaScriptTypeScript
  • jQuery.cssPremiumImplement a jQuery-like function that sets the style of a DOM element
    Languages
    JavaScriptTypeScript
  • JSON.stringify IIPremiumImplement a function that converts a JavaScript value into a JSON string
    Languages
    JavaScriptTypeScript
  • JSON.stringifyImplement a function that converts a JavaScript value into a JSON string
    Languages
    JavaScriptTypeScript
  • LimitPremiumImplement a function that accepts a callback and restricts its invocation to at most N times
    Languages
    JavaScriptTypeScript
  • List FormatImplement a function that formats a list of items into a single readable string
    Languages
    JavaScriptTypeScript
  • Make Counter IIPremiumImplement a function that returns a counter object with methods to retrieve and manipulate the value
    Languages
    JavaScriptTypeScript
  • Make CounterImplement a function that accepts an integer value and returns a function that can be repeatedly called to return increasing values
    Languages
    JavaScriptTypeScript
  • Map Async LimitImplement a function that maps an array of items with an asynchronous mapping function while not exceeding the concurrency limit
    Languages
    JavaScriptTypeScript
  • Map AsyncPremiumImplement a function that maps an array of items with an asynchronous mapping function
    Languages
    JavaScriptTypeScript
  • Max ByPremiumImplement a function that finds the maximum element based on the specified criteria
    Languages
    JavaScriptTypeScript
  • MeanImplement a function that finds the mean of the values inside an array
    Languages
    JavaScriptTypeScript
  • Memoize IIPremiumImplement a function that returns a memoized version of a function which accepts any number of arguments
    Languages
    JavaScriptTypeScript
  • MemoizeImplement a function that returns a memoized version of a function which accepts a single argument
    Languages
    JavaScriptTypeScript
  • MiddlewaresImplement a function that composes asynchronous middleware functions like in Koa.js
    Languages
    JavaScriptTypeScript
  • Min ByImplement a function that finds the minimum element based on the specified criteria
    Languages
    JavaScriptTypeScript
  • Number of ArgumentsPremiumImplement a function that returns the number of arguments it was called with
    Languages
    JavaScriptTypeScript
  • Object MapPremiumImplement a function to transform values within an object
    Languages
    JavaScriptTypeScript
  • OncePremiumImplement a function that accepts a callback and restricts its invocation to at most once
    Languages
    JavaScriptTypeScript
  • Promise.allSettledPremiumImplement the Promise.allSettled() function that resolves to an array of outcomes when all the input elements are either resolved or rejected
    Languages
    JavaScriptTypeScript
  • Promise.allImplement the Promise.all() function that resolves to an array of results if all the input elements are resolved or rejects otherwise
    Languages
    JavaScriptTypeScript
  • Promise.anyImplement the Promise.any() function that resolves when any of the input elements are resolved
    Languages
    JavaScriptTypeScript
  • Promise MergePremiumImplement a function to merge the results of two promises into a single value
    Languages
    JavaScriptTypeScript
  • Promise.racePremiumImplement the Promise.race() function that resolves or rejects when any of the input elements are resolved or rejected
    Languages
    JavaScriptTypeScript
  • Promise.rejectPremiumImplement a function to return a Promise object rejected with a reason
    Languages
    JavaScriptTypeScript
  • Promise.resolvePremiumImplement a function to resolve a given value to a Promise
    Languages
    JavaScriptTypeScript
  • Promise TimeoutPremiumImplement a function that resolves a promise if it is fulfilled within a timeout period and rejects otherwise
    Languages
    JavaScriptTypeScript
  • Promise.withResolversPremiumImplement a function that returns an object containing a new `Promise` object and two functions to resolve or reject it
    Languages
    JavaScriptTypeScript
  • Promisify IIPremiumImplement a promisify function that allows the original function to override the return value
    Languages
    JavaScriptTypeScript
  • PromisifyImplement a function that takes a function following the common error-first callback style and returns a version that returns promises
    Languages
    JavaScriptTypeScript
  • Range RightPremiumImplement a function that returns a sequence of numbers in descending order
    Languages
    JavaScriptTypeScript
  • RangePremiumImplement a function that returns a sequence of numbers in ascending order
    Languages
    JavaScriptTypeScript
  • Resumable IntervalPremiumImplement a function that creates a resumable interval object
    Languages
    JavaScriptTypeScript
  • SingletonPremiumImplement a Singleton class that ensures a class has only one instance while providing a global point of access to that instance
    Languages
    JavaScriptTypeScript
  • SizePremiumImplement a function that returns the size of collection
    Languages
    JavaScriptTypeScript
  • SleepPremiumImplement a function that pauses for a specified duration before resuming execution
    Languages
    JavaScriptTypeScript
  • Squash ObjectImplement a function that returns a new object after squashing the input object into a single level of depth
    Languages
    JavaScriptTypeScript
  • SumPremiumImplement a function that sums numbers by accepting a number and allows for repeated calling with more numbers until it is not called with any number
    Languages
    JavaScriptTypeScript
  • Table of ContentsPremiumImplement a function to construct a table of contents from an HTML document
    Languages
    JavaScriptTypeScript
  • Text Search IIPremiumImplement a function to highlight text if searched terms appear within it
    Languages
    JavaScriptTypeScript
  • Text SearchPremiumImplement a function to highlight text if a searched term appears within it
    Languages
    JavaScriptTypeScript
  • ThrottleImplement a function to control the execution of a function by limiting how many times it can execute over time
    Languages
    JavaScriptTypeScript
  • TurtlePremiumImplement a Turtle class that moves a turtle on a 2D plane
    Languages
    JavaScriptTypeScript
  • Type Utilities IIImplement utilities to determine non-primitive variable types in JavaScript
    Languages
    JavaScriptTypeScript
  • Type UtilitiesImplement utilities to determine primitive variable types in JavaScript
    Languages
    JavaScriptTypeScript
  • Union ByPremiumImplement a function that creates an array of unique values, in order, from all given arrays.
    Languages
    JavaScriptTypeScript
  • Unique ArrayPremiumImplement a function to remove all duplicate values from an array
    Languages
    JavaScriptTypeScript
  • TabsBuild a tabs component that displays a list of tab elements and one associated panel of content at a time
    Languages
    JavaScriptTypeScript