DSA Patterns
Learn simple patterns to easily solve hundreds of coding interview questions.
Two Pointers
Use two pointers to walk through a list from different spots to find pairs or compare items quickly.
Sliding Window
Slide a viewing window across a list to track sums or substrings without repeating work.
Hashing
Save numbers in a quick-lookup notebook (hash map) to find what you need instantly.
Binary Search
Cut a sorted list in half repeatedly to find any item in just a few quick steps.
Stack
Like a stack of plates: the last item you put on top is the first one you take off (LIFO).
Queue
Like people waiting in line: the first person to arrive is the first one served (FIFO).
Linked List
A chain of items where each item holds a value and points to the next item in line.
Trees
Branching data like a family tree, starting from one root node and splitting into child nodes.
Graphs
A web of connected items, like a map of cities connected by roads or friends on social media.
Dynamic Programming
Break big problems into small pieces and write down their answers so you never repeat work.
Backtracking
Try exploring one path. If it leads to a dead end, back up and try another path (like a maze).
Greedy
Make the best-looking choice right now at each step, hoping it leads to the best overall result.