Pattern finder
Which pattern fits this problem?
Spotting the pattern is the hard part, and the part interviews test. Answer a few questions about what the problem gives you and what it asks for, and land on the pattern, why it fits, the words that give it away, and problems to practise it on.
Question 1
What are you given?
Look at the function signature and the first lines of the problem.
Keys: 1–6 to answer · R to start over
All 31 patterns
Already know which one you want? Open it directly.
Graphs
Recursion
Trees
Linked lists
Heaps
Design
Stacks
Greedy
Sliding window
Arrays
Dynamic programming
Binary search
Two pointers
Math & bits