The 12 Coding Interview Patterns That Cover Almost Every FAANG Question
You are not memorizing questions, you are memorizing signals
The reason coding interview prep feels endless is that people treat it as an ever-growing list of individual questions to memorize. It is not. Almost every question a FAANG-style interview asks is a costume worn by one of about a dozen underlying patterns, and the real skill being tested is recognizing which costume you are looking at within the first thirty seconds of reading the prompt.
The fastest way to get better at interviews is not grinding more questions — it is getting sharper at pattern recognition on questions you have already seen, so that a new question in a familiar pattern feels like a variation, not a blank page. Below is the pattern list we use to organize AlgoMindset's interview question library, along with the signal in the prompt that tells you which one you are dealing with.
Arrays & Hashing, Two Pointers, and Sliding Window
These three are the foundation and account for a huge share of "easy" and "medium" questions. Arrays & Hashing is your default whenever a question asks about duplicates, frequency counts, or "have I seen this before" — a hash map turns an O(n²) nested loop into O(n). Two Pointers signals itself when the input is sorted, or when you are looking for a pair/triplet that satisfies a condition (a target sum, a palindrome check) — you move two indices toward or away from each other instead of checking every pair.
Sliding Window is the pattern for "find the best contiguous subarray or substring that satisfies some condition" — longest, shortest, or count of a substring/subarray meeting a rule. The signal is the word "contiguous" or "substring," combined with a size or condition that changes as you scan. If you catch yourself writing a nested loop over all subarrays, stop — it is almost always a window that expands and contracts instead.
Stack, Binary Search, and Linked List techniques
Stack shows up whenever a question involves matching or undoing something in the reverse order it happened — parentheses validation, "next greater element," or anything where you need to remember what came before and pop it off once it is resolved. Binary Search is not just "the array is sorted" — its real signal is a monotonic condition: as you move a candidate answer up or down, whether it "works" only flips once. That is why binary search shows up on problems that do not look like searching at all, like "minimum days to ship packages."
Linked lists get their own bucket because the tricks are structural rather than algorithmic: fast/slow pointers to detect a cycle or find a midpoint, and dummy-head + pointer-rewiring for reversal and merging. The signal is simply "the input is a linked list" — almost every linked list question reduces to one of these two moves, or a combination of both.
Trees, Graphs, and Backtracking
Trees and graphs are really the same pattern family — traversal — split by structure. The decision that matters is BFS versus DFS: BFS when you need the shortest path or level-by-level information (level order traversal, minimum steps), DFS when you need to explore every path or check a global property (validating a BST, counting connected components). Topological sort is the specialized case for "these tasks depend on other tasks" — course schedule–style questions are the tell.
Backtracking is the pattern for "generate all valid combinations/permutations/subsets that satisfy a constraint." The signal is the word "all" combined with a constraint to prune against — if you are building up a partial solution and abandoning it the moment it becomes invalid, that is backtracking, whether the underlying data is a board, a string, or a set of numbers.
Dynamic Programming, Greedy, and Intervals
DP is the pattern people fear most, but the signal is consistent: the question asks for an optimal value (min, max, count of ways) over a sequence, and the optimal answer to the whole problem is built from optimal answers to smaller versions of the same problem. The real skill is defining the state — what does dp[i] actually represent — not memorizing individual problems. 1-D DP (climbing stairs, house robber, coin change) has one moving index; 2-D DP (longest common subsequence, unique paths) has two, usually because you are comparing two sequences or moving across a grid.
Greedy is DP's faster, riskier cousin: it applies when making the locally optimal choice at each step provably leads to the globally optimal answer, with no need to look back. Interval questions (merge intervals, meeting rooms) are almost always greedy once you sort by start or end time first — sorting is the move that unlocks the rest of the problem.
Bit Manipulation and Math & Geometry
These show up less often but are cheap to prepare for because the pattern set is small. Bit manipulation questions (number of 1 bits, missing number, single number) almost always reduce to a handful of tricks: XOR to cancel duplicates, shifting to isolate a bit, or counting set bits. Math & Geometry questions (rotate image, spiral matrix, set matrix zeroes) are less about a named algorithm and more about careful index arithmetic — the failure mode is off-by-one errors, not conceptual misunderstanding, so these are worth practicing for precision as much as approach.
How to actually drill this
Once you can name the pattern, do not stop there — explain out loud why the prompt signaled that pattern before you start coding. That habit is what makes a new, unfamiliar question feel solvable under interview pressure instead of panic-inducing: you are not asking "have I seen this exact question," you are asking "which bucket does this fall into, and what does that bucket usually require."
AlgoMindset's interview question library is organized by exactly these categories, with each question tagged so you can drill one pattern at a time instead of jumping randomly. Pair that with our data structures roadmap for the underlying mechanics, and an AI mock interview once you want to practice explaining your pattern recognition out loud under time pressure — that is the part reading alone never trains.