Off-by-One in LIMIT Clause
A pagination query returns one extra row on every page, causing duplicate entries in the UI. Find the line causing the issue.
Missing GROUP BY Column
This query is supposed to count orders per customer but throws a SQL error in strict mode. Identify the faulty line.
Wrong JOIN Type Loses Data
A report of all products and their sales totals silently drops products with zero sales. Find the architectural fault.
N+1 Query in Subquery Loop
This stored procedure runs a subquery inside a loop for each user, causing severe performance degradation at scale.
Recursive CTE Missing Base Case
This recursive CTE to traverse an org chart runs forever and crashes the database. Find the missing line.
Stack Underflow Not Handled
This stack implementation crashes when pop() is called on an empty stack. Identify the missing guard.
Linked List Node Leak on Delete
Deleting a node from the middle of a singly linked list leaves a dangling reference. Find the fault.
Binary Search Wrong Mid Calculation
This binary search overflows on large arrays due to an integer arithmetic fault. Find the problematic line.
Hash Map Infinite Loop on Resize
This custom hash map hangs when the load factor exceeds 0.75 because the resize logic has a cycle bug.
BST Insert Breaks Ordering
This BST insert function places nodes on the wrong side of the root for equal values, breaking in-order traversal.
var Hoisting in Loop Closures
All timeout callbacks log the same value instead of their loop index. Find the scoping fault.
Async/Await Missing Error Boundary
This async function swallows all errors silently, making failures impossible to debug in production.
Mutating State Directly in Reducer
This Redux-style reducer mutates state directly, causing React to miss re-renders.
Promise.all Fails Fast Without Recovery
A dashboard that fetches three independent data sources crashes entirely if any single source fails.
Memory Leak via Detached DOM Listener
Event listeners attached to dynamically created elements are never removed, causing a memory leak over time.
Mutable Default Argument
This function accumulates results across calls because of a classic Python pitfall. Find the fault.
Late Binding in Lambda Closures
A list of lambda functions all return the last value of the loop variable instead of their own captured value.
Generator Exhaustion Not Handled
This function processes a generator twice, but silently produces empty results on the second pass.
Thread Race Condition on Shared Counter
A multithreaded download manager counts completed tasks incorrectly because the counter is not thread-safe.
Circular Import Causes AttributeError
Two modules import each other at the top level. One module sees an incomplete version of the other, causing an AttributeError at runtime.
Function on Indexed Column Prevents Index Scan
A query that should use an index runs a full table scan instead. Find the line that defeats the index.
COUNT Ignores NULL Values
A query counting opt-in users returns an inflated number. Find the line with the wrong aggregate.
UPDATE Without WHERE Wipes Table
A maintenance script to reset trial users accidentally updates every row in production. Find the missing constraint.
Deadlock from Inconsistent Lock Order
Two concurrent transactions occasionally deadlock because they acquire locks in opposite order. Find the architectural fault.
ROW_NUMBER Wrong PARTITION Breaks Ranking
A leaderboard query ranks players globally instead of per-game, returning wrong rankings. Find the window function fault.
Self-Join Produces Cartesian Product
A query to find pairs of employees in the same department returns a massive result set with duplicates and self-pairs.
HAVING Used Instead of WHERE
A query filters rows before aggregation but uses HAVING, causing a full table scan on 10 million rows.
Queue Implemented as Stack
A task queue processes jobs in LIFO order instead of FIFO, so the oldest jobs never execute.
BFS Missing Visited Set Causes Infinite Loop
A graph BFS hangs on any graph with cycles because nodes are revisited indefinitely.
Memoization Key Collision in DP
A memoized longest common subsequence function returns wrong answers for some inputs because the cache key is ambiguous.
Min-Heap Comparator Inverted
A priority queue meant to always pop the smallest element actually returns the largest due to a comparator bug.
Quicksort Always Picks First Element on Sorted Input
This quicksort implementation has O(n²) worst-case performance on already-sorted arrays in production.
Trie Delete Removes Shared Prefix
Deleting one word from a trie removes other words that share a prefix with it.
typeof null Returns "object"
A null check using typeof passes for null values and crashes downstream code.
Floating Point Equality Comparison
A financial calculation comparison returns false for values that should be equal due to floating point precision.
Prototype Pollution via Recursive Merge
A deep merge utility allows an attacker to inject properties into Object.prototype, affecting all objects in the application.
Synchronous Code Blocking Event Loop
A Node.js API route hangs all concurrent requests while processing a large CSV file synchronously.
Chained .catch Does Not Stop Propagation
A promise chain continues executing after an error because a .catch in the middle silently swallows and recovers.
Object.assign Shallow Copies Nested Objects
Modifying a cloned config object also mutates the original because the clone is shallow.
Integer Division in Python 2 vs 3
A data processing script migrated from Python 2 produces slightly wrong averages due to a division behavior change.
Shallow Copy Mutates Nested List
A function that clones a 2D board for game state unexpectedly mutates the original board.
String Concatenation in Loop is O(n²)
Building a large report string by concatenation in a loop is 100x slower than expected. Find the performance fault.
asyncio Blocking Call in Coroutine
An async web scraper stalls all concurrent coroutines whenever any single page takes time to process.
GIL Blocks CPU-Bound Multithreading
Adding more threads to a CPU-intensive image processor does not improve speed — it actually gets slower.
Context Manager Not Used for File Handle
A log parser leaks file handles under error conditions because files are opened without a context manager.
Catching Too Broad an Exception
An API client silently swallows KeyboardInterrupt and SystemExit because the exception handler is too broad.
Array Index as key Breaks Reconciliation
A sortable list reuses the wrong component instances after reordering because of a bad key prop.
Derived State Stored in useState
A filtered list gets out of sync with its source because derived state is stored in separate useState instead of being computed.
useCallback Captures Stale Props
A memoized event handler always uses the initial prop value because the dependency array is empty.
Missing Suspense Boundary for React.lazy
A lazily loaded component crashes the entire page tree instead of showing a loading state when the chunk is still downloading.
Stale Closure in Event Listener
A keyboard shortcut handler always uses the initial state value because it is registered once without cleanup.
Batched State Updates Miscounted
A counter incremented three times in a row only increases by one instead of three due to React batching.
forwardRef Missing Breaks Parent Ref Access
A parent component cannot focus a custom input component because the ref is silently dropped.
Missing Dependency in useEffect
A useEffect hook reads stale state because a dependency is missing from the array, causing the callback to close over an old value.
Object Identity Breaks Memo
A React.memo-wrapped child re-renders on every parent render despite no visible prop changes.
State Update on Unmounted Component
An async fetch inside useEffect tries to update state after the component unmounts, causing a React warning and potential memory leak.
Context Value Causes Unnecessary Re-renders
Every component consuming this context re-renders when any part of the context value changes, even if they only use one field.
Infinite Loop in useEffect with setState
This component triggers an infinite render loop because a useEffect both reads and writes the same state without a condition.