AI Code Comprehension
Spot the hidden flaw in plausible AI interview solutions
Simulate modern Code Comprehension rounds: classic coding questions written by an AI that pass the obvious test, but break on subtle edge cases.
Your Progress
0 of 5 completed
Challenges in this collection
- 1
AI Attempt: FizzBuzz never says FizzBuzz
An AI assistant wrote this FizzBuzz. fizzbuzz(n) returns "Fizz" for multiples of 3, "Buzz" for multiples of 5, "FizzBuzz" for multiples of both, and otherwise the number as text. Example: fizzbuzz(15) → "FizzBuzz".
pythoneasy - 2
AI Attempt: The palindrome checker
An AI assistant wrote this to check if a word reads the same backwards, ignoring capitals. Example: is_palindrome("Racecar") → True, is_palindrome("hello") → False.
pythoneasy - 3
AI Attempt: The Two Sum Trap
An AI assistant wrote this for a classic interview question. has_pair_sum(numbers, target) returns True if two different numbers in the list add up to target. Example: has_pair_sum([1, 2, 3], 5) → True, has_pair_sum([5], 10) → False.
pythonmedium - 4
AI Attempt: Remove all occurrences
An AI assistant wrote this for a classic interview question. removeAll(arr, item) removes every copy of item from the array. Example: removeAll([1, 2, 2, 3], 2) → [1, 3].
javascriptmedium - 5
AI Attempt: The anagram checker
An AI assistant wrote this for a classic interview question. is_anagram(a, b) returns True when both words use the same letters, the same number of times. Example: is_anagram("listen", "silent") → True, is_anagram("aab", "abb") → False.
pythonmedium
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.
The Off-By-One Gauntlet
Fencepost errors, inclusive vs exclusive slice bounds, and loops that step one position too far.
Async Nightmares
The asynchronous bugs that silently swallow data: un-awaited promises, forEach loops with async callbacks, and race conditions.