26 Patterns · 3 TiersRevised 2025SPEC // FAANG_ALGO
DSA Patternsfirst principles.
A structured path from foundational patterns to advanced FAANG techniques. Follow the tiers in order — each pattern builds on the last.
26Patterns
3Tiers
~60 hrsTotal Time
Practice by companyNew
See the exact problems asked at top companies
Tier 1 · Beginner·9 patterns
Foundational Patterns
Core building blocks every other pattern depends on. Start here.
1
Hashing (Maps & Sets)O(1) lookups for frequency counting and duplicate detection
2-3 hrs
2
Two PointersConverge from both ends to find pairs in sorted data
3-4 hrs
3
Sliding WindowMaintain a dynamic window over contiguous elements
3-4 hrs
4
Prefix SumPrecompute cumulative sums for O(1) range queries
2 hrs
5
Binary SearchHalve the search space each step on sorted data
3-4 hrs
6
Sorting + Custom ComparatorsSort to unlock greedy, two-pointer, and interval techniques
2-3 hrs
7
StackLIFO for bracket matching, undo, and DFS iteration
2-3 hrs
8
RecursionSolve problems by solving smaller versions of themselves
3-4 hrs
9
Linked List TechniquesPremiumPointer manipulation for reversal, merge, and partitioning
2-3 hrs
Tier 2 · Intermediate·11 patterns
Composite Patterns
Combines beginner patterns. Most FAANG medium problems live here.
10
Fast & Slow PointersPremiumDetect cycles and find midpoints with two-speed traversal
2 hrs
11
Monotonic StackPremiumNext greater/smaller element in O(n)
2-3 hrs
12
Queue / DequePremiumFIFO for BFS and sliding window max/min
2 hrs
13
Heap / Priority QueuePremiumEfficiently track top-K or merge-K sorted streams
3-4 hrs
14
Greedy AlgorithmsPremiumLocally optimal choices that lead to global optimum
3-4 hrs
15
Tree Traversals (DFS/BFS)PremiumVisit every node systematically in hierarchical structures
3-4 hrs
16
BST ConceptsPremiumExploit sorted in-order property for O(log n) operations
2-3 hrs
17
BacktrackingPremiumExplore all candidates with pruning for constraint satisfaction
4-5 hrs
18
Graph Traversals (DFS/BFS)PremiumExplore connected nodes for islands, paths, and components
4-5 hrs
19
Interval ProblemsPremiumSort and sweep to merge, insert, or find overlaps
2-3 hrs
20
Difference ArrayPremiumApply range updates in O(1) each, reconstruct with prefix sum
1-2 hrs
Tier 3 · Advanced·6 patterns
High-Value FAANG Patterns
Complex patterns for hard-level interviews. Tackle these last.
21
Dynamic ProgrammingPremiumCache overlapping subproblems — 1D, 2D, knapsack, LIS
8-10 hrs
22
Topological SortPremiumOrder nodes respecting dependency constraints in DAGs
2-3 hrs
23
Union Find (Disjoint Set)PremiumTrack and merge connected components in near O(1)
2-3 hrs
24
Trie (Prefix Tree)PremiumFast prefix-based lookups for autocomplete and word search
2-3 hrs
25
Divide & ConquerPremiumSplit, solve halves independently, combine results
3-4 hrs
26
Bit ManipulationPremiumXOR tricks, bitmask DP, and O(1) integer operations
2-3 hrs
Ready to go deeper?
The detailed guide covers every pattern with intuition, code examples, practice problems, and a pattern recognition framework.
Open the Complete Guide