Algorithmic Coding Challenges

Develop technical accuracy and run automated test suites directly in your browser.

All Problems

Implement Debounce Function

mediumJavaScript

Given a function `fn` and a time in milliseconds `t`, return a **debounced** version of that function. A **debounced** function is a function whose e...

UberLyftAirbnb
Solve Problem

Reverse a Linked List

mediumDSA

Given the `head` of a singly linked list, reverse the list, and return the reversed list. ### Example 1 **Input:** head = [1,2,3,4,5] **Output:** [5,...

FacebookStripeNetflix
Solve Problem

Two Sum

easyDSA

Given an array of integers `nums` and an integer `target`, return indices of the two numbers such that they add up to `target`. You may assume that e...

GoogleAmazonMicrosoft
Solve Problem

Build a React Counter Hook

easyReact

Develop a custom hook `useCounter` that supports increments, decrements, and optional reset bounds.

StripeMetaCoinbase
Solve Problem

Implement Event Emitter

hardJavaScript

Create an EventEmitter class that supports registering listeners, emitting events, and removing listeners. Methods required: - on() - emit() - off()

AirbnbMetaTwitter
Solve Problem

Implement Deep Clone

mediumJavaScript

Create a function that creates a deep copy of an object without sharing references with the original object. The cloned object should work with neste...

AmazonMicrosoftUber
Solve Problem

Convert Callback Function to Promise

hardJavaScript

Implement a utility function that converts a callback-based function into a Promise-based function. The returned function should resolve successful r...

GoogleNetflixMeta
Solve Problem

Implement Throttle Function

mediumJavaScript

Implement a throttle utility that limits how frequently a function can execute. The function should execute immediately and ignore repeated calls unt...

AmazonUberLinkedIn
Solve Problem

Flatten Nested Array

mediumJavaScript

Given a nested array, flatten it into a single-level array. The function should support multiple levels of nesting. Example: Input: [1,[2,[3,[4]]]] ...

GoogleAmazonMeta
Solve Problem

Implement Array Group By

mediumJavaScript

