A focused collection of algorithm patterns implemented in idiomatic Go, designed for FAANG-style interviews and real-world intuition.
Each folder is self-contained and includes:
- a concise README (what it solves, invariants, complexity, common pitfalls, katas)
_test.gofiles with core tests plus TODO edge-case tests you implement yourself
- Breadth-First Search (BFS)
- Depth-First Search (DFS)
- Two Heaps (Median / Priority pattern)
- Two Pointers
- Sliding Window
- Topological Sort
- Merge Intervals
- Backtracking
- Trie (Prefix Tree)
- Flood Fill (Grid BFS/DFS)
- Segment Tree (Range queries)
- Pick a folder.
- Read the README (focus on invariants and typical interview formulations).
- Implement the missing functions (no solution code is provided by design).
- Run tests, then implement the TODO edge-case tests for mastery.
Run everything:
make test
go run gotest.tools/gotestsum@latest --format=testdox
github.com/medunes/go-algo/bfs:
✓ BFS core traversal (0.00s)
✓...
DONE 36 tests in 0.081s