The Off-By-One Gauntlet
Conquer the most universal bug in computing
Fencepost errors, inclusive vs exclusive slice bounds, and loops that step one position too far.
Your Progress
0 of 5 completed
Challenges in this collection
- 1
Sum from 1 to n leaves out n
sum_range(n) adds up every whole number from 1 to n. Example: sum_range(5) → 15 (1 + 2 + 3 + 4 + 5).
pythoneasy - 2
First 3 items comes back with only 2
firstChunk(arr, size) returns the first size items of the array. Example: firstChunk([1, 2, 3, 4, 5], 3) → [1, 2, 3].
javascripteasy - 3
Last letter crashes with IndexError
last_char(text) returns the last character. Example: last_char("hello") → "o".
pythoneasy - 4
Adding up [1, 2, 3] gives NaN
sumAll(nums) adds up every number in the array. Example: sumAll([1, 2, 3]) → 6.
javascripteasy - 5
Shopping total crashes at the end of the list
cart_total(prices) adds up every price. Example: cart_total([10, 20, 30]) → 60.
pythoneasy
More collections to explore
Your First 5 Bugs
Five beginner-friendly bugs with clear symptoms and satisfying fixes. The best place to start if you are new to debugging.
Python Gotchas
Mutable default arguments, list.sort() returning None, and mutating a list while iterating over it.
JavaScript Type Coercion Traps
Accidental string concatenation, array sort ordering numbers alphabetically, and zero being falsely treated as missing.
Async Nightmares
The asynchronous bugs that silently swallow data: un-awaited promises, forEach loops with async callbacks, and race conditions.
AI Code Comprehension
Simulate modern Code Comprehension rounds: classic coding questions written by an AI that pass the obvious test, but break on subtle edge cases.