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
141 questions
Total time
44 hours total

Questions List

  • CounterWarm Up QuestionBuild a simple counter that increments whenever a button is clicked
    Difficulty
    Easy
    Available frameworks
    Users completed
    8315 completed
  • StackImplement a stack data structure containing the common stack methods
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    2908 completed
  • 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
  • Insertion SortImplement a function that performs an insertion sort
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    1245 completed
  • Type Utilities IIImplement utilities to determine non-primitive variable types in JavaScript
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    1066 completed
  • Mortgage CalculatorBuild a calculator that computes the monthly mortgage for a loan
    Difficulty
    Easy
    Available frameworks
    Users completed
    699 completed
  • Binary SearchImplement a function that performs binary search on an array of numbers
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    1362 completed
  • Breadth-first SearchImplement a breadth-first search algorithm that traverses a directed graph in a breadth-first manner
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    508 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
  • Depth-first SearchImplement a depth-first search algorithm that traverses a directed graph in a depth-first manner
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    559 completed
  • Heap SortImplement a function that performs a heap sort
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    178 completed
  • QueueImplement a queue data structure containing the common queue methods
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    633 completed
  • TabsBuild a tabs component that displays a list of tab elements and one associated panel of content at a time
    Difficulty
    Medium
    Available frameworks
    Users completed
    1203 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
  • Merge SortImplement a function that performs a recursive merge sort
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    300 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
  • Quick SortImplement a function that performs a recursive quick sort
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    243 completed
  • Todo ListBuild a Todo list that lets users add new tasks and delete existing tasks
    Difficulty
    Medium
    Available frameworks
    Users completed
    2109 completed
  • Topological SortImplement a function that performs a topological sort
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    89 completed
  • Traffic LightBuild a traffic light where the lights switch from green to yellow to red after predetermined intervals and loop indefinitely
    Difficulty
    Medium
    Available frameworks
    Users completed
    657 completed
  • Deep CloneImplement a function that performs a deep copy of a value
    Difficulty
    Medium
    Languages
    JSTS
    Users completed
    1013 completed
  • Digital ClockBuild a 7-segment digital clock that shows the current time
    Difficulty
    Medium
    Available frameworks
    Users completed
    408 completed
  • Job BoardBuild a job board that displays the latest job postings from Hacker News
    Difficulty
    Medium
    Available frameworks
    Users completed
    436 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
  • Selection SortImplement a function that performs a selection sort
    Difficulty
    Easy
    Languages
    JSTS
    Users completed
    755 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
  • AccordionBuild an accordion component that a displays a list of vertically stacked sections with each containing a title and content snippet
    Difficulty
    Easy
    Available frameworks
    Users completed
    1111 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
  • Flight BookerBuild a component that books a flight for specified dates
    Difficulty
    Easy
    Available frameworks
    Users completed
    517 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
  • Generate TableGenerate a table of numbers given the rows and columns
    Difficulty
    Easy
    Available frameworks
    Users completed
    560 completed
  • jQuery.cssImplement a jQuery-like function that sets the style of a DOM element
    Difficulty
    Easy
    Languages
    HTMLCSSJSTS
    Users completed
    1042 completed
  • Progress BarBuild a progress bar component that shows the percentage completion of an operation
    Difficulty
    Easy
    Available frameworks
    Users completed
    1009 completed
  • Progress BarsBuild a list of progress bars that fill up gradually when they are added to the page
    Difficulty
    Easy
    Available frameworks
    Users completed
    535 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
  • Temperature ConverterBuild a temperature converter widget that converts temperature values between Celsius and Fahrenheit
    Difficulty
    Easy
    Available frameworks
    Users completed
    864 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
  • Accordion IIBuild an accessible accordion component that has the right ARIA roles, states, and properties
    Difficulty
    Medium
    Available frameworks
    Users completed
    232 completed
  • Accordion IIIBuild a fully accessible accordion component that has keyboard support according to ARIA specifications
    Difficulty
    Medium
    Available frameworks
    Users completed
    114 completed
  • Analog ClockBuild an analog clock where the hands update and move like a real clock
    Difficulty
    Medium
    Available frameworks
    Users completed
    181 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
  • Grid LightsBuild a grid of lights where the lights deactivate in the reverse order they were activated
    Difficulty
    Medium
    Available frameworks
    Users completed
    268 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
  • Like ButtonBuild a Like button that changes appearance based on the states
    Difficulty
    Medium
    Available frameworks
    Users completed
    341 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
  • Progress Bars IIBuild a list of progress bars that fill up gradually in sequence, one at a time
    Difficulty
    Medium
    Available frameworks
    Users completed
    180 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
  • Star RatingBuild a star rating component that shows a row of star icons for users to select the number of filled stars corresponding to the rating
    Difficulty
    Medium
    Available frameworks
    Users completed
    733 completed
  • Tabs IIBuild a semi-accessible tabs component that has the right ARIA roles, states, and properties
    Difficulty
    Medium
    Available frameworks
    Users completed
    113 completed
  • Tabs IIIBuild a fully accessible tabs component that has keyboard support according to ARIA specifications
    Difficulty
    Medium
    Available frameworks
    Users completed
    69 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
  • Progress Bars IIIBuild a list of progress bars that fill up gradually concurrently, up to a limit of 3
    Difficulty
    Medium
    Available frameworks
    Users completed
    112 completed
  • Text Search IIImplement a function to highlight text if searched terms appear within it
    Difficulty
    Medium
    Languages
    HTMLJSTS
    Users completed
    105 completed
  • Tic-tac-toeBuild a tic-tac-toe game that is playable by two players
    Difficulty
    Medium
    Available frameworks
    Users completed
    151 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
  • Signup FormBuild a signup form that does validation on user details and submits to a back end API
    Difficulty
    Medium
    Available frameworks
    Users completed
    272 completed
  • StopwatchBuild a stopwatch widget that can measure how much time has passed
    Difficulty
    Medium
    Available frameworks
    Users completed
    137 completed
  • Transfer ListBuild a component that allows transferring of items between two lists
    Difficulty
    Medium
    Available frameworks
    Users completed
    141 completed
  • Undoable CounterBuild a counter with a history of the values and ability to undo/redo actions
    Difficulty
    Medium
    Available frameworks
    Users completed
    119 completed
  • Whack-A-MoleBuild a popular arcade game where players attempt to hit moles as they pop up from holes in a board
    Difficulty
    Medium
    Available frameworks
    Users completed
    54 completed
  • Memory GameBuild a memory game where the player needs to match pairs of cards
    Difficulty
    Medium
    Available frameworks
    Users completed
    57 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
  • Progress Bars IVBuild a list of progress bars that fill up gradually concurrently, up to a limit of 3 and allows for pausing and resuming
    Difficulty
    Hard
    Available frameworks
    Users completed
    62 completed
  • 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
  • Tic-tac-toe IIBuild an N x N tic-tac-toe game that requires M consecutive marks to win
    Difficulty
    Hard
    Available frameworks
    Users completed
    38 completed
  • Transfer List IIBuild a component that allows transferring of items between two lists, bulk selection/unselection of items, and adding of new items
    Difficulty
    Hard
    Available frameworks
    Users completed
    40 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
  • WordleBuild Wordle, the word-guessing game that took the world by storm
    Difficulty
    Hard
    Available frameworks
    Users completed
    27 completed