Coding Challenges

Browse through our collection of broken code challenges. Each challenge presents a different bug or issue for you to fix. Select a challenge to start debugging and improve your programming skills.

20 Challenges Found

Fix the Broken QuickSort

This implementation of QuickSort has a critical bug causing a stack overflow. Find and fix the issue to make it work correctly.

AlgorithmsAlgorithmsRecursionSorting
Medium

Debug the Fibonacci Sequence

This recursive Fibonacci implementation has a performance issue. Optimize it to handle larger inputs without timing out.

AlgorithmsAlgorithmsRecursionOptimization+1 more
Easy

Fix the Async Promise Chain

This code attempts to fetch user data, then their posts, and finally the comments on each post. However, it's not working correctly. Fix the promise chain to make it work as expected.

Asynchronous ProgrammingAsyncPromisesAPI+1 more
Medium

Fix the Event Listener Memory Leak

This code creates a button that changes color when clicked. However, it has a memory leak because event listeners are being added repeatedly. Fix the issue.

DOM ManipulationDOMEventsMemory Management+1 more
Medium

Fix the Closure Bug

This code attempts to create 5 buttons, each logging a different number when clicked. However, all buttons log the same number. Fix the closure issue.

JavaScript ConceptsClosuresScopeDOM+1 more
Medium

Fix the Binary Search

This binary search implementation has a bug that causes it to fail for certain inputs. Find and fix the issue.

AlgorithmsAlgorithmsSearchingArrays
Easy

Fix the React State Bug

This React component has a state update issue. The counter doesn't increment correctly when the button is clicked rapidly. Fix the bug.

ReactReactState ManagementHooks+1 more
Hard

Fix the Debounce Function

This debounce utility function is supposed to limit how often a function can be called, but it's not working correctly. Fix the implementation.

JavaScript ConceptsUtility FunctionsPerformanceTiming+1 more
Hard

Fix the Array Flattening Function

This function is supposed to flatten a nested array, but it doesn't handle all cases correctly. Fix the implementation.

Data StructuresArraysRecursionData Structures+1 more
Medium

Fix the Deep Clone Function

This deep clone function is supposed to create a complete copy of an object, but it has bugs. Fix the implementation to handle all cases correctly.

JavaScript ConceptsObjectsRecursionDeep Copy+1 more
Hard

Fix the String Reversal Function

This function is supposed to reverse a string, but it doesn't handle certain edge cases correctly. Fix the implementation.

StringsStringsArraysBasic+1 more
Easy

Fix the Palindrome Checker

This function is supposed to check if a string is a palindrome (reads the same forwards and backwards), but it has a bug. Fix the implementation.

StringsStringsAlgorithmsBasic+1 more
Easy

Fix the Throttle Function

This throttle utility function is supposed to limit how often a function can be called to once per specified time period, but it's not working correctly. Fix the implementation.

JavaScript ConceptsUtility FunctionsPerformanceTiming+1 more
Hard

Fix the CSS Selector Parser

This function is supposed to parse a CSS selector into its components, but it doesn't handle certain selectors correctly. Fix the implementation.

ParsingParsingRegular ExpressionsCSS+1 more
Medium

Fix the Merge Sort Implementation

This implementation of Merge Sort has a bug that causes it to produce incorrect results for certain inputs. Find and fix the issue.

AlgorithmsAlgorithmsSortingArrays+1 more
Medium

Fix the React useEffect Cleanup

This React component sets up an event listener but has a memory leak. Fix the implementation to properly clean up resources.

ReactReactHooksuseEffect+2 more
Hard

Fix the Infinite Loop in useEffect

This React component has an infinite loop in its useEffect hook. Find and fix the issue.

ReactReactHooksuseEffect+2 more
Medium

Fix the Memoization Bug

This React component uses useMemo incorrectly, causing unnecessary recalculations. Fix the implementation to properly memoize the expensive calculation.

PerformanceReactHooksuseMemo+2 more
Hard

Fix the Regex Pattern Matcher

This function is supposed to validate email addresses using a regular expression, but it's not working correctly for all valid email formats. Fix the implementation.

Regular ExpressionsRegular ExpressionsValidationStrings+1 more
Medium

Fix the Cache Implementation

This LRU (Least Recently Used) cache implementation has a bug that causes it to evict the wrong items. Fix the implementation.

Data StructuresData StructuresCacheLRU+2 more
Hard