Find the Bug
10 AI-generated snippets. Each one has exactly one subtle bug. Read the code, click the line you think is wrong, and see if your eye caught it.
The order that never saves
A checkout handler that logs success but leaves an empty database.
The admin check that lets everyone in
A role guard that compiles, runs, and protects nothing.
The todo that refuses to re-render
A React handler that updates state, yet the UI stays frozen.
The last customer no one calls
A batch emailer that misses exactly one person every run.
The payment that always "succeeds"
An API wrapper that swallows every failure and reports green.
The cache that never expires
A memoized function that never invalidates cached values.
The map that returns all undefined
An array transform that accidentally returns undefined for every item.
The UPDATE that nukes the table
An SQL update executed without a WHERE clause.
The generator emptied by a peek
A Python generator is iterated prematurely, leaving nothing for the caller.
The buffer index off-by-one
A C loop that writes one past the buffer end, risking corruption.