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.
Debug the Fibonacci Sequence
This recursive Fibonacci implementation has a performance issue. Optimize it to handle larger inputs without timing out.
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.
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.
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.
Fix the Binary Search
This binary search implementation has a bug that causes it to fail for certain inputs. Find and fix the issue.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Fix the Infinite Loop in useEffect
This React component has an infinite loop in its useEffect hook. Find and fix the issue.
Fix the Memoization Bug
This React component uses useMemo incorrectly, causing unnecessary recalculations. Fix the implementation to properly memoize the expensive calculation.
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.
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.