Practice by framework

190+ questions

JavaScript questionsTypeScript supported

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

Try these popular JavaScript questions

Array.prototype.concatImplement the Array.prototype.concat() method
Languages
JSTS
Array.prototype.filterImplement the Array.prototype.filter() method
Languages
JSTS
Coding Format
Number of questions
96 questions
Total time
27 hours total

Questions List

  • Type UtilitiesImplement utilities to determine primitive variable types in JavaScript
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    2451 completed
  • New
    CycleImplement a function that takes one or more values and returns a function that cycles through those values each time it is called
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    227 completed
  • Type Utilities IIImplement utilities to determine non-primitive variable types in JavaScript
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    1066 completed
  • Count ByImplement a function that counts the number of times a value appears in an array based on a function or property name
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    383 completed
  • 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
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    2621 completed
  • ClassnamesImplement a function that conditionally joins CSS class names together
    Difficulty
    Medium
    Languages
    CSSJSTS
    Users completed
    804 completed
  • Event EmitterImplement a class that can subscribe to and emit events that trigger attached callback functions
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    348 completed
  • FlattenImplement a function that recursively flattens an array into a single level deep
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    2841 completed
  • Promise.allImplement 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
    1688 completed
  • Deep CloneImplement a function that performs a deep copy of a value
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    1013 completed
  • ClampImplement a function to clamp a number within the inclusive lower and upper bounds
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    1844 completed
  • Function LengthImplement a function that returns the number of parameters expected by a function
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    1367 completed
  • Make CounterImplement a function that accepts an integer value and returns a function that can be repeatedly called to return increasing values
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    1193 completed
  • Number of ArgumentsImplement a function that returns the number of arguments it was called with
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    1176 completed
  • SleepImplement a function that pauses for a specified duration before resuming execution
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    1167 completed
  • Array.prototype.squareImplement a custom Array.prototype.square() method that squares the values in an array
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    2174 completed
  • Cancellable IntervalImplement a function that acts like setInterval but returns a function to cancel the interval
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    908 completed
  • Cancellable TimeoutImplement a function that acts like setTimeout but returns a function to cancel the pending callback
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    845 completed
  • ChunkImplement a function that creates an array of elements split into smaller groups of a specified size
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    1176 completed
  • CompactImplement a function that creates an array with all falsey values removed
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    1119 completed
  • DifferenceImplement a function that finds the difference in values between arrays
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    952 completed
  • Drop Right WhileImplement a function that excludes elements from the end of an array until the predicate returns false
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    704 completed
  • Drop WhileImplement a function that excludes elements from the beginning of an array until the predicate returns false
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    647 completed
  • FillImplement a function that fills an array with values within specified indices
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    576 completed
  • Find IndexImplement 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
    592 completed
  • Find Last IndexImplement 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
    459 completed
  • From PairsImplement a function that returns an object composed from key-value pairs
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    748 completed
  • Function.prototype.applyImplement the Function.prototype.apply() function that calls the function with a given `this` value and arguments as an array
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    375 completed
  • Function.prototype.callImplement the Function.prototype.call() function that calls the function with a given `this` value and provided arguments
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    347 completed
  • GetImplement a function to safely access deeply-nested properties in JavaScript objects
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    1699 completed
  • In RangeImplement a function to check if a number falls between two numbers
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    564 completed
  • IntersectionImplement a function that computes the intersection of arrays, returning a new array containing unique values present in all given arrays
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    338 completed
  • Object MapImplement a function to transform values within an object
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    253 completed
  • OnceImplement a function that accepts a callback and restricts its invocation to at most once
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    902 completed
  • Promise.rejectImplement a function to return a Promise object rejected with a reason
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    461 completed
  • New
    SingletonImplement a Singleton class that ensures a class has only one instance while providing a global point of access to that instance
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    83 completed
  • Unique ArrayImplement a function to remove all duplicate values from an array
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    1492 completed
  • Array.prototype.atImplement the Array.prototype.at() method
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    284 completed
  • Array.prototype.filterImplement the Array.prototype.filter() method
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    1879 completed
  • Array.prototype.mapImplement the Array.prototype.map() method
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    1483 completed
  • Array.prototype.reduceImplement the Array.prototype.reduce() method
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    1125 completed
  • ComposeImplement a function that takes multiple functions as arguments and returns a new function that applies those functions in reverse
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    233 completed
  • Function.prototype.bindImplement 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
    1046 completed
  • jQuery.cssImplement a jQuery-like function that sets the style of a DOM element
    Difficulty
    Easy
    Languages
    HTMLCSSJSTS
    Users completed
    1042 completed
  • Promise.raceImplement the Promise.race() function that resolves or rejects when any of the input elements are resolved or rejected
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    704 completed
  • SizeImplement a function that returns the size of collection
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    175 completed
  • SumImplement 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
    817 completed
  • Make Counter IIImplement a function that returns a counter object with methods to retrieve and manipulate the value
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    396 completed
  • New
    Array.prototype.concatImplement the Array.prototype.concat() method
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    104 completed
  • 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
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    1463 completed
  • Group ByImplement a function that groups values in an array based on a function or property name
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    172 completed
  • Intersection ByImplement a function that returns an array of unique values that are included in all given arrays based on a provided iteratee function
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    155 completed
  • Intersection WithComputes the intersection of arrays using a custom comparator function to determine equality between elements
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    121 completed
  • Is EmptyImplement a function to check if a value is an empty object, collection, map, or set
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    243 completed
  • LimitImplement a function that accepts a callback and restricts its invocation to at most N times
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    478 completed
  • Promise MergeImplement a function to merge the results of two promises into a single value
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    247 completed
  • Promise TimeoutImplement a function that resolves a promise if it is fulfilled within a timeout period and rejects otherwise
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    246 completed
  • Promise.resolveImplement a function to resolve a given value to a Promise
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    212 completed
  • PromisifyImplement a function that takes a function following the common error-first callback style and returns a version that returns promises
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    223 completed
  • Promisify IIImplement a promisify function that allows the original function to override the return value
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    82 completed
  • ThrottleImplement 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
    1102 completed
  • TurtleImplement a Turtle class that moves a turtle on a 2D plane
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    86 completed
  • Camel Case KeysImplement a function to convert all the keys in an object to camel case
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    391 completed
  • Compact IIImplement a function that returns an object with all falsey values removed
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    60 completed
  • Curry IIImplement 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
    448 completed
  • Data MergingImplement a function to merge rows of data from the same user
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    89 completed
  • Debounce IIImplement 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
    354 completed
  • Event Emitter IIImplement 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
    223 completed
  • getElementsByTagNameImplement a function to get all DOM elements that match a tag
    Difficulty
    Medium
    Languages
    HTMLJSTS
    Users completed
    708 completed
  • HTML SerializerImplement a function to serialize an object into an HTML string with indentation
    Difficulty
    Medium
    Languages
    HTMLJSTS
    Users completed
    161 completed
  • Identical DOM TreesImplement a function to determine if two DOM trees are the same
    Difficulty
    Medium
    Languages
    HTMLJSTS
    Users completed
    362 completed
  • jQuery Class ManipulationImplement a set of jQuery-like functions that manipulates classes on a DOM element
    Difficulty
    Medium
    Languages
    HTMLCSSJSTS
    Users completed
    267 completed
  • JSON.stringifyImplement a function that converts a JavaScript value into a JSON string
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    190 completed
  • List FormatImplement a function that formats a list of items into a single readable string
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    645 completed
  • New
    Map AsyncImplement a function that maps an array of items with an asynchronous mapping function
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    30 completed
  • MemoizeImplement a function that returns a memoized version of a function which accepts a single argument
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    95 completed
  • Promise.allSettledImplement 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
    439 completed
  • Promise.anyImplement the Promise.any() function that resolves when any of the input elements are resolved
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    560 completed
  • Resumable IntervalImplement a function that creates a resumable interval object
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    63 completed
  • Squash ObjectImplement a function that returns a new object after squashing the input object into a single level of depth
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    281 completed
  • Text SearchImplement a function to highlight text if a searched term appears within it
    Difficulty
    Medium
    Languages
    HTMLJSTS
    Users completed
    367 completed
  • Deep EqualImplement a function that determines if two values are equal
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    546 completed
  • Deep MapImplement a function to recursively transform values
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    49 completed
  • getElementsByClassNameImplement a function to get all DOM elements that contain the specified classes
    Difficulty
    Medium
    Languages
    HTMLCSSJSTS
    Users completed
    337 completed
  • New
    Map Async LimitImplement a function that maps an array of items with an asynchronous mapping function while not exceeding the concurrency limit
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    14 completed
  • Text Search IIImplement a function to highlight text if searched terms appear within it
    Difficulty
    Medium
    Languages
    HTMLJSTS
    Users completed
    105 completed
  • Deep MergeImplement a function that merges two objects together
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    41 completed
  • Deep OmitImplement a function that removes specified keys and their corresponding values from an object, including nested objects or arrays
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    35 completed
  • Memoize IIImplement a function that returns a memoized version of a function which accepts any number of arguments
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    71 completed
  • Curry IIIImplement 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
    86 completed
  • New
    Classnames IIImplement a function that conditionally joins CSS class names together and also handles de-duplication and function values
    Difficulty
    Hard
    Languages
    CSSJSTS
  • New
    Backbone ModelImplement a class resembling Backbone.Model which allows storing of attributes/values and responding to changes in specific attribute values
    Difficulty
    Hard
    Languages
    JSTS
    Users completed
    2 completed
  • Data SelectionImplement a function to filter rows of data matching a specified requirement
    Difficulty
    Hard
    Languages
    JSTS
    Users completed
    179 completed
  • Table of ContentsImplement a function to construct a table of contents from an HTML document
    Difficulty
    Hard
    Languages
    HTMLJSTS
    Users completed
    111 completed
  • Deep Clone IIImplement a function that performs a deep copy of a value, but also handles circular references
    Difficulty
    Hard
    Languages
    JSTS
    Users completed
    64 completed
  • JSON.stringify IIImplement a function that converts a JavaScript value into a JSON string
    Difficulty
    Hard
    Languages
    JSTS
    Users completed
    15 completed