Blind 75
The curated 75-problem interview list, grouped by category.
89 pages
- Blind 75 — Senior Java EditionOverview
The Blind 75 is a curated list of 75 LeetCode problems by Yangshun Tay (2018). Mastering these gives you the recurring patterns behind 90% of FAANG…
- Pattern 15: Blind 75 — The Essential Interview Problem SetPattern guide
The Blind 75 is a curated list of 75 LeetCode problems created by Yangshun Tay in 2018. It covers the most frequently asked coding interview questions…
- Coding Interview Tips & StrategiesNote
Extracted from How to Rock the Coding Interview by Yangshun Tay (Google, Airbnb, Dropbox offers) and the Blind 75 series by Uluc Ozdenvar.
Array11
- Blind 75 — Array Pattern GuidePattern guide
"Sorted? → Binary search or two pointers. Unsorted? → HashMap. Contiguous? → Kadane or sliding window."
- LC 1Two Sum (LC 1)Easy
Store each value’s index as you walk the array; the partner you need is target - current, which you can look up in O(1) with a map.
- LC 53Maximum Subarray (LC 53)Medium
Either extend the best subarray ending at the previous index, or start fresh at the current element—whichever gives a larger sum.
- LC 152Maximum Product Subarray (LC 152)Medium
A negative number can turn a small (most negative) running product into the largest product, so track both the max and min product ending at each index.
- LC 153Find Minimum in Rotated Sorted Array (LC 153)Medium
Compare mid to the right boundary: if nums[mid] > nums[right], the minimum lies in the right half; otherwise it lies in the left half (including mid).
- LC 33Search in Rotated Sorted Array (LC 33)Medium
At each mid, one half [left, mid] or [mid, right] is sorted; use that ordering to decide whether target can lie in that half.
- LC 153Sum (LC 15)Medium
Fix one element, then run sorted two-sum on the rest to find pairs that sum to the negative of the fixed value—total \(O(n^2)\) with deduplication.
- LC 11Container With Most Water (LC 11)Medium
Start with the widest container; moving the taller line never improves area, so always move the shorter pointer inward.
- LC 121Best Time to Buy and Sell Stock (LC 121)Easy
Track the minimum price seen so far while walking forward; the best profit at index i is prices[i] - minSoFar.
- LC 217Contains Duplicate (LC 217)Easy
Walk the array, adding each value to a HashSet. If a value is already there, you found a duplicate.
- LC 238Product of Array Except Self (LC 238)Medium
For each index i, answer[i] = (product of everything to the left) * (product of everything to the right). Build these two passes in O(n) and combine.
Binary6
- Blind 75 — Binary / Bit Manipulation Pattern GuidePattern guide
"Pairs cancel → XOR. Lowest set bit → n & -n. Drop lowest set bit → n & (n-1)."
- LC 371Sum of Two Integers (LC 371)Medium
XOR gives sum without carry; AND (shifted) isolates carry—repeat until carry disappears.
- LC 191Number of 1 Bits (LC 191)Easy
Each n & (n - 1) clears the lowest set bit—count how many times you can do that before n becomes 0.
- LC 338Counting Bits (LC 338)Easy
count[i] = count[i >> 1] + (i & 1) — the count for i is the count for half of i, plus whether the last bit is 1.
- LC 268Missing Number (LC 268)Easy
XOR every index with every value; pairs (i, nums[i]) for present numbers cancel—what remains is the missing index.
- LC 190Reverse Bits (LC 190)Easy
For each bit of n, shift the answer left and merge the next bit from n—you walk n from LSB to MSB while building the reversed word.
Dynamic Programming12
- Blind 75 — Dynamic Programming Pattern GuidePattern guide
"What is the smallest piece of the answer I can compute? Now express the bigger answer in terms of smaller pieces."
- LC 139Word Break (LC 139)Medium
A string is breakable if some prefix is a dictionary word and the remainder is also breakable—so you reuse answers for suffixes.
- LC 377Combination Sum IV (LC 377)Medium
Distinct sequences count permutations: ways to reach sum t equals the sum over coins of ways to reach t - coin.
- LC 198House Robber (LC 198)Medium
At each house, your best loot is either skip this house (take previous best) or rob this house plus best from two steps back—never two adjacent.
- LC 213House Robber II (LC 213)Medium
The circle forbids robbing both first and last; solve line House Robber twice—once excluding the last house, once excluding the first—and take the max.
- LC 91Decode Ways (LC 91)Medium
Ways to decode a prefix equal ways after one valid digit plus ways after one valid two-digit letter, with careful handling of '0'.
- LC 55Jump Game (LC 55)Medium
Track the farthest index reachable from the start; if you ever reach an index beyond current reach, fail; if reach ≥ last index, succeed.
- LC 1143Longest Common Subsequence (LC 1143)Medium
If last characters match, LCS is 1 + LCS of prefixes without both lasts; if not, take the better of dropping one side.
- LC 70Climbing Stairs (LC 70)Easy
Ways to reach step n = ways to reach n-1 + ways to reach n-2. Problem walkthrough from the Blind 75 pattern set — Java templates, complexity analysis and…
- LC 322Coin Change (LC 322)Medium
dp[a] = fewest coins to make amount a. For each amount, try every coin and take the minimum.
- LC 300Longest Increasing Subsequence (LC 300)Medium
For each i, the LIS ending at i is 1 + max(dp[j] for j < i where nums[j] < nums[i]).
- LC 62Unique Paths (LC 62)Medium
dp[i][j] = ways to reach cell (i, j) = dp[i-1][j] + dp[i][j-1]. Robot only moves right or down.
Graph9
- Blind 75 — Graph Pattern GuidePattern guide
"Level-by-level → BFS. Explore-everything → DFS. Ordering → Topo. Grouping → Union-Find."
- LC 133Clone Graph (LC 133)Medium
Map each original node to its clone once, then wire neighbors by looking up clones in that map so you never duplicate nodes or get stuck in cycles.
- LC 207Course Schedule (LC 207)Medium
If you can order all courses respecting prerequisites, the prerequisite graph is a DAG; if there is a cycle, some course depends on itself indirectly and…
- LC 417Pacific Atlantic Water Flow (LC 417)Medium
Water flows downhill to lower or equal heights; instead of simulating from every cell outward, start from ocean borders and mark everywhere water can flow…
- LC 200Number of Islands (LC 200)Medium
Each '1' cell is land; 4-directionally connected '1' cells form one island — count connected components by sinking visited land to avoid recounting.
- LC 128Longest Consecutive Sequence (LC 128)Medium
Treat each number as a node with edges to n-1 and n+1; avoid O(n²) by only starting a streak at n when n-1 is missing.
- LC 261Graph Valid Tree (LC 261)Medium
An undirected graph on n labeled nodes 0..n-1 is a tree iff it is connected and has exactly n-1 edges with no cycles — equivalently: n-1 edges + connected +…
- LC 323Number of Connected Components in an Undirected Graph (LC 323)Medium
Start with n isolated nodes; each edge merges two components — track how many components remain, or count DFS/BFS launches from unvisited nodes.
- LC 269Alien Dictionary (LC 269)Hard
Compare adjacent words to extract ordered letter edges; a valid alphabet is a topological order of that graph — impossible if there is a cycle or a prefix…
Heap4
- Blind 75 — Heap (Priority Queue) Pattern GuidePattern guide
"Top-K → size-K heap. K-way merge → heap of K heads. Streaming median → two heaps balanced."
- LC 23Merge k Sorted Lists (LC 23)Hard
Always pick the smallest current head among k lists using a min-heap ordered by node value (tie-break by list id).
- LC 347Top K Frequent Elements (LC 347)Medium
Count frequencies, then either use a min-heap of size k on frequencies or bucket indices by frequency for O(n) time.
- LC 295Find Median from Data Stream (LC 295)Hard
Keep lower half in a max-heap and upper half in a min-heap; sizes differ by at most 1; median from tops.
Interval5
- Blind 75 — Interval Pattern GuidePattern guide
"Intervals → sort first. Merge → by start. Greedy non-overlap → by end. Rooms count → heap of ends."
- LC 56Merge Intervals (LC 56)Medium
After sorting by start, each interval either extends the current merged block or starts a new one.
- LC 435Non-overlapping Intervals (LC 435)Medium
To fit maximum non-overlapping intervals, always keep the interval that ends earliest—it leaves the most room for the future.
- LC 57Insert Interval (LC 57)Medium
Split the existing intervals into three groups relative to newInterval: those that end before, those that overlap, and those that start after. Merge the…
- LC 253Meeting Rooms II (LC 253)Medium
At any moment, the number of rooms in use equals the number of meetings whose start ≤ now < end. Process meetings by start time; reuse a room whenever the…
Linked List7
- Blind 75 — Linked List Pattern GuidePattern guide
"Head might change → dummy node. Find position → slow/fast. Reverse → 3 pointer dance (prev, curr, next)."
- LC 206Reverse Linked List (LC 206)Easy
Change each node’s next to point to the previous node while walking forward; track prev and curr.
- LC 141Linked List Cycle (LC 141)Easy
If a tortoise and hare move at 1 and 2 steps per tick, they meet inside the cycle if and only if a cycle exists.
- LC 19Remove Nth Node From End of List (LC 19)Medium
Advance a “fast” pointer n+1 steps ahead of “slow” behind a dummy; when fast hits null, slow is just before the node to remove.
- LC 143Reorder List (LC 143)Medium
Split the list in half, reverse the second half, then zip-merge first and second halves alternately.
- LC 21Merge Two Sorted Lists (LC 21)Easy
Walk both lists with one pointer each. Repeatedly append the smaller head to the result. Use a dummy node so we never special-case the very first append.
- LC 23Merge K Sorted Lists (LC 23)Hard
Push the head node of each list into a min-heap. Repeatedly poll the smallest, append it to the result, and push its next.
Matrix5
- Blind 75 — Matrix Pattern GuidePattern guide
"Rotate = Transpose + Reverse. Spiral = 4 boundaries that shrink. Word search = DFS + backtrack with # marker."
- LC 73Set Matrix Zeroes (LC 73)Medium
If matrix[i][j] == 0, row i and column j must become zero; store which rows/cols need clearing using O(1) extra space by repurposing the first row and first…
- LC 54Spiral Matrix (LC 54)Medium
Walk right → down → left → up along the current rectangle border, then shrink the rectangle; after each direction, check if the border collapsed to avoid…
- LC 48Rotate Image (LC 48)Medium
A 90° clockwise rotation equals transpose then reverse each row (for square matrices); alternatively rotate four cells in place in one loop.
- LC 79Word Search (LC 79)Medium
From each cell, DFS along valid neighbors matching the next character; mark visited on the path and undo (backtrack) when returning so other branches can…
String11
- Blind 75 — String Pattern GuidePattern guide
"Contiguous + constraint → sliding window. Palindrome → expand from center. Anagram → frequency count."
- LC 3Longest Substring Without Repeating Characters (LC 3)Medium
For each right, move left just past the previous index of s[right] so the window never holds duplicates.
- LC 424Longest Repeating Character Replacement (LC 424)Medium
A window is valid if (window length) - (count of most frequent char) <= k — you only need to replace the “minority” characters.
- LC 76Minimum Window Substring (LC 76)Hard
Expand until the window covers all required characters, then shrink from the left as much as possible while still valid—track “how many required chars have…
- LC 271Encode and Decode Strings (LC 271)Medium
Prefix each chunk with its length and a delimiter that cannot appear in the length token (e.g. 5#hello), so decoding is unambiguous.
- LC 49Group Anagrams (LC 49)Medium
Anagrams share the same character counts—use a canonical key (sorted string or count signature) as the HashMap key.
- LC 20Valid Parentheses (LC 20)Easy
Each closing bracket must match the most recent unmatched opening bracket—LIFO order.
- LC 5Longest Palindromic Substring (LC 5)Medium
Every palindrome has a center (one character for odd length, between two chars for even)—try all centers and expand while ends match.
- LC 647Palindromic Substrings (LC 647)Medium
Each palindrome has a center; expand outward and count how many palindromes each center generates (usually 1 per successful expansion step).
- LC 242Valid Anagram (LC 242)Easy
Two strings are anagrams iff each character appears the same number of times in both. Track counts with int[26].
- LC 125Valid Palindrome (LC 125)Easy
One pointer from each end. Skip non-alphanumerics. Compare lowercased characters.
Tree12
- Blind 75 — Tree Pattern GuidePattern guide
"Tree problem → recursion. Level info → BFS with size loop. BST → inorder gives sorted order. Path-sum-style → DFS that returns the best path ending at the…
- LC 104Maximum Depth of Binary Tree (LC 104)Easy
The depth of a node is 1 + max(depth of left subtree, depth of right subtree); the base case is an empty subtree (depth 0).
- LC 124Binary Tree Maximum Path Sum (LC 124)Hard
At each node, the best path through that node uses the node plus at most one best “chain” from left and one from right; return to parent only a single…
- LC 102Binary Tree Level Order Traversal (LC 102)Medium
Process nodes level by level using a queue: dequeue a level’s worth of nodes, enqueue their children, repeat.
- LC 297Serialize and Deserialize Binary Tree (LC 297)Hard
A preorder string that records null for missing children uniquely defines the tree shape; deserialize consumes tokens left-to-right matching that preorder.
- LC 572Subtree of Another Tree (LC 572)Easy
subRoot is a subtree of root if some node x in root has identical structure and values to subRoot; verify with a helper isSame(a, b).
- LC 105Construct Binary Tree from Preorder and Inorder Traversal (LC 105)Medium
Preorder’s first element is the root; find that value in inorder to split left size vs right size; recurse on subranges.
- LC 98Validate Binary Search Tree (LC 98)Medium
In a BST, every node’s value must lie in an open interval (min, max) inherited from ancestors; left child tightens the upper bound, right child tightens the…
- LC 230Kth Smallest Element in a BST (LC 230)Medium
Inorder traversal of a BST visits nodes in sorted ascending order; the kth visited node is the kth smallest.
- LC 235Lowest Common Ancestor of a Binary Search Tree (LC 235)Medium
Walk from the root: if both p and q are smaller than current, go left; if both larger, go right; otherwise current is the split → LCA.
- LC 100Same Tree (LC 100)Easy
Two trees are identical iff their roots have equal values and their left subtrees are identical and their right subtrees are identical.
- LC 226Invert Binary Tree (LC 226)Easy
At each node, swap its left and right children. Recurse on both. Result is the mirror image of the original tree.
Trie4
- Blind 75 — Trie (Prefix Tree) Pattern GuidePattern guide
"Many prefix queries on a dictionary → Trie. Wildcards → Trie + DFS. Many target words in text/grid → Trie + DFS with pruning."
- LC 208Implement Trie (Prefix Tree) (LC 208)Medium
Each node holds links to 26 (or alphabet-sized) children and an isEnd flag; insert walks/creates edges; search/startsWith follow edges and check termination.
- LC 211Design Add and Search Words Data Structure (LC 211)Medium
. matches any single letter — at a . node, try all non-null children recursively; otherwise follow the single matching edge.
- LC 212Word Search II (LC 212)Hard
Put all words in one trie; DFS from each cell, following trie edges; on end, record word and prune node to avoid duplicates.