DSA & Algorithms
FAANG Senior Interview Prep — pattern recognition and speed for 150-200 problems over 8-12 weeks
Phase 1 — Foundations (Week 1-2)
HashMap patterns, frequency counting, grouping
Sorted array tricks, opposite direction, same direction
Fixed and variable window, shrink/expand pattern
Monotonic stack, parsing, nested structures
Search space reduction, boundary finding, rotated arrays
Phase 2 — Core Data Structures (Week 3-4)
Fast/slow pointers, reversal, merge, cycle detection
DFS, BFS, BST operations, path problems, LCA
Prefix trees, word search, autocomplete
Top-K, merge K sorted, median finding, scheduling
Phase 3 — Advanced Patterns (Week 5-7)
Permutations, combinations, constraint satisfaction
BFS, DFS, topological sort, shortest path, union find
1D/2D DP, knapsack, LCS, LIS, interval DP
Interval scheduling, Huffman, activity selection
Phase 4 — Specialized Topics (Week 8-10)
Merge, insert, overlap detection, sweep line
Bitwise operations, XOR tricks, modular arithmetic
Disjoint sets, path compression, union by rank
Next greater element, sliding window max, histogram
QuickSort, MergeSort, counting sort, custom comparators
AVL, Red-Black, segment trees, Fenwick trees
Phase 5 — Mock & Review (Week 11-12)
Complete problem tracker review
Revisit all solved problems, identify weak patterns
10+ timed mock sessions (45 min each)
Simulate real interview conditions
Practice explaining approach before coding
Communication is half the interview
Review all hard problems
Focus on problems you struggled with
Practice system design alongside DSA
Senior interviews test both skills
Notes & Resources
Senior-Level Expectations at FAANG
At the senior level, interviewers expect:
- Optimal solution in 25-35 min — not just brute force
- Trade-off discussion — time vs space, readability vs performance
- Edge cases unprompted — empty input, overflow, duplicates
- Clean code — readable, modular, well-named variables
- Complexity analysis — instant, accurate, with justification
- Follow-up handling — "What if the input is sorted?" "What if it doesn't fit in memory?"
The Interview Framework
1. CLARIFY (2 min) — Input constraints? Size? Range? Sorted? Duplicates?
2. APPROACH (5 min) — Brute force first, identify pattern, propose optimal
3. CODE (15-20 min) — Clean, readable, handle edge cases
4. TEST (5 min) — Walk through example, test edge cases
5. OPTIMIZE (if time) — Can we reduce space/time?
Key Complexity Cheat Sheet
| Structure | Access | Search | Insert | Delete |
|---|---|---|---|---|
| Array | O(1) | O(n) | O(n) | O(n) |
| HashMap | O(1) | O(1) | O(1) | O(1) |
| Linked List | O(n) | O(n) | O(1) | O(1) |
| BST (balanced) | O(log n) | O(log n) | O(log n) | O(log n) |
| Heap | O(1) top | O(n) | O(log n) | O(log n) |
| Trie | - | O(m) | O(m) | O(m) |