Data Structures
& Algorithms
Patterns, complexity, and trade-offs properly indexed.
"This section organizes algorithms by the mental models engineers use to reason about problems, rather than by difficulty or problem count."
sticky_note_2How to Use
- →Start with patterns you don't recognize
- →Focus on why a pattern works
- →Revisit this as a reference
Mastery = recognizing patterns.
Core DSA Patterns
Core Operations
The mechanical foundation beneath every pattern. Mastery of operational precision.
Arrays & Prefix Techniques
Precompute information to answer queries efficiently
Two Pointers
Reduce nested loops by maintaining controlled window boundaries
Sliding Window
Track dynamic subarrays or substrings efficiently
Hashing & Frequency Maps
Trade space for time using constant-time lookups
Binary Search
Apply monotonic logic beyond sorted arrays
Recursion & Backtracking
Explore state spaces with controlled branching
Trees
Hierarchical data and traversal strategies
Graphs
Model relationships and dependencies
Heaps & Priority Queues
Efficiently track min/max elements
Dynamic Programming
Optimize overlapping subproblems with state transitions
- ✓Patterns are reusable thinking tools
- ✓Most problems combine multiple patterns
- ✓Focus on invariants and constraints
- ✓Always analyze time and space trade-offs
Algorithms are about constraints, not cleverness.