14 patterns that cover 90% of FAANG interview problems. Click any pattern to expand.
14 of 14 patterns
Find optimal subarray/substring in O(n)
Traverse array from both ends simultaneously
Detect cycles and find midpoints in linked lists
Eliminate half the search space each iteration
Explore level by level — shortest path in unweighted graphs
Explore as deep as possible before backtracking
Explore all possibilities, undo choices that don't work
Break into subproblems, store results to avoid recomputation
Make the locally optimal choice at each step
Track connected components efficiently
Order tasks respecting dependencies (DAGs only)
Combine overlapping intervals after sorting by start
Access min or max element in O(log n)
Efficiently store and search strings by prefix