Algorithmic Coding Challenges
Develop technical accuracy and run automated test suites directly in your browser.
All Problems
Implement Debounce Function
mediumJavaScriptGiven a function `fn` and a time in milliseconds `t`, return a **debounced** version of that function. A **debounced** function is a function whose e...
Reverse a Linked List
mediumDSAGiven 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,...
Two Sum
easyDSAGiven 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...
Build a React Counter Hook
easyReactDevelop a custom hook `useCounter` that supports increments, decrements, and optional reset bounds.
Implement Event Emitter
hardJavaScriptCreate an EventEmitter class that supports registering listeners, emitting events, and removing listeners. Methods required: - on() - emit() - off()
Implement Deep Clone
mediumJavaScriptCreate a function that creates a deep copy of an object without sharing references with the original object. The cloned object should work with neste...
Convert Callback Function to Promise
hardJavaScriptImplement a utility function that converts a callback-based function into a Promise-based function. The returned function should resolve successful r...
Implement Throttle Function
mediumJavaScriptImplement a throttle utility that limits how frequently a function can execute. The function should execute immediately and ignore repeated calls unt...
Flatten Nested Array
mediumJavaScriptGiven a nested array, flatten it into a single-level array. The function should support multiple levels of nesting. Example: Input: [1,[2,[3,[4]]]] ...
Implement Array Group By
mediumJavaScriptCreate a function that groups array elements based on a given key or callback function. Example: Input: [{age:20},{age:30},{age:20}] Output: {20:[......
Implement Curry Function
hardJavaScriptCreate a curry function that transforms a function with multiple arguments into a sequence of functions that each accept fewer arguments. Example: In...
Implement JSON Stringify
hardJavaScriptCreate a simplified version of JSON.stringify. Convert JavaScript objects and arrays into JSON formatted strings.
Implement Memoization Function
mediumJavaScriptImplement a memoize function that stores previous function results and returns cached values for repeated inputs. This improves performance by avoidi...
Implement Custom Map Function
easyJavaScriptImplement 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...
Flatten Array with Depth
mediumJavaScriptFlatten a nested array up to a given depth.
Implement Promise.all
hardJavaScriptImplement 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...
Implement Promise.race
mediumJavaScriptImplement Promise.race that resolves or rejects as soon as one promise settles.
Remove Duplicates from Array
easyJavaScriptReturn a new array with duplicate values removed.
Flip Function Arguments
easyJavaScriptCreate a function that reverses the order of arguments passed to a function.
Implement LRU Cache
hardJavaScriptDesign and implement an LRU (Least Recently Used) cache.
Function Pipeline
hardJavaScriptImplement a pipeline function that executes functions left to right.
Chunk Array
easyJavaScriptSplit an array into chunks of given size.
Function Composition
hardJavaScriptImplement a compose function that combines multiple functions from right to left.
Deep Equal Check
mediumJavaScriptCheck if two values are deeply equal (objects, arrays, primitives).
Implement Search Filter Component
easyReactCreate a search component that filters a list of items based on user input.
Implement Infinite Scroll
hardReactCreate an infinite scrolling list that loads more data when the user reaches the bottom.
Build Drag and Drop List
hardReactImplement drag and drop functionality to reorder list items.
Build Simple State Management Library
hardReactCreate a small state management solution using React concepts. Features: - Store state - Update state - Subscribe components
Build Todo List Component
easyReactCreate a React Todo component that allows users to add, delete, and mark tasks as completed. Requirements: - Add new todos - Remove todos - Toggle co...
Create Reusable Modal Component
mediumReactBuild a reusable Modal component using React. Features: - Open and close modal - Handle outside click - Render children content
Create Error Boundary Component
hardReactCreate a React error boundary that catches component errors and displays fallback UI.
Build Pagination Component
mediumReactCreate a reusable pagination component that displays items page by page.
Debounced Search Input
mediumReactCreate a search input that delays API calls until the user stops typing.
Create Custom useFetch Hook
mediumReactImplement a custom React hook that fetches API data and manages loading and error states.
Merge Intervals
mediumDSAGiven intervals, merge all overlapping intervals.
Top K Frequent Elements
mediumDSAReturn the k most frequent elements in an array.
Product of Array Except Self
mediumDSAReturn array where each element is product of all other elements except itself.
Rotate Array
mediumDSARotate an array to the right by k steps.
Reverse String
easyDSAReverse a string using two pointers approach.
Two Sum II (Sorted Array)
easyDSAFind two numbers in a sorted array that add up to target.
Spiral Matrix
mediumDSAReturn all elements of a matrix in spiral order.
Search a 2D Matrix
mediumDSASearch target in a sorted 2D matrix.
Best Time to Buy and Sell Stock
easyDSAYou 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.
Find Minimum in Rotated Sorted Array
mediumDSAFind minimum element in rotated sorted array using binary search.
Valid Parentheses
easyDSAGiven a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. A string is valid if open brac...
Binary Search
easyDSAImplement binary search to find target in sorted array.
Valid Anagram
easyDSACheck if two strings are anagrams of each other.
Linked List Cycle Detection
easyDSADetect if a linked list has a cycle.
Climbing Stairs
easyDSACount number of ways to reach nth stair.
First Unique Character in a String
easyDSAFind index of first non-repeating character in a string.
Maximum Subarray (Kadane’s Algorithm)
mediumDSAFind the contiguous subarray with the largest sum.
Longest Substring Without Repeating Characters
mediumDSAFind the length of the longest substring without repeating characters.
Container With Most Water
mediumDSAFind two lines that together with x-axis forms container with max water.
Build Countdown Timer using useEffect
easyReactCreate a countdown timer that decreases every second using useEffect and useState. It should stop at zero and clean up properly.
Implement Dark Mode Toggle
easyReactBuild a theme toggle button that switches between light and dark mode using React state.
Custom Form Validation
mediumReactCreate a form with validation for email, password strength, and required fields.
Authentication using Context API
mediumReactImplement authentication state management using React Context API.
Optimize List Filtering using useMemo
mediumReactOptimize a large list filtering operation using useMemo to avoid unnecessary recalculations.
Prevent Re-renders using useCallback
mediumReactUse useCallback to prevent unnecessary re-renders of child components when passing event handlers.
Implement Error Boundary Component
mediumReactCreate a React Error Boundary that catches runtime errors and displays fallback UI.
Stop Event Bubbling in Nested Components
easyReactCreate a nested component structure where clicking a child button should not trigger parent click events. Demonstrate proper event handling using stop...
Create usePrevious Hook
mediumReactBuild a custom hook that stores and returns the previous state value.
Build Multi-Step Form Wizard
mediumReactCreate a multi-step form with next/back navigation and state persistence across steps.
Build Search Filter Component
easyReactFilter a list of items based on user input search query.
Implement Infinite Scroll List
mediumReactBuild a list that loads more data when user scrolls to bottom.
Optimized Todo List with Memoization
hardReactBuild a todo list optimized using React.memo and useCallback to prevent unnecessary re-renders.
Create useFetch Custom Hook
mediumReactBuild a reusable hook to fetch API data with loading and error states.
Build Reusable Modal Component
easyReactCreate a reusable modal with open/close functionality and overlay click handling.
Controlled vs Uncontrolled Input Behavior
easyReactBuild an input component that toggles between controlled and uncontrolled modes.
Your Coding Progress
Sign in to track completed questions and compare runtime execution speeds against other candidates.