Front End Engineer · Web Developer · Full Stack Engineer

Interview Practice Question Bank

Practice 190+ common front end interview questions across every major front end framework. Reference answers from ex-interviewers at FAANG.

JavaScript Questions

130+ JavaScript interview questions, from implementing common library APIs, utility functions, algorithms, to building UI components and more.

Questions List

  • Type UtilitiesFree

    Implement utilities to determine primitive variable types in JavaScript
    Difficulty
    Easy
    Languages
    JS
  • Type Utilities IIFree

    Implement utilities to determine non-primitive variable types in JavaScript
    Difficulty
    Easy
    Languages
    JS
  • New

    Breadth-First SearchFree

    Implement a breadth-first search algorithm that traverses a directed graph in a breadth-first manner.
    Difficulty
    Medium
    Languages
    JS
  • DebounceFree

    Implement 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
    Difficulty
    Medium
    Languages
    JS
  • FlattenFree

    Implement a function that recursively flattens an array into a single level deep
    Difficulty
    Medium
    Languages
    JS
  • Promise.allFree

    Implement the Promise.all() function that resolves to an array of results if all the input elements are resolved or rejects otherwise
    Difficulty
    Medium
    Languages
    JS
  • Deep CloneFree

    Implement a function that performs a deep copy of a value
    Difficulty
    Medium
    Languages
    JS
  • Array.prototype.squarePremium

    Implement a custom Array.prototype.square() method which squares the values in an array
    Difficulty
    Easy
    Languages
    JS
  • GetPremium

    Implement a function to safely access deeply-nested properties in JavaScript objects
    Difficulty
    Easy
    Languages
    JS
  • OncePremium

    Implement a function that accepts a callback and restricts its invocation to at most once
    Difficulty
    Easy
    Languages
    JS
  • Unique ArrayPremium

    Implement a function to remove all duplicate values from an array
    Difficulty
    Easy
    Languages
    JS
  • Array.prototype.filterPremium

    Implement the Array.prototype.filter() method
    Difficulty
    Easy
    Languages
    JS
  • Array.prototype.mapPremium

    Implement the Array.prototype.map() method
    Difficulty
    Easy
    Languages
    JS
  • Array.prototype.reducePremium

    Implement the Array.prototype.reduce() method
    Difficulty
    Easy
    Languages
    JS
  • Function.prototype.bindPremium

    Implement the Function.prototype.bind() function that creates a new function with the this keyword set to a provided value
    Difficulty
    Easy
    Languages
    JS
  • jQuery.cssPremium

    Implement a jQuery-like function that sets the style of a DOM element
    Difficulty
    Easy
    Languages
    HTMLCSSJS
  • Promise.racePremium

    Implement the Promise.race() function that resolves or rejects when any of the input elements are resolved or rejected
    Difficulty
    Easy
    Languages
    JS
  • SumPremium

    Implement 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
    Difficulty
    Easy
    Languages
    JS
  • CurryPremium

    Implement a function which transforms a function which takes multiple arguments into a function that can be repeatedly called with only one argument at a time
    Difficulty
    Medium
    Languages
    JS
  • LimitPremium

    Implement a function that accepts a callback and restricts its invocation to at most N times
    Difficulty
    Medium
    Languages
    JS
  • ThrottlePremium

    Implement a function to control the execution of a function by limiting how many times it can execute over time
    Difficulty
    Medium
    Languages
    JS
  • Camel Case KeysPremium

    Implement a function to convert all the keys in an object to camel case
    Difficulty
    Medium
    Languages
    JS
  • ClassnamesPremium

    Implement a function which conditionally joins CSS class names together
    Difficulty
    Medium
    Languages
    CSSJS
  • Curry IIPremium

    Implement a function which transforms a function which takes multiple arguments into a function that can be repeatedly called with any number of arguments
    Difficulty
    Medium
    Languages
    JS
  • Debounce IIPremium

    Implement a debounce function that comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke them
    Difficulty
    Medium
    Languages
    JS
  • Event EmitterPremium

    Implement a class that can subscribe to and emit events which triggers attached callback functions
    Difficulty
    Medium
    Languages
    JS
  • Event Emitter IIPremium

    Implement a class that can subscribe to and emit events which triggers attached callback functions. Susbcription objects are returned and can unsubscribe itself
    Difficulty
    Medium
    Languages
    JS
  • getElementsByTagNamePremium

    Implement a function to get all DOM elements which match a tag
    Difficulty
    Medium
    Languages
    HTMLJS
  • HTML SerializerPremium

    Implement a function to serialize an object into a HTML string with indentation
    Difficulty
    Medium
    Languages
    HTMLJS
  • Identical DOM TreesPremium

    Implement a function to determine if two DOM trees are the same
    Difficulty
    Medium
    Languages
    HTMLJS
  • jQuery Class ManipulationPremium

    Implement a set of jQuery-like functions that manipulates classes on a DOM element
    Difficulty
    Medium
    Languages
    HTMLCSSJS
  • List FormatPremium

    Implement a function that formats a list of items into a single readable string
    Difficulty
    Medium
    Languages
    JS
  • Promise.allSettledPremium

    Implement the Promise.allSettled() function that resolves to an array of outcomes when all the input elements are either resolved or rejected
    Difficulty
    Medium
    Languages
    JS
  • Promise.anyPremium

    Implement the Promise.any() function that resolves when any of the input elements are resolved
    Difficulty
    Medium
    Languages
    JS
  • Squash ObjectPremium

    Implement a function that returns a new object after squashing the input object into a single level of depth
    Difficulty
    Medium
    Languages
    JS
  • Text SearchPremium

    Implement a function to highlight text if a searched term appears within it
    Difficulty
    Medium
    Languages
    HTMLJS
  • Deep EqualPremium

    Implement a function that determines if two values are equal
    Difficulty
    Medium
    Languages
    JS
  • getElementsByClassNamePremium

    Implement a function to get all DOM elements that contain the specified classes
    Difficulty
    Medium
    Languages
    HTMLCSSJS
  • Text Search IIPremium

    Implement a function to highlight text if searched terms appear within it
    Difficulty
    Medium
    Languages
    HTMLJS
  • Curry IIIPremium

    Implement a function which transforms a function which takes variadic arguments into a function that can be repeatedly called with any number of arguments
    Difficulty
    Hard
    Languages
    JS
  • Data SelectionPremium

    Implement a function to filter rows of data matching a specified requirement
    Difficulty
    Hard
    Languages
    JS
  • Table of ContentsPremium

    Implement a function to construct a table of contents from a HTML document
    Difficulty
    Hard
    Languages
    HTMLJS
  • Deep Clone IIPremium

    Implement a function that performs a deep copy of a value, but also handles circular references
    Difficulty
    Hard
    Languages
    JS
  • JSON.stringifyPremium

    Implement a function that converts a JavaScript value into a JSON string
    Difficulty
    Hard
    Languages
    JS
Logos provided by Clearbit