Special Techniques and Misc Patterns
Power tools and edge-case solvers that don’t fit in a single category but frequently appear in real interviews.
1.0 Merge Intervals and Sweep Line
- Merge/insert intervals
- Meeting rooms
- Line sweep problems (min overlap)
2.0 Binary Search on Answer
- Minimum feasible value (ship capacity, days)
- Monotonic
f(x)problems - Minimize/maximize result over decision space
3.0 Sliding Window + Monotonic
- Maximum in window
- Min swaps to group elements
- Longest subarray under sum/condition
4.0 Reservoir Sampling & Randomized
- Pick random element with unknown N
- Shuffle array uniformly
- Randomized hashing
5.0 Simulation and State Machines
- Game of Life
- Spiral matrix
- Turing tape / DFA logic
6.0 Design + Iterator Patterns
- Nested Iterator
- Zigzag iterator
- Iterator for BST