Problem Patterns
Common coding interview patterns and techniques
Common coding interview patterns and techniques
Sections
Articles
Two Pointers and Fast-Slow Pointers
Two Pointers and Fast-Slow Pointers š Summary Two pointers is a versatile technique for solving ā¦
Binary Search on Answer
Binary Search on Answer š Summary Binary Search on Answer is used when the answer has a monotonic ā¦
Topological Sort Patterns
Topological Sort Patterns š Summary Topological Sort orders vertices of a DAG (Directed Acyclic ā¦
Meet in the Middle
Meet in the Middle š Summary Meet in the Middle splits a problem into two halves, solves each half ā¦
Game Theory and Minimax
Game Theory and Minimax š Summary Game theory problems involve two players making optimal moves. Key ā¦
Matrix Traversal Patterns
Matrix Traversal Patterns š Overview Matrix problems are extremely common in FAANG interviews. ā¦
Cycle Detection Patterns
Cycle Detection Patterns š Overview Cycle detection is fundamental for linked lists, graphs, and ā¦
Monotonic Stack/Queue Patterns
Monotonic Stack/Queue Patterns š Overview Monotonic data structures maintain elements in sorted ā¦
Prefix Sum & Difference Array Patterns
Prefix Sum & Difference Array Patterns š Overview Prefix sums enable O(1) range sum queries. ā¦
Bit Manipulation Patterns
Bit Manipulation Patterns š Essential Bit Operations # Basic operations x & y # AND - both bits ā¦
Interval & Scheduling Patterns
Interval & Scheduling Patterns š Overview Interval problems are extremely common. Master sorting ā¦
Union-Find / Disjoint Set Patterns
Union-Find / Disjoint Set Union (DSU) š Overview Union-Find is ideal for dynamic connectivity, cycle ā¦
String Manipulation Patterns
String Manipulation Patterns š Overview String problems appear frequently in interviews. Master ā¦
Greedy Algorithm Patterns
Greedy Algorithm Patterns š Overview Greedy algorithms make locally optimal choices at each step. ā¦
Heap & Priority Queue Patterns
Heap & Priority Queue Patterns š Overview Heaps are essential for problems involving streaming ā¦
Backtracking Patterns
Backtracking Patterns š Overview Backtracking systematically explores all possibilities by building ā¦
Trie (Prefix Tree) Patterns
Trie (Prefix Tree) Patterns š Overview Tries are efficient for string prefix operations, ā¦
Tree Construction & Serialization Patterns
Tree Construction & Serialization Patterns š Overview Tree construction from traversals and ā¦
Math & Number Theory Patterns
Math & Number Theory Patterns š Overview Mathematical patterns appear frequently in coding ā¦
Simulation & State Machine Patterns
Simulation & State Machine Patterns š Overview Simulation problems require careful ā¦