DSA Interview Patterns
Studies in this cluster, in series order. Each one keeps its own URL.
DSA & Algorithms
Interview pattern map — arrays to DP/backtracking — with Big-O, templates, and LeetCode drills.
DSA Interview Patterns
21 studies- 1.DSA for Interviews — Pattern Map, Complexity & How to DrillInterview DSA pattern map, Big-O cheat sheet, how to pick a pattern, and drill pacing for 20 core patterns.
- 2.Arrays & Two Pointers — Opposite Ends, Same Direction & PartitionOpposite-end and same-direction two pointers for sorted arrays, partitions, and O(n) pair scans.
- 3.Sliding Window — Fixed & Variable Windows for SubarraysFixed and variable sliding windows for subarray/substring constraints in O(n).
- 4.Prefix Sums & Difference Arrays — Range Queries in O(1)Prefix sums and difference arrays for range sums and range updates.
- 5.Binary Search & Search-on-Answer — Predicates, Bounds & FeasibilityClassic binary search plus search-on-answer over monotonic feasibility predicates.
- 6.Sorting, Intervals & Sweep Line — Merge, Overlap & EventsSort plus sweep for merge intervals, overlaps, and event-based line sweeps.
- 7.Stack & Monotonic Stack — Next Greater, Histograms & ParsingMonotonic stacks for next-greater/smaller, histogram areas, and expression parsing.
- 8.Queue, Deque & Monotonic Queue — Sliding Extrema & BFS HelpersDeque and monotonic queue for sliding-window maxima and BFS-friendly fronts.
- 9.Linked Lists — Reverse, Merge, Cycle Detection & Dummy HeadsIn-place reverse, merge, Floyd cycle, and dummy-head patterns for list surgery.
- 10.Binary Trees — DFS (Preorder, Inorder, Postorder; Recursion & Stack)Tree DFS orders with recursion and explicit stack; path and subtree aggregates.
- 11.Binary Trees — BFS / Level Order — Layers, Width & ZigzagLevel-order BFS for layers, width, zigzag, and closest-value-by-depth.
- 12.Binary Search Trees — Inorder, Bounds, LCA & ValidateBST invariants: inorder sortedness, insert/delete sketch, validate, and LCA.
- 13.Heaps, Priority Queues & Top-K — n-largest, Merge K & StreamingMin/max heaps for top-K, merge K lists, and streaming extremes.
- 14.Hashing, Frequency Maps & Counting — Two Sum Family & AnagramsHash maps for complements, frequency, anagrams, and O(1) expected lookups.
- 15.Graphs — DFS & BFS Traversal — Components, Cycles & Grid FloodGraph DFS/BFS for components, cycles, bipartite checks, and grid flood fill.
- 16.Graphs — Topological Sort & DAGs — Kahn, DFS Finish Times & CyclesKahn and DFS topo sort on DAGs; detect cycles and order dependencies.
- 17.Union-Find (Disjoint Set Union) — Connectivity, Components & KruskalDSU with path compression and union-by-rank for dynamic connectivity.
- 18.Shortest Paths — Dijkstra, Bellman-Ford & When Not To Use ThemDijkstra vs Bellman-Ford vs BFS-on-unweighted; negative edges and when not to.
- 19.Dynamic Programming — 1D Patterns — Climb, House Robber, LIS Families1D DP templates: recurrence, rolling arrays, and classic climb/robber/LIS shapes.
- 20.Dynamic Programming — 2D, Knapsack & Grids — Paths, Subsets & LCS2D DP for grids, 0/1 knapsack, LCS/edit distance, and space-optimized rolls.
- 21.Backtracking & Search Trees — Subsets, Permutations, Combinations & PruningBacktracking templates with choose/explore/unchoose and pruning for interviews.