Create a function that groups array elements based on a given key or callback function. Example: Input: [{age:20},{age:30},{age:20}] Output: {20:[......

AmazonMicrosoftAdobe
Solve Problem

Implement Curry Function

hardJavaScript

Create a curry function that transforms a function with multiple arguments into a sequence of functions that each accept fewer arguments. Example: In...

GoogleMetaAmazon
Solve Problem

Implement JSON Stringify

hardJavaScript

Create a simplified version of JSON.stringify. Convert JavaScript objects and arrays into JSON formatted strings.

NetflixGoogleAmazon
Solve Problem

Implement Memoization Function

mediumJavaScript

Implement a memoize function that stores previous function results and returns cached values for repeated inputs. This improves performance by avoidi...

MetaUberStripe
Solve Problem

Implement Custom Map Function

easyJavaScript

Implement your own version of JavaScript Array.map without using the built-in map method. The function should accept a callback and return a new tran...

GoogleAppleMeta
Solve Problem

Flatten Array with Depth

mediumJavaScript

Flatten a nested array up to a given depth.

AmazonApple
Solve Problem

Implement Promise.all

hardJavaScript

Implement your own version of Promise.all. It should take an array of promises and return a single promise that resolves when all input promises resol...

GoogleMetaAmazon
Solve Problem

Implement Promise.race

mediumJavaScript

Implement Promise.race that resolves or rejects as soon as one promise settles.

NetflixAmazon
Solve Problem

Remove Duplicates from Array

easyJavaScript

Return a new array with duplicate values removed.

GoogleAmazon
Solve Problem

Flip Function Arguments

easyJavaScript

Create a function that reverses the order of arguments passed to a function.

MetaGoogle
Solve Problem

Implement LRU Cache

hardJavaScript

Design and implement an LRU (Least Recently Used) cache.

GoogleMetaMicrosoft
Solve Problem

Function Pipeline

hardJavaScript

Implement a pipeline function that executes functions left to right.

AmazonNetflix
Solve Problem

Chunk Array

easyJavaScript

Split an array into chunks of given size.

MetaUber
Solve Problem

Function Composition

hardJavaScript

Implement a compose function that combines multiple functions from right to left.

GoogleMeta
Solve Problem

Deep Equal Check

mediumJavaScript

Check if two values are deeply equal (objects, arrays, primitives).

GoogleMeta
Solve Problem

Implement Search Filter Component

easyReact

Create a search component that filters a list of items based on user input.

AmazonMicrosoft
Solve Problem

Implement Infinite Scroll

hardReact

Create an infinite scrolling list that loads more data when the user reaches the bottom.

FacebookTwitterNetflix
Solve Problem

Build Drag and Drop List

hardReact

Implement drag and drop functionality to reorder list items.

GoogleMicrosoft
Solve Problem

Build Simple State Management Library

hardReact

Create a small state management solution using React concepts. Features: - Store state - Update state - Subscribe components

MetaNetflixAirbnb
Solve Problem

Build Todo List Component

easyReact

Create a React Todo component that allows users to add, delete, and mark tasks as completed. Requirements: - Add new todos - Remove todos - Toggle co...

MetaAmazonGoogle
Solve Problem

Create Reusable Modal Component

mediumReact

Build a reusable Modal component using React. Features: - Open and close modal - Handle outside click - Render children content

GoogleAirbnb
Solve Problem

Create Error Boundary Component

hardReact

Create a React error boundary that catches component errors and displays fallback UI.

MetaAmazon
Solve Problem

Build Pagination Component

mediumReact

Create a reusable pagination component that displays items page by page.

MetaNetflixUber
Solve Problem

Debounced Search Input

mediumReact

Create a search input that delays API calls until the user stops typing.

AmazonGoogle
Solve Problem

Create Custom useFetch Hook

mediumReact

Implement a custom React hook that fetches API data and manages loading and error states.

MetaStripe
Solve Problem

Merge Intervals

mediumDSA

Given intervals, merge all overlapping intervals.

GoogleMeta
Solve Problem

Top K Frequent Elements

mediumDSA

Return the k most frequent elements in an array.

GoogleMeta
Solve Problem

Product of Array Except Self

mediumDSA

Return array where each element is product of all other elements except itself.

AmazonGoogle
Solve Problem

Rotate Array

mediumDSA

Rotate an array to the right by k steps.

AmazonGoogle
Solve Problem

Reverse String

easyDSA

Reverse a string using two pointers approach.

MetaMicrosoft
Solve Problem

Two Sum II (Sorted Array)

easyDSA

Find two numbers in a sorted array that add up to target.

AmazonGoogle
Solve Problem

Spiral Matrix

mediumDSA

Return all elements of a matrix in spiral order.

GoogleMicrosoft
Solve Problem

Search a 2D Matrix

mediumDSA

Search target in a sorted 2D matrix.

GoogleMicrosoft
Solve Problem

Best Time to Buy and Sell Stock

easyDSA

You are given an array where each element is price of a stock on a day. Find maximum profit by choosing a single buy and sell day.

AmazonMicrosoft
Solve Problem

Find Minimum in Rotated Sorted Array

mediumDSA

Find minimum element in rotated sorted array using binary search.

GoogleMeta
Solve Problem

Valid Parentheses

easyDSA

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. A string is valid if open brac...

GoogleAmazonMeta
Solve Problem

Binary Search

easyDSA

Implement binary search to find target in sorted array.

AmazonGoogle
Solve Problem

Valid Anagram

easyDSA

Check if two strings are anagrams of each other.

AmazonGoogle
Solve Problem

Linked List Cycle Detection

easyDSA

Detect if a linked list has a cycle.

GoogleAmazon
Solve Problem

Climbing Stairs

easyDSA

Count number of ways to reach nth stair.

AmazonMeta
Solve Problem

First Unique Character in a String

easyDSA

Find index of first non-repeating character in a string.

AmazonMeta
Solve Problem

Maximum Subarray (Kadane’s Algorithm)

mediumDSA

Find the contiguous subarray with the largest sum.

MetaAmazon
Solve Problem

Longest Substring Without Repeating Characters

mediumDSA

Find the length of the longest substring without repeating characters.

AmazonGoogle
Solve Problem

Container With Most Water

mediumDSA

Find two lines that together with x-axis forms container with max water.

GoogleAmazon
Solve Problem

Build Countdown Timer using useEffect

easyReact

Create a countdown timer that decreases every second using useEffect and useState. It should stop at zero and clean up properly.

MetaGoogle
Solve Problem

Implement Dark Mode Toggle

easyReact

Build a theme toggle button that switches between light and dark mode using React state.

NetflixAmazon
Solve Problem

Custom Form Validation

mediumReact

Create a form with validation for email, password strength, and required fields.

GoogleStripe
Solve Problem

Authentication using Context API

mediumReact

Implement authentication state management using React Context API.

MetaAmazon
Solve Problem

Optimize List Filtering using useMemo

mediumReact

Optimize a large list filtering operation using useMemo to avoid unnecessary recalculations.

MetaGoogle
Solve Problem

Prevent Re-renders using useCallback

mediumReact

Use useCallback to prevent unnecessary re-renders of child components when passing event handlers.

AmazonMeta
Solve Problem

Implement Error Boundary Component

mediumReact

Create a React Error Boundary that catches runtime errors and displays fallback UI.

GoogleMeta
Solve Problem

Stop Event Bubbling in Nested Components

easyReact

Create a nested component structure where clicking a child button should not trigger parent click events. Demonstrate proper event handling using stop...

MetaGoogle
Solve Problem

Create usePrevious Hook

mediumReact

Build a custom hook that stores and returns the previous state value.

MetaGoogle
Solve Problem

Build Multi-Step Form Wizard

mediumReact

Create a multi-step form with next/back navigation and state persistence across steps.

StripeUber
Solve Problem

Build Search Filter Component

easyReact

Filter a list of items based on user input search query.

GoogleMeta
Solve Problem

Implement Infinite Scroll List

mediumReact

Build a list that loads more data when user scrolls to bottom.

AmazonNetflix
Solve Problem

Optimized Todo List with Memoization

hardReact

Build a todo list optimized using React.memo and useCallback to prevent unnecessary re-renders.

MetaGoogle
Solve Problem

Create useFetch Custom Hook

mediumReact

Build a reusable hook to fetch API data with loading and error states.

StripeMeta
Solve Problem

Build Reusable Modal Component

easyReact

Create a reusable modal with open/close functionality and overlay click handling.

NetflixAmazon
Solve Problem

Controlled vs Uncontrolled Input Behavior

easyReact

Build an input component that toggles between controlled and uncontrolled modes.

AmazonNetflix
Solve Problem