Summer Sale! Additional 20% off annual and lifetime plans with the code SUMMERSALE23. Grab your discount today!

JavaScript and TypeScript Questions

150+ JavaScript and TypeScript 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
    JSTS
    Users Completed
    968 completed
  • Type Utilities IIFree

    Implement utilities to determine non-primitive variable types in JavaScript
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    427 completed
  • Breadth-First SearchFree

    Implement a breadth-first search algorithm that traverses a directed graph in a breadth-first manner
    Difficulty
    Medium
    Languages
    JSTS
    Users Completed
    97 completed
  • 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
    JSTS
    Users Completed
    1131 completed
  • FlattenFree

    Implement a function that recursively flattens an array into a single level deep
    Difficulty
    Medium
    Languages
    JSTS
    Users Completed
    1495 completed
  • 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
    JSTS
    Users Completed
    786 completed
  • Deep CloneFree

    Implement a function that performs a deep copy of a value
    Difficulty
    Medium
    Languages
    JSTS
    Users Completed
    479 completed
  • New

    ClampPremium

    Implement a function to clamp a number within the inclusive lower and upper bounds
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    158 completed
  • Array.prototype.squarePremium

    Implement a custom Array.prototype.square() method that squares the values in an array
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    1127 completed
  • New

    ChunkPremium

    Implement a function that creates an array of elements split into smaller groups of a specified size
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    212 completed
  • New

    CompactPremium

    Implement a function that creates an array with all falsey values removed
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    187 completed
  • New

    DifferencePremium

    Implement a function that finds the difference in values between arrays
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    124 completed
  • New

    Drop Right WhilePremium

    Implement a function that excludes elements from the end of an array until the predicate returns false
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    107 completed
  • New

    Drop WhilePremium

    Implement a function that excludes elements from the beginning of an array until the predicate returns false
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    96 completed
  • New

    FillPremium

    Implement a function that fills an array with values within specified indices
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    72 completed
  • New

    Find IndexPremium

    Implement a function that returns the index of the first element in the array that satisfies the provided testing function
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    58 completed
  • New

    Find Last IndexPremium

    Implement a function that returns the index of the last element in the array that satisfies the provided testing function
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    43 completed
  • GetPremium

    Implement a function to safely access deeply-nested properties in JavaScript objects
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    763 completed
  • New

    In RangePremium

    Implement a function to check if a number falls between two numbers
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    58 completed
  • OncePremium

    Implement a function that accepts a callback and restricts its invocation to at most once
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    554 completed
  • Unique ArrayPremium

    Implement a function to remove all duplicate values from an array
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    670 completed
  • Array.prototype.filterPremium

    Implement the Array.prototype.filter() method
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    763 completed
  • Array.prototype.mapPremium

    Implement the Array.prototype.map() method
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    851 completed
  • Array.prototype.reducePremium

    Implement the Array.prototype.reduce() method
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    481 completed
  • 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
    JSTS
    Users Completed
    454 completed
  • jQuery.cssPremium

    Implement a jQuery-like function that sets the style of a DOM element
    Difficulty
    Easy
    Languages
    HTMLCSSJSTS
    Users Completed
    377 completed
  • Promise.racePremium

    Implement the Promise.race() function that resolves or rejects when any of the input elements are resolved or rejected
    Difficulty
    Easy
    Languages
    JSTS
    Users Completed
    308 completed
  • 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
    JSTS
    Users Completed
    378 completed
  • CurryPremium

    Implement 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
    Difficulty
    Medium
    Languages
    JSTS
    Users Completed
    682 completed
  • New

    Is EmptyPremium

    Implement a function to check if a value is an empty object, collection, map, or set
    Difficulty
    Medium
    Languages
    JSTS
    Users Completed
    26 completed
  • LimitPremium

    Implement a function that accepts a callback and restricts its invocation to at most N times
    Difficulty
    Medium
    Languages
    JSTS
    Users Completed
    246 completed
  • ThrottlePremium

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

    Implement a function to convert all the keys in an object to camel case
    Difficulty
    Medium
    Languages
    JSTS
    Users Completed
    188 completed
  • ClassnamesPremium

    Implement a function that conditionally joins CSS class names together
    Difficulty
    Medium
    Languages
    CSSJSTS
    Users Completed
    310 completed
  • Curry IIPremium

    Implement a function that transforms a function that takes multiple arguments into a function that can be repeatedly called with any number of arguments
    Difficulty
    Medium
    Languages
    JSTS
    Users Completed
    203 completed
  • 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
    JSTS
    Users Completed
    147 completed
  • Event EmitterPremium

    Implement a class that can subscribe to and emit events that trigger attached callback functions
    Difficulty
    Medium
    Languages
    JSTS
    Users Completed
    151 completed
  • Event Emitter IIPremium

    Implement a class that can subscribe to and emit events that trigger attached callback functions. Subscription objects are returned and can unsubscribe itself
    Difficulty
    Medium
    Languages
    JSTS
    Users Completed
    98 completed
  • getElementsByTagNamePremium

    Implement a function to get all DOM elements that match a tag
    Difficulty
    Medium
    Languages
    HTMLJSTS
    Users Completed
    261 completed
  • HTML SerializerPremium

    Implement a function to serialize an object into a HTML string with indentation
    Difficulty
    Medium
    Languages
    HTMLJSTS
    Users Completed
    79 completed
  • Identical DOM TreesPremium

    Implement a function to determine if two DOM trees are the same
    Difficulty
    Medium
    Languages
    HTMLJSTS
    Users Completed
    151 completed
  • jQuery Class ManipulationPremium

    Implement a set of jQuery-like functions that manipulates classes on a DOM element
    Difficulty
    Medium
    Languages
    HTMLCSSJSTS
    Users Completed
    102 completed
  • List FormatPremium

    Implement a function that formats a list of items into a single readable string
    Difficulty
    Medium
    Languages
    JSTS
    Users Completed
    247 completed
  • 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
    JSTS
    Users Completed
    188 completed
  • Promise.anyPremium

    Implement the Promise.any() function that resolves when any of the input elements are resolved
    Difficulty
    Medium
    Languages
    JSTS
    Users Completed
    241 completed
  • Squash ObjectPremium

    Implement a function that returns a new object after squashing the input object into a single level of depth
    Difficulty
    Medium
    Languages
    JSTS
    Users Completed
    145 completed
  • Text SearchPremium

    Implement a function to highlight text if a searched term appears within it
    Difficulty
    Medium
    Languages
    HTMLJSTS
    Users Completed
    185 completed
  • Deep EqualPremium

    Implement a function that determines if two values are equal
    Difficulty
    Medium
    Languages
    JSTS
    Users Completed
    211 completed
  • getElementsByClassNamePremium

    Implement a function to get all DOM elements that contain the specified classes
    Difficulty
    Medium
    Languages
    HTMLCSSJSTS
    Users Completed
    125 completed
  • Text Search IIPremium

    Implement a function to highlight text if searched terms appear within it
    Difficulty
    Medium
    Languages
    HTMLJSTS
    Users Completed
    46 completed
  • 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
    JSTS
    Users Completed
    45 completed
  • Data SelectionPremium

    Implement a function to filter rows of data matching a specified requirement
    Difficulty
    Hard
    Languages
    JSTS
    Users Completed
    77 completed
  • Table of ContentsPremium

    Implement a function to construct a table of contents from a HTML document
    Difficulty
    Hard
    Languages
    HTMLJSTS
    Users Completed
    44 completed
  • Deep Clone IIPremium

    Implement a function that performs a deep copy of a value, but also handles circular references
    Difficulty
    Hard
    Languages
    JSTS
    Users Completed
    41 completed
  • JSON.stringifyPremium

    Implement a function that converts a JavaScript value into a JSON string
    Difficulty
    Hard
    Languages
    JSTS
    Users Completed
    42 completed
Logos provided by Clearbit