Reading code matters as much as writing it, even more when AI writes most of it. Hunt bugs, predict output, review AI solutions, read complexity.
Bug Hunt
Realistic modules that run, with one fault hidden in them: the short ones forty lines, the long ones over a hundred. The point is not to rewrite: read the code, find the fault and fix it by changing as few lines as you can. Python only.
- Calendar Blocks121 lines · at most 6 may changeEasy
- Log Streaks114 lines · at most 6 may changeEasy
- Response Ranks109 lines · at most 6 may changeEasy
- Org Chart101 lines · at most 6 may changeEasy
- Badge Reader106 lines · at most 5 may changeEasy
- Cart Total106 lines · at most 5 may changeEasy
- Ordered Feed103 lines · at most 5 may changeEasy
- Headline Counter111 lines · at most 5 may changeEasy
- Invoice Numbers100 lines · at most 5 may changeEasy
- Mirror Codes106 lines · at most 5 may changeEasy
- Peak Load107 lines · at most 5 may changeEasy
- Promo Days108 lines · at most 5 may changeEasy
- The Empty Seat107 lines · at most 5 may changeEasy
- Even-Numbered Shifts105 lines · at most 5 may changeEasy
- Stock Alert107 lines · at most 5 may changeEasy
- Vote Tally103 lines · at most 5 may changeEasy
- Unique Visitors102 lines · at most 5 may changeEasy
- Ticket Queue106 lines · at most 6 may changeMedium
- Sales Window108 lines · at most 6 may changeMedium
- Warehouse Zones101 lines · at most 6 may changeMedium
- Weather Widget100 lines · at most 6 may changeMedium
- Bonus Planner97 lines · at most 6 may changeMedium
- Shelf Balance104 lines · at most 5 may changeMedium
- Outright Majority103 lines · at most 5 may changeMedium
- Budget Pair109 lines · at most 5 may changeMedium
- Citation Rank100 lines · at most 5 may changeMedium
- Meeting Clash101 lines · at most 5 may changeMedium
- Closest Prices103 lines · at most 5 may changeMedium
- Demo Slots102 lines · at most 5 may changeMedium
- Gift Pair106 lines · at most 5 may changeMedium
- Template Linter105 lines · at most 5 may changeMedium
- No-Repeat Playlist103 lines · at most 5 may changeMedium
- Quota Window106 lines · at most 5 may changeMedium
- Runner-Up111 lines · at most 5 may changeMedium
- Stepping Stones104 lines · at most 5 may changeMedium
- Best Streak112 lines · at most 5 may changeMedium
- Sign-up Audit103 lines · at most 6 may changeHard
- Order Queue97 lines · at most 8 may changeHard
- Price Watch104 lines · at most 12 may changeHard
- Price Alerts104 lines · at most 5 may changeHard
- Billboard103 lines · at most 5 may changeHard
- Fair Bonus102 lines · at most 5 may changeHard
- Cable Joining100 lines · at most 5 may changeHard
- Change Maker102 lines · at most 5 may changeHard
- Delivery Loop101 lines · at most 5 may changeHard
- Exact Change101 lines · at most 5 may changeHard
- Growth Chain107 lines · at most 5 may changeHard
- Pager Codes101 lines · at most 5 may changeHard
- Rolling Peak102 lines · at most 5 may changeHard
- Room Planner107 lines · at most 5 may changeHard
- Signal Difference108 lines · at most 5 may changeHard
Break the Code
The code is almost right. Write no code: find an input that makes it give the wrong answer. The skill that matters most when writing tests.
- How Many in Range?Easy
- Any Repeat?Easy
- Sum of the EvensEasy
- Last SeenEasy
- Is It Sorted?Easy
- SignEasy
- Count the NegativesEasy
- All Positive?Easy
- First NegativeEasy
- ProductEasy
- ClampEasy
- Days in the MonthEasy
- Sum up to nEasy
- Binary to DecimalEasy
- Any Frost?Easy
- How Many Digits?Easy
- Balanced BracketsMedium
- MedianMedium
- Is It a Palindrome?Medium
- Leap YearMedium
- Largest SpreadMedium
- How Many Different Values?Medium
- Digit SumMedium
- Count the WordsMedium
- Where Is the Largest?Medium
- Did the Account Go Negative?Medium
- The FizzBuzz ValueMedium
- Whole Square RootMedium
- A Pair That Makes TenMedium
- Is It a Triangle?Medium
- Is It Prime?Medium
- Longest Run of OnesMedium
- Shift by OneMedium
- Does It Appear in Order?Medium
- One Direction?Medium
- Sum of the Second HalfMedium
- Sort ThemMedium
- Reverse ItMedium
- Sum of the Last ThreeMedium
- Second LargestHard
- Fewest CoinsHard
- MajorityHard
- Binary SearchHard
- Average, Rounded DownHard
- Largest Run TotalHard
- Two Kinds of BracketsHard
- How Many Times?Hard
- Largest ProductHard
- Drop the ExtremesHard
- Remove the ThreesHard
- Halve and RoundHard
Bug Hunt
Code that looks fine is not: which line, and what kind of bug?
- Find the LargestArrays
- Sliding WindowArrays
- Most Common WordHashing
- Palindrome CheckTwo Pointers & Sliding Window
- PowerRecursion & Divide and Conquer
- Reverse the WordsStacks & Queues
- StaircaseDynamic Programming
- Tree DepthTrees
- Reachable NodesGraphs
- Anagram?Strings
- Insertion SortSorting
- Jump GameGreedy & Intervals
- Reverse the ListLinked Lists
- Count the OnesBit Manipulation
Predict the Output
Run the code in your head and write what it prints.
- SlicesArrays
- Odd SquaresArrays
- Letter CountHashing
- Merging Two ListsTwo Pointers & Sliding Window
- Calling ItselfRecursion & Divide and Conquer
- Monotonic StackStacks & Queues
- Coin TableDynamic Programming
- In-order WalkTrees
- Walking with a StackGraphs
- Pop the SmallestHeaps & Priority Queues
- Text SlicesStrings
- Sorting by a KeySorting
- Picking MeetingsGreedy & Intervals
- Fast and SlowLinked Lists
- Bit OperatorsBit Manipulation
Review the AI
Three AI answers to one problem: correct, slow, buggy. Label them like a code review.
Read the Big-O
Read the growth rate: how does the time grow with the input?
- Ordered PairsArrays
- HalvingArrays
- Common ItemsHashing
- Sorted Pair SumTwo Pointers & Sliding Window
- Branching CallsRecursion & Divide and Conquer
- Fibonacci That RemembersDynamic Programming
- Visited as a ListGraphs
- Sorting with a HeapHeaps & Priority Queues
- Repeated LetterStrings
- Sort, Then SearchSorting
- Append at the EndLinked Lists