The Top Interview 150 LeetCode List
The official interview-preparation list, a hundred and fifty problems covering every data structure and technique a technical screen is likely to reach for.
- Easy
- 40
- Medium
- 92
- Hard
- 18
- Patterns
- 21
Every entry, grouped by pattern
Each group is the pattern that most specifically solves those problems, so the list can be worked through a technique at a time instead of a problem at a time. Groups appear in the order the list itself introduces them.
Two Pointers (14)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0088 | Merge Sorted Array | Easy | |
| 0027 | Remove Element | Easy | |
| 0026 | Remove Duplicates from Sorted Array | Easy | |
| 0080 | Remove Duplicates from Sorted Array II | Medium | |
| 0189 | Rotate Array | Medium | |
| 0151 | Reverse Words in a String | Medium | |
| 0028 | Find the Index of the First Occurrence in a String | Easy | |
| 0125 | Valid Palindrome | Easy | |
| 0392 | Is Subsequence | Easy | |
| 0167 | Two Sum II - Input Array Is Sorted | Medium | |
| 0011 | Container With Most Water | Medium | |
| 0015 | 3Sum | Medium | |
| 0202 | Happy Number | Easy | |
| 0005 | Longest Palindromic Substring | Medium |
Sorting (5)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0169 | Majority Element | Easy | |
| 0274 | H-Index | Medium | |
| 0242 | Valid Anagram | Easy | |
| 0049 | Group Anagrams | Medium | |
| 0056 | Merge Intervals | Medium |
Dynamic Programming (9)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0121 | Best Time to Buy and Sell Stock | Easy | |
| 0053 | Maximum Subarray | Medium | |
| 0070 | Climbing Stairs | Easy | |
| 0198 | House Robber | Medium | |
| 0120 | Triangle | Medium | |
| 0097 | Interleaving String | Medium | |
| 0072 | Edit Distance | Medium | |
| 0123 | Best Time to Buy and Sell Stock III | Hard | |
| 0188 | Best Time to Buy and Sell Stock IV | Hard |
Greedy (6)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0122 | Best Time to Buy and Sell Stock II | Medium | |
| 0055 | Jump Game | Medium | |
| 0045 | Jump Game II | Medium | |
| 0134 | Gas Station | Medium | |
| 0135 | Candy | Hard | |
| 0452 | Minimum Number of Arrows to Burst Balloons | Medium |
Math and Number Theory (8)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0380 | Insert Delete GetRandom O(1) | Medium | |
| 0013 | Roman to Integer | Easy | |
| 0012 | Integer to Roman | Medium | |
| 0009 | Palindrome Number | Easy | |
| 0066 | Plus One | Easy | |
| 0172 | Factorial Trailing Zeroes | Medium | |
| 0050 | Pow(x, n) | Medium | |
| 0149 | Max Points on a Line | Hard |
Prefix Sum (1)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0238 | Product of Array Except Self | Medium |
Stack (8)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0042 | Trapping Rain Water | Hard | |
| 0020 | Valid Parentheses | Easy | |
| 0071 | Simplify Path | Medium | |
| 0155 | Min Stack | Medium | |
| 0150 | Evaluate Reverse Polish Notation | Medium | |
| 0224 | Basic Calculator | Hard | |
| 0173 | Binary Search Tree Iterator | Medium | |
| 0918 | Maximum Sum Circular Subarray | Medium |
Other (5)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0058 | Length of Last Word | Easy | |
| 0006 | Zigzag Conversion | Medium | |
| 0068 | Text Justification | Hard | |
| 0228 | Summary Ranges | Easy | |
| 0057 | Insert Interval | Medium |
Trie (5)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0014 | Longest Common Prefix | Easy | |
| 0208 | Implement Trie (Prefix Tree) | Medium | |
| 0211 | Design Add and Search Words Data Structure | Medium | |
| 0212 | Word Search II | Hard | |
| 0139 | Word Break | Medium |
Sliding Window (5)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0209 | Minimum Size Subarray Sum | Medium | |
| 0003 | Longest Substring Without Repeating Characters | Medium | |
| 0030 | Substring with Concatenation of All Words | Hard | |
| 0076 | Minimum Window Substring | Hard | |
| 0219 | Contains Duplicate II | Easy |
Matrix and Grid (11)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0036 | Valid Sudoku | Medium | |
| 0054 | Spiral Matrix | Medium | |
| 0048 | Rotate Image | Medium | |
| 0073 | Set Matrix Zeroes | Medium | |
| 0289 | Game of Life | Medium | |
| 0909 | Snakes and Ladders | Medium | |
| 0427 | Construct Quad Tree | Medium | |
| 0074 | Search a 2D Matrix | Medium | |
| 0064 | Minimum Path Sum | Medium | |
| 0063 | Unique Paths II | Medium | |
| 0221 | Maximal Square | Medium |
Hash Map (4)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0383 | Ransom Note | Easy | |
| 0205 | Isomorphic Strings | Easy | |
| 0290 | Word Pattern | Easy | |
| 0001 | Two Sum | Easy |
Union-Find (4)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0128 | Longest Consecutive Sequence | Medium | |
| 0200 | Number of Islands | Medium | |
| 0130 | Surrounded Regions | Medium | |
| 0399 | Evaluate Division | Medium |
Linked List (15)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0141 | Linked List Cycle | Easy | |
| 0002 | Add Two Numbers | Medium | |
| 0021 | Merge Two Sorted Lists | Easy | |
| 0138 | Copy List with Random Pointer | Medium | |
| 0092 | Reverse Linked List II | Medium | |
| 0025 | Reverse Nodes in k-Group | Hard | |
| 0019 | Remove Nth Node From End of List | Medium | |
| 0082 | Remove Duplicates from Sorted List II | Medium | |
| 0061 | Rotate List | Medium | |
| 0086 | Partition List | Medium | |
| 0146 | LRU Cache | Medium | |
| 0117 | Populating Next Right Pointers in Each Node II | Medium | |
| 0114 | Flatten Binary Tree to Linked List | Medium | |
| 0148 | Sort List | Medium | |
| 0023 | Merge k Sorted Lists | Hard |
Tree Traversal (18)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0104 | Maximum Depth of Binary Tree | Easy | |
| 0100 | Same Tree | Easy | |
| 0226 | Invert Binary Tree | Easy | |
| 0101 | Symmetric Tree | Easy | |
| 0105 | Construct Binary Tree from Preorder and Inorder Traversal | Medium | |
| 0106 | Construct Binary Tree from Inorder and Postorder Traversal | Medium | |
| 0112 | Path Sum | Easy | |
| 0129 | Sum Root to Leaf Numbers | Medium | |
| 0124 | Binary Tree Maximum Path Sum | Hard | |
| 0236 | Lowest Common Ancestor of a Binary Tree | Medium | |
| 0199 | Binary Tree Right Side View | Medium | |
| 0637 | Average of Levels in Binary Tree | Easy | |
| 0102 | Binary Tree Level Order Traversal | Medium | |
| 0103 | Binary Tree Zigzag Level Order Traversal | Medium | |
| 0530 | Minimum Absolute Difference in BST | Easy | |
| 0230 | Kth Smallest Element in a BST | Medium | |
| 0098 | Validate Binary Search Tree | Medium | |
| 0108 | Convert Sorted Array to Binary Search Tree | Easy |
Bit Manipulation (7)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0222 | Count Complete Tree Nodes | Easy | |
| 0067 | Add Binary | Easy | |
| 0190 | Reverse Bits | Easy | |
| 0191 | Number of 1 Bits | Easy | |
| 0136 | Single Number | Easy | |
| 0137 | Single Number II | Medium | |
| 0201 | Bitwise AND of Numbers Range | Medium |
Breadth-First Search (4)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0133 | Clone Graph | Medium | |
| 0433 | Minimum Genetic Mutation | Medium | |
| 0127 | Word Ladder | Hard | |
| 0322 | Coin Change | Medium |
Topological Sort (2)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0207 | Course Schedule | Medium | |
| 0210 | Course Schedule II | Medium |
Backtracking (7)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0017 | Letter Combinations of a Phone Number | Medium | |
| 0077 | Combinations | Medium | |
| 0046 | Permutations | Medium | |
| 0039 | Combination Sum | Medium | |
| 0052 | N-Queens II | Hard | |
| 0022 | Generate Parentheses | Medium | |
| 0079 | Word Search | Medium |
Binary Search (8)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0035 | Search Insert Position | Easy | |
| 0162 | Find Peak Element | Medium | |
| 0033 | Search in Rotated Sorted Array | Medium | |
| 0034 | Find First and Last Position of Element in Sorted Array | Medium | |
| 0153 | Find Minimum in Rotated Sorted Array | Medium | |
| 0004 | Median of Two Sorted Arrays | Hard | |
| 0069 | Sqrt(x) | Easy | |
| 0300 | Longest Increasing Subsequence | Medium |
Heap / Priority Queue (4)
| No. | Problem | Difficulty | Topics |
|---|---|---|---|
| 0215 | Kth Largest Element in an Array | Medium | |
| 0502 | IPO | Hard | |
| 0373 | Find K Pairs with Smallest Sums | Medium | |
| 0295 | Find Median from Data Stream | Hard |
The Top Interview 150 is a published third-party selection, reproduced here by problem number in the order the list itself uses. 150 of its 150 entries carry a complete Python solution.
Eyes only
The Top Interview 150 does not cover the problem you get asked.
In the live round, Stealth Interview reads the problem off your screen, returns a working solution with a step-by-step explanation and its time and space complexity, and transcribes what the interviewer says. It's a desktop app for macOS and Windows, invisible to screen sharing.
Other study lists
Or go by technique instead of by list: all LeetCode patterns · the full problem list.