Coding challenges and theoretical questions asked at top tech companies — with hints, solutions, and a live playground.
Build an Accordion component that displays a list of vertically stacked sections that each contain a title and content snippet. Some HTML is provided for you as example content along with a chevron icon. Requirements By default, all sections are collapsed and are hidden from view. Clicking a section title toggles the contents. If the section is collapsed, the section will be expanded and the contents will be displayed. If the section is expanded, the section will be collapsed and the contents will be hidden. The sections are independent of each other. Example Try out an example of an accordion component . Notes The focus of this question is on functionality, not the styling. Do not spend too much time writing custom CSS. You may modify the markup (e.g. adding id s, data attributes, replacing some tags, etc) and use client-side rendering instead. You may want to think about ways to improve the user experience of the application and implement them (you get bonus credit for doing that during interviews).
Solve the "Add Binary" problem on LeetCode. See https://leetcode.com/problems/add-binary/ for the full problem statement.
Solve the "Binary Tree Inorder Traversal" problem on LeetCode. See https://leetcode.com/problems/binary-tree-inorder-traversal/ for the full problem statement.
Create a React hook usePrevious<T>(value: T) that returns the previous render's value of the given variable.
classnames is a commonly used utility in modern frontend applications to conditionally join CSS class names together. If you've written React applications, you likely have used a similar library. Implement the classnames function. Examples
Solve the "Climbing Stairs" problem on LeetCode. See https://leetcode.com/problems/climbing-stairs/ for the full problem statement.
What are the key differences between Flexbox and CSS Grid, and which layout method should you choose in different situations?
What is the difference between loose equality (==) and strict equality (===)? When does type coercion occur?
What is a closure? Give a practical example of when you would use one.
How does the browser decide which CSS rule wins when multiple rules target the same element?
Solve the "Find the Index of the First Occurrence in a String" problem on LeetCode. See https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string/ for the full problem statement.
How to flatten an array in JavaScript If you just need to flatten an array in production code, use the built-in Array.prototype.flat :
Write a function flatten(arr, depth?) that flattens a nested array up to the specified depth (default: Infinity). Do not use Array.prototype.flat().
The Function.prototype.call() method calls the function with a given this value and arguments provided individually. Source: Function.prototype.call() - JavaScript | MDN Implement your own Function.prototype.call without calling the native call method. To avoid overwriting the actual Function.prototype.call , implement the function as Function.prototype.myCall . Examples
Implement Get Value. See https://www.greatfrontend.com/questions/javascript/get-value for the full problem statement.
Implement Holy Grail Layout. See https://www.greatfrontend.com/questions/user-interface/holy-grail-layout for the full problem statement.
Write a memoize(fn) higher-order function that caches the result of fn for a given set of arguments. Subsequent calls with the same arguments should return the cached result without re-executing fn.
Write a pipe(...fns) function that returns a new function which executes each function in sequence, passing the output of one as the input to the next. Also implement compose() which runs them right-to-left.
What are the key differences between interface and type aliases in TypeScript? When would you prefer one over the other?
Reference: CodingBat Java Warmup-1. Given an `int n`, return the absolute difference between `n` and `21`, except return double the absolute difference if `n` is over `21`.
Reference: University of Helsinki MOOC.fi Part 2 (Factorial). Write a method `factorial(int n)` that returns `n!` as a `long`. Remember that `0! = 1`.
Reference: CodingBat Java Array-1. Given an array of `int`s, return `true` if `6` appears as either the first or last element in the array. The array will be length 1 or more.
Reference: CodingBat Java String-1. Given a string, return the string made of its first two characters (so `"Hello"` yields `"He"`). If the string is shorter than length 2, return whatever is there.
Reference: University of Helsinki MOOC.fi Part 3 (Greatest in list/array). Given a non-empty array `int[] nums`, return the largest integer in the array. Make sure negative numbers work too!
Reference: CodingBat Java String-1 / MOOC.fi Part 1. Given a `String name`, e.g. `"Bob"`, return a greeting of the form `"Hello Bob!"`.
Reference: CodingBat Java Warmup-1 / MOOC.fi Part 1. The parameter `weekday` is true if it is a weekday, and `vacation` is true if we are on vacation. We sleep in if it is not a weekday or we are on vacation. Return `true` if we sleep in.
Reference: University of Helsinki MOOC.fi Part 2 (Sum of a sequence). Write a method `sumToN(int n)` that calculates the sum `1 + 2 + ... + n`. If `n <= 0`, return `0`.
Solve the "Length of Last Word" problem on LeetCode. See https://leetcode.com/problems/length-of-last-word/ for the full problem statement.
Solve the "Longest Common Prefix" problem on LeetCode. See https://leetcode.com/problems/longest-common-prefix/ for the full problem statement.
Solve the "Merge Sorted Array" problem on LeetCode. See https://leetcode.com/problems/merge-sorted-array/ for the full problem statement.
Solve the "Merge Two Sorted Lists" problem on LeetCode. See https://leetcode.com/problems/merge-two-sorted-lists/ for the full problem statement.
What is the difference between null and undefined? When would you use each?
Solve the "Palindrome Number" problem on LeetCode. See https://leetcode.com/problems/palindrome-number/ for the full problem statement.
Solve the "Plus One" problem on LeetCode. See https://leetcode.com/problems/plus-one/ for the full problem statement.
From PROG2 Exercise 3 (Functions/Methods): Given `inputArr` and `randomArr` of equal length, return a `boolean[]` where `result[i]` is `true` if `randomArr[i] > inputArr[i]`, otherwise `false`.
From PROG2 Exercise 3 (Functions/Methods): Given a 1D `int[]` array, compute both the **sum** and the **product** of all elements and return them as `long[] { sum, product }`.
From PROG2 Exercise 5 (Inheritance): Write `calculateArray(int[] arr, boolean isSum)`. If `isSum` is `true`, return the sum of all entries; if `false`, return the product of all entries. (Hint: think about why `int` overflow can occur on 20-element products!)
From PROG2 Exercise 5: (a) What is inheritance? (b) Give everyday examples. (c) Where and how is it used in OOP? (d) What should be considered when designing classes for inheritance?
From PROG2 Exercise 5 (Inheritance): Given `class HeartRate` with `int[] hr` and `int hrMean`, add a constructor `HeartRate(int[] values)` that copies/stores the 10 heart-rate values into `hr` and computes `hrMean`.
From PROG2 Exercise 5: How are constructors of the base class and derived classes called, and how can you invoke a base class constructor from a derived class?
From PROG2 Exercise 5: What is UML (Unified Modeling Language), and which diagram types do you know?
From PROG2 Exercise 5: How do you represent Exercise 4 (Vehicle, Bicycle, Bus) in UML form, and what needs to be considered?
Implement Progress Bar. See https://www.greatfrontend.com/questions/user-interface/progress-bar for the full problem statement.
Solve the "Remove Duplicates from Sorted Array" problem on LeetCode. See https://leetcode.com/problems/remove-duplicates-from-sorted-array/ for the full problem statement.
Solve the "Remove Duplicates from Sorted List" problem on LeetCode. See https://leetcode.com/problems/remove-duplicates-from-sorted-list/ for the full problem statement.
Solve the "Remove Element" problem on LeetCode. See https://leetcode.com/problems/remove-element/ for the full problem statement.
Solve the "Roman to Integer" problem on LeetCode. See https://leetcode.com/problems/roman-to-integer/ for the full problem statement.
Solve the "Same Tree" problem on LeetCode. See https://leetcode.com/problems/same-tree/ for the full problem statement.
Solve the "Search Insert Position" problem on LeetCode. See https://leetcode.com/problems/search-insert-position/ for the full problem statement.
Solve the "Sqrt(x)" problem on LeetCode. See https://leetcode.com/problems/sqrtx/ for the full problem statement.
Build a tabs component that displays one panel of content at a time depending on the active tab element. Some HTML is provided for you as example content. Requirements Clicking a tab makes it the active tab. Add a visual indication (e.g. using blue text color) for the active tab to differentiate it from the non-active tabs. At all times, only one panel's contents should be displayed — the one corresponding to the active tab. Notes The focus of this question is functionality, not styling. There's no need to write any custom CSS except for highlighting the active tab. You may modify the markup (e.g. adding id s, data attributes, replacing some tags, etc.) and use client-side rendering instead. You may want to think about ways to improve the user experience of the application and implement them (you get bonus credit for doing that during interviews).
You're given some existing HTML for a Todo List app. Add the following functionality to the app: Add new tasks on clicking the "Submit" button. The <input> field should be cleared upon successful addition. Remove tasks from the Todo List upon clicking the "Delete" button. Notes The focus of this question is on functionality, not styling. There's no need to write any custom CSS. You may modify the markup (e.g. adding id s, data attributes, replacing some tags, etc.), but the result should remain the same visually. You may want to think about ways to improve the user experience of the application and implement them (you get bonus credit for doing that during interviews).
Solve the "Two Sum" problem on LeetCode. See https://leetcode.com/problems/two-sum/ for the full problem statement.
Solve the "Valid Parentheses" problem on LeetCode. See https://leetcode.com/problems/valid-parentheses/ for the full problem statement.
What are the differences between var, let, and const in JavaScript?
List the rules that must be followed when using React hooks and explain why each rule exists.
Explain the Promise API and how async/await is related to it.
Explain event delegation and describe a scenario where you would use it.
Explain how Reacts virtual DOM works and why it was introduced.
Create a React component that loads more items when the user scrolls near the bottom of the page. Use IntersectionObserver to detect when a sentinel element enters the viewport, then fetch the next page of data.
Solve the "First Missing Positive" problem on LeetCode. See https://leetcode.com/problems/first-missing-positive/ for the full problem statement.
Build a React component that renders only the items currently visible in the viewport from a potentially huge list (10 000+ items). Compute which items are in view based on the scroll position and item height.
Implement JSON Parse. See https://www.greatfrontend.com/questions/javascript/json-parse for the full problem statement.
Solve the "Largest Rectangle in Histogram" problem on LeetCode. See https://leetcode.com/problems/largest-rectangle-in-histogram/ for the full problem statement.
Solve the "Longest Valid Parentheses" problem on LeetCode. See https://leetcode.com/problems/longest-valid-parentheses/ for the full problem statement.
Solve the "Maximal Rectangle" problem on LeetCode. See https://leetcode.com/problems/maximal-rectangle/ for the full problem statement.
Solve the "Median of Two Sorted Arrays" problem on LeetCode. See https://leetcode.com/problems/median-of-two-sorted-arrays/ for the full problem statement.
Implement Memoize II. See https://www.greatfrontend.com/questions/javascript/memoize-ii for the full problem statement.
Solve the "Merge k Sorted Lists" problem on LeetCode. See https://leetcode.com/problems/merge-k-sorted-lists/ for the full problem statement.
Solve the "Minimum Window Substring" problem on LeetCode. See https://leetcode.com/problems/minimum-window-substring/ for the full problem statement.
Solve the "N-Queens" problem on LeetCode. See https://leetcode.com/problems/n-queens/ for the full problem statement.
Solve the "N-Queens II" problem on LeetCode. See https://leetcode.com/problems/n-queens-ii/ for the full problem statement.
Solve the "Permutation Sequence" problem on LeetCode. See https://leetcode.com/problems/permutation-sequence/ for the full problem statement.
Solve the "Regular Expression Matching" problem on LeetCode. See https://leetcode.com/problems/regular-expression-matching/ for the full problem statement.
Solve the "Reverse Nodes in k-Group" problem on LeetCode. See https://leetcode.com/problems/reverse-nodes-in-k-group/ for the full problem statement.
Solve the "Scramble String" problem on LeetCode. See https://leetcode.com/problems/scramble-string/ for the full problem statement.
Solve the "Substring with Concatenation of All Words" problem on LeetCode. See https://leetcode.com/problems/substring-with-concatenation-of-all-words/ for the full problem statement.
Solve the "Sudoku Solver" problem on LeetCode. See https://leetcode.com/problems/sudoku-solver/ for the full problem statement.
Solve the "Text Justification" problem on LeetCode. See https://leetcode.com/problems/text-justification/ for the full problem statement.
Solve the "Trapping Rain Water" problem on LeetCode. See https://leetcode.com/problems/trapping-rain-water/ for the full problem statement.
Solve the "Valid Number" problem on LeetCode. See https://leetcode.com/problems/valid-number/ for the full problem statement.
Solve the "Wildcard Matching" problem on LeetCode. See https://leetcode.com/problems/wildcard-matching/ for the full problem statement.
Solve the "3Sum" problem on LeetCode. See https://leetcode.com/problems/3sum/ for the full problem statement.
Solve the "3Sum Closest" problem on LeetCode. See https://leetcode.com/problems/3sum-closest/ for the full problem statement.
Solve the "4Sum" problem on LeetCode. See https://leetcode.com/problems/4sum/ for the full problem statement.
Solve the "Add Two Numbers" problem on LeetCode. See https://leetcode.com/problems/add-two-numbers/ for the full problem statement.
Implement Array Methods. See https://www.greatfrontend.com/questions/javascript/array-methods for the full problem statement.
Create a React hook useLocalStorage<T>(key, initialValue) that behaves like useState but persists the value to localStorage. It should read the stored value on mount and write back on every update.
Solve the "Combination Sum" problem on LeetCode. See https://leetcode.com/problems/combination-sum/ for the full problem statement.
Solve the "Combination Sum II" problem on LeetCode. See https://leetcode.com/problems/combination-sum-ii/ for the full problem statement.
Solve the "Combinations" problem on LeetCode. See https://leetcode.com/problems/combinations/ for the full problem statement.
Solve the "Container With Most Water" problem on LeetCode. See https://leetcode.com/problems/container-with-most-water/ for the full problem statement.
Solve the "Count and Say" problem on LeetCode. See https://leetcode.com/problems/count-and-say/ for the full problem statement.
Currying is the technique of converting a function that takes multiple arguments into a sequence of functions that each take a single argument. Implement curry(fn) to return a curried version of fn . Collect one argument at a time until at least fn.length arguments have been provided, then call fn with the collected arguments. Calls with no arguments should be ignored and return another function. Preserve the this value from the first call in the chain when fn is finally invoked. Arguments fn (Function) : The function to curry. Returns (Function) : Returns the curried function. Examples
Debouncing controls how often a function can execute over time. When a JavaScript function is debounced with a wait time of wait milliseconds, it runs only after wait milliseconds have elapsed since the debounced function was last called. You have probably encountered debouncing in daily life before, such as when entering an elevator. Only after some time passes without pressing the "Door open" button (the debounced function not being called) will the elevator door actually close (the callback function is executed). Implement debounce(func, wait) so that func is called only after wait milliseconds have passed since the most recent call. The returned function should not invoke func immediately. When the delayed call finally runs, it should use the latest arguments and preserve the this value from the most recent call. Arguments func (Function) : The callback to debounce. wait (number) : The number of milliseconds to wait after the latest call. Returns (Function) : Returns the debounced function. Examples
Solve the "Decode Ways" problem on LeetCode. See https://leetcode.com/problems/decode-ways/ for the full problem statement.
A deep clone makes a copy of a JavaScript value such that the copy has no shared references to nested arrays or objects in the original. Mutating the cloned value should never affect the original. How to deep clone an object in JavaScript In production code, use the built-in structuredClone() :
Write a deepClone(obj) function that returns a deep copy of a plain object/array. Handle nested objects, arrays, null, and primitive values. Do not use JSON.parse/JSON.stringify.
Implement a function deepEqual that performs a deep comparison between two values. It returns true if the two input values are deemed equal and false otherwise. You can assume there are only JSON-serializable values (numbers, strings, booleans, null , objects, arrays). There will not be cyclic objects, i.e. objects with circular references. Examples
Solve the "Divide Two Integers" problem on LeetCode. See https://leetcode.com/problems/divide-two-integers/ for the full problem statement.
Solve the "Edit Distance" problem on LeetCode. See https://leetcode.com/problems/edit-distance/ for the full problem statement.
An EventEmitter is a small object that lets one piece of code emit named events and any number of other places listen for them. It is the core of the publish-subscribe (pub/sub) pattern and one of the most common ways to decouple producers from consumers in JavaScript. Where you'll see this pattern in real code The EventEmitter API shows up across the JavaScript ecosystem: Node.js streams and core modules. stream.on('data', chunk => ...) , process.on('exit', ...) , and httpServer.on('request', ...) all use Node's built-in EventEmitter . Browser EventTarget . Every DOM node is an EventTarget , and addEventListener , removeEventListener , and dispatchEvent follow the same shape. Modern Node and browsers expose EventTarget directly, so most apps no longer need a custom class. Library hooks. Express middleware events, Socket.io rooms, Redis pub/sub clients, MongoDB change streams, and most CLI tools expose pub/sub on top of an emitter. In-app decoupling. A small emitter can act as a backbone for cross-component events (for example, a global toast bus, an analytics dispatcher, or a feature-flag refresh signal) when adding global state would be
How does JavaScript handle asynchronous operations if it is single-threaded?
What are generics in TypeScript and why are they useful? Give a practical example.
Write an async function fetchWithRetry(url, retries = 3) that fetches a URL and retries up to retries times on failure, with exponential backoff between attempts.
Solve the "Find First and Last Position of Element in Sorted Array" problem on LeetCode. See https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/ for the full problem statement.
Implement Function.prototype.bind. See https://www.greatfrontend.com/questions/javascript/function-bind for the full problem statement.
Solve the "Generate Parentheses" problem on LeetCode. See https://leetcode.com/problems/generate-parentheses/ for the full problem statement.
Solve the "Gray Code" problem on LeetCode. See https://leetcode.com/problems/gray-code/ for the full problem statement.
Solve the "Group Anagrams" problem on LeetCode. See https://leetcode.com/problems/group-anagrams/ for the full problem statement.
Build a class with on(event, listener), off(event, listener), and emit(event, ...args) methods. Multiple listeners can be registered for the same event.
Write a curry() function that converts a function with multiple parameters into a series of unary functions. curry(add)(1)(2)(3) should equal add(1,2,3).
Write a debounce function that delays invoking a callback until after a given wait time has elapsed since the last call. It should return a new function that, when called repeatedly, only executes the original function once the user has stopped calling it for the specified milliseconds.
Using only TypeScript mapped types and key remapping, implement your own version of the built-in Pick<T, K> utility type. Then use it to create a type UserPreview that picks id and name from a User type.
Implement your own version of Promise.all() that takes an array of promises and returns a single promise that resolves with an array of results, or rejects as soon as any promise rejects.
Write a throttle function that ensures a callback is called at most once per given time interval, no matter how many times it is triggered.
Solve the "Insert Interval" problem on LeetCode. See https://leetcode.com/problems/insert-interval/ for the full problem statement.
Solve the "Integer to Roman" problem on LeetCode. See https://leetcode.com/problems/integer-to-roman/ for the full problem statement.
Solve the "Interleaving String" problem on LeetCode. See https://leetcode.com/problems/interleaving-string/ for the full problem statement.
Implement JSON Stringify. See https://www.greatfrontend.com/questions/javascript/json-stringify for the full problem statement.
Solve the "Jump Game" problem on LeetCode. See https://leetcode.com/problems/jump-game/ for the full problem statement.
Solve the "Jump Game II" problem on LeetCode. See https://leetcode.com/problems/jump-game-ii/ for the full problem statement.
Solve the "Letter Combinations of a Phone Number" problem on LeetCode. See https://leetcode.com/problems/letter-combinations-of-a-phone-number/ for the full problem statement.
Solve the "Longest Palindromic Substring" problem on LeetCode. See https://leetcode.com/problems/longest-palindromic-substring/ for the full problem statement.
Solve the "Longest Substring Without Repeating Characters" problem on LeetCode. See https://leetcode.com/problems/longest-substring-without-repeating-characters/ for the full problem statement.
Solve the "Maximum Subarray" problem on LeetCode. See https://leetcode.com/problems/maximum-subarray/ for the full problem statement.
A memoize function is a higher-order function that takes a function and returns a memoized version of it. The memoized function caches the results of expensive function calls and returns the cached result when it receives the same inputs again. This can significantly improve the performance of functions that involve complex processing or significant latency and are called with the same arguments repeatedly. Implement a function memoize(func) that takes a function parameter func and returns a memoized version of the function. You may assume that func only accepts a string or number as its only argument. Examples
Solve the "Merge Intervals" problem on LeetCode. See https://leetcode.com/problems/merge-intervals/ for the full problem statement.
Solve the "Minimum Path Sum" problem on LeetCode. See https://leetcode.com/problems/minimum-path-sum/ for the full problem statement.
Implement Modal Dialog. See https://www.greatfrontend.com/questions/user-interface/modal-dialog for the full problem statement.
Solve the "Multiply Strings" problem on LeetCode. See https://leetcode.com/problems/multiply-strings/ for the full problem statement.
Solve the "Next Permutation" problem on LeetCode. See https://leetcode.com/problems/next-permutation/ for the full problem statement.
Solve the "Partition List" problem on LeetCode. See https://leetcode.com/problems/partition-list/ for the full problem statement.
Solve the "Permutations" problem on LeetCode. See https://leetcode.com/problems/permutations/ for the full problem statement.
Solve the "Permutations II" problem on LeetCode. See https://leetcode.com/problems/permutations-ii/ for the full problem statement.
Solve the "Pow(x, n)" problem on LeetCode. See https://leetcode.com/problems/powx-n/ for the full problem statement.
From PROG2 Exercise 3 (Functions/Methods): Given two 2D vectors `double[] v1` and `double[] v2` (each length 2), compute the angle between them in **degrees** using the dot product formula.
From PROG2 Exercise 3 (Functions/Methods): Given a 2D `int[][]` matrix, extract all numbers that are odd (`v % 2 != 0`) OR divisible by 9 (`v % 9 == 0`) in row-major order as an `int[]`.
From PROG2 Exercise 5 (Inheritance, Figure 1): Implement the UML class hierarchy: `Employee` (`lastName`, `firstName`, `salary`, `transfer()`), `SalariedEmployee extends Employee` (`commission`), and `Worker extends Employee` (`hours`, `hourlyWage`, `calculateWage()`).
From PROG2 Exercise 5 (Inheritance): Create base class `Vehicle` (`wheelCount`, `name`, `color`, `show()`), derive `Bicycle` (`gearCount`, `brakeType`, `show()`) and `Bus` (`consumption`, `tankSize`, `range`, `show()`, `calculateRange()`).
From PROG2 Exercise 5 (Inheritance): Create a 3-level hierarchy: `Person` (`age`, `name`, `height`, `show()`), `Student extends Person` (`course`, `grade`, `show()`), and `Bachelor extends Student` (`degreeProgram`, `show()`).
From PROG2 Exercise 5: (a) What happens when a method in a derived class has the same signature as in the base class, and what annotation/keyword is used? (b) Can you overload base class methods in a derived class?
Promise.all() is one of the most-used asynchronous APIs in JavaScript. Below is a quick reference on how to use it, then a mental model of how it works, and finally an interview challenge to implement it from scratch. How Promise.all is used in practice Promise.all() takes an iterable of values (usually Promise s) and returns a single Promise . The returned promise fulfills when all input promises fulfill, with an array of the results in the same order as the input. It rejects immediately when any input rejects, with the reason of the first rejection. The most common use is fetching data from multiple endpoints concurrently before rendering:
Implement Promise.allSettled. See https://www.greatfrontend.com/questions/javascript/promise-allsettled for the full problem statement.
Note: If you haven't completed the Promise.all question, you should attempt that first. Promise.any() takes an iterable of elements (usually Promises ). It returns a single promise that resolves as soon as any of the elements in the iterable fulfills, with the value of the fulfilled promise. If no promises in the iterable fulfill (if all of the given elements are rejected), then the returned promise is rejected with an AggregateError , a new subclass of Error that groups together individual errors. If an empty iterable is passed, then the promise returned by this method is rejected synchronously. The rejected reason is an AggregateError object whose errors property is an empty array. Source: Promise.any() - JavaScript | MDN Implement a custom version of Promise.any() , a promiseAny function, except that the function takes an array instead of an iterable, and returned AggregateError s only need to contain an array of error reasons; the message doesn't have to be set. Refer to the AggregateError constructor examples on MDN . Be sure to read the description carefully and implement accordingly! Examples
Solve the "Recover Binary Search Tree" problem on LeetCode. See https://leetcode.com/problems/recover-binary-search-tree/ for the full problem statement.
Solve the "Remove Duplicates from Sorted Array II" problem on LeetCode. See https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/ for the full problem statement.
Solve the "Remove Duplicates from Sorted List II" problem on LeetCode. See https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/ for the full problem statement.
Solve the "Remove Nth Node From End of List" problem on LeetCode. See https://leetcode.com/problems/remove-nth-node-from-end-of-list/ for the full problem statement.
Implement Responsive Navbar. See https://www.greatfrontend.com/questions/user-interface/responsive-navbar for the full problem statement.
Solve the "Restore IP Addresses" problem on LeetCode. See https://leetcode.com/problems/restore-ip-addresses/ for the full problem statement.
Solve the "Reverse Integer" problem on LeetCode. See https://leetcode.com/problems/reverse-integer/ for the full problem statement.
Solve the "Reverse Linked List II" problem on LeetCode. See https://leetcode.com/problems/reverse-linked-list-ii/ for the full problem statement.
Solve the "Rotate Image" problem on LeetCode. See https://leetcode.com/problems/rotate-image/ for the full problem statement.
Solve the "Rotate List" problem on LeetCode. See https://leetcode.com/problems/rotate-list/ for the full problem statement.
Solve the "Search a 2D Matrix" problem on LeetCode. See https://leetcode.com/problems/search-a-2d-matrix/ for the full problem statement.
Solve the "Search in Rotated Sorted Array" problem on LeetCode. See https://leetcode.com/problems/search-in-rotated-sorted-array/ for the full problem statement.
Solve the "Search in Rotated Sorted Array II" problem on LeetCode. See https://leetcode.com/problems/search-in-rotated-sorted-array-ii/ for the full problem statement.
Solve the "Set Matrix Zeroes" problem on LeetCode. See https://leetcode.com/problems/set-matrix-zeroes/ for the full problem statement.
Implement Set Value. See https://www.greatfrontend.com/questions/javascript/set-value for the full problem statement.
Solve the "Simplify Path" problem on LeetCode. See https://leetcode.com/problems/simplify-path/ for the full problem statement.
Solve the "Sort Colors" problem on LeetCode. See https://leetcode.com/problems/sort-colors/ for the full problem statement.
Solve the "Spiral Matrix" problem on LeetCode. See https://leetcode.com/problems/spiral-matrix/ for the full problem statement.
Solve the "Spiral Matrix II" problem on LeetCode. See https://leetcode.com/problems/spiral-matrix-ii/ for the full problem statement.
Solve the "String to Integer (atoi)" problem on LeetCode. See https://leetcode.com/problems/string-to-integer-atoi/ for the full problem statement.
Solve the "Subsets" problem on LeetCode. See https://leetcode.com/problems/subsets/ for the full problem statement.
Solve the "Subsets II" problem on LeetCode. See https://leetcode.com/problems/subsets-ii/ for the full problem statement.
Solve the "Swap Nodes in Pairs" problem on LeetCode. See https://leetcode.com/problems/swap-nodes-in-pairs/ for the full problem statement.
Implement Throttle. See https://www.greatfrontend.com/questions/javascript/throttle for the full problem statement.
JavaScript is a dynamically typed language, which means the types of variables can change at runtime. Many interview questions involve recursively traversing values that contain different value types, and each type may require different handling (e.g. different code is needed to iterate over an array vs. an object). Understanding JavaScript types is crucial to solving questions like Deep Clone and Deep Equal . Implement the following utility functions to determine the types of primitive values. isBoolean(value) : Return true if value is a boolean, false otherwise. isNumber(value) : Return true if value is a number, false otherwise. Note that NaN is considered a number. isNull(value) : Return true if value is null , false otherwise. isString(value) : Return true if value is a string, false otherwise. isSymbol(value) : Return true if value is a symbol primitive, false otherwise. isUndefined(value) : Return true if value is undefined , false otherwise.
Solve the "Unique Binary Search Trees" problem on LeetCode. See https://leetcode.com/problems/unique-binary-search-trees/ for the full problem statement.
Solve the "Unique Binary Search Trees II" problem on LeetCode. See https://leetcode.com/problems/unique-binary-search-trees-ii/ for the full problem statement.
Solve the "Unique Paths" problem on LeetCode. See https://leetcode.com/problems/unique-paths/ for the full problem statement.
Solve the "Unique Paths II" problem on LeetCode. See https://leetcode.com/problems/unique-paths-ii/ for the full problem statement.
What is the difference between useEffect and useLayoutEffect? When should you use each?
Solve the "Valid Sudoku" problem on LeetCode. See https://leetcode.com/problems/valid-sudoku/ for the full problem statement.
Solve the "Validate Binary Search Tree" problem on LeetCode. See https://leetcode.com/problems/validate-binary-search-tree/ for the full problem statement.
Explain WeakMap and WeakSet in JavaScript and describe a real-world use case.
Solve the "Word Search" problem on LeetCode. See https://leetcode.com/problems/word-search/ for the full problem statement.
Solve the "Zigzag Conversion" problem on LeetCode. See https://leetcode.com/problems/zigzag-conversion/ for the full problem statement.
Open the free playground and start solving right now — no setup required.