The Pattern Picker
Intermediate · 16 min read · Interview Playbook, Interview Playbook
Signals in the wording and constraints that point to each pattern — a decision guide.
You've learned about thirty-five patterns. In an interview, the hard part is the first two minutes: reading an unfamiliar problem and deciding which pattern it is. This lesson turns that decision into a routine.
Read 1: the constraints tell you the target complexity
Before thinking about the algorithm, look at the input size. With a budget of roughly 10⁸ simple operations (Big-O the Easy Way; value ranges, memory and modulo are in Reading Constraints):
Read 2: the input shape
Read 3: the wording — signal words
The decision flow
The flow gives you candidates, not certainty. Confirm by writing the brute force and asking what it repeats (A Framework for Any Problem): repeated searching → hashing; repeated sums → prefix sums; repeated subproblems → DP; repeated "find the min" → heap.
Look-alikes that trip people up
Spot-the-pattern drills
Read each statement, give the pattern in under a minute, then open the answer.
Further reading
Key takeaways
- Three reads narrow the choice: constraints (target complexity), input shape, signal words.
- The decision flow gives candidates; the brute force's repeated work confirms which one.
- Know the look-alikes: window vs prefix sums, backtracking vs DP, greedy vs DP, BFS vs DFS.
- Drill spotting separately from solving — it's the skill interviews test first.