Code Katas
Focused, repeatable coding exercises designed to build fluency between the math and the computational representation.
Kata 1: Counting Without Formula Guessing
Time limit: 20 minutes
Goal: Implement functions for permutations, combinations, and multinomial counts with clear input validation.
Setup: Use Python or your preferred language. Add tests for edge cases such as zero selections and repeated categories.
Repeat until: You can explain which function matches which problem structure without looking at notes.
Kata 2: Recurrence to Dynamic Programming
Time limit: 20 minutes
Goal: Implement the recurrence for binary strings with no consecutive 1s using both recursion and bottom-up DP.
Setup: Print the first 10 values and verify them against hand calculations.
Repeat until: You can move from recurrence statement to working DP table automatically.
Kata 3: Graph Invariants Checker
Time limit: 20 minutes
Goal: Given an undirected graph as an adjacency list, compute degrees, test connectivity, and report whether an Euler path or circuit exists.
Setup: Include at least three sample graphs with different parity profiles.
Repeat until: You can connect the code output directly to the graph theorems you are using.
Kata 4: Bipartite and Tree Tests
Time limit: 20 minutes
Goal: Implement one function that checks whether a graph is bipartite and another that checks whether it is a tree.
Setup: Use BFS or DFS; include disconnected and odd-cycle examples.
Repeat until: You can explain why the implementation mirrors the mathematical definitions.
Completion Standard
- Can implement each kata within the time limit
- Can explain the mathematical invariant behind each implementation
- Can write at least one test case that would catch a naive incorrect solution