Skip to content

Latest commit

 

History

History
347 lines (284 loc) · 25.7 KB

File metadata and controls

347 lines (284 loc) · 25.7 KB

NeetCode 150 - Essential LeetCode Problems for FAANG Interviews

NeetCode 150 is a curated list of 150 essential LeetCode problems compiled by a Google engineer. This collection represents the most important algorithmic patterns and concepts frequently tested in FAANG and top tech company interviews. Each problem has been selected to maximize your interview preparation efficiency.

🎯 Perfect for FAANG Interview Preparation | 🔥 150 Handpicked Problems | ✅ Pattern-Based Learning

NeetCode 150 Practice LeetCode NeetCode 150

Why NeetCode 150?

  • ✨ Curated by Industry Expert: Selected by a Google engineer based on real interview experience
  • 🎯 Maximum Coverage: Covers all major algorithmic patterns and data structures
  • ⚡ Efficient Preparation: Focus on quality over quantity - 150 problems vs. 2000+ on LeetCode
  • 📈 Proven Success: Used by thousands to land offers at top tech companies
  • 🎥 Video Solutions: Comprehensive video explanations available for every problem

Problem Categories and Distribution

Category Problems Difficulty Distribution Key Patterns
Arrays & Hashing 9 2 Easy, 6 Medium, 1 Hard Two Pointers, Hash Maps, Prefix Sums
Two Pointers 5 1 Easy, 4 Medium Left-Right Pointers, Fast-Slow Pointers
Sliding Window 6 2 Easy, 3 Medium, 1 Hard Fixed/Variable Window, String Problems
Stack 7 2 Easy, 4 Medium, 1 Hard Monotonic Stack, Expression Parsing
Binary Search 7 2 Easy, 5 Medium Search Space Reduction, Peak Finding
Linked List 11 2 Easy, 8 Medium, 1 Hard Two Pointers, Reversal, Cycle Detection
Trees 15 3 Easy, 10 Medium, 2 Hard DFS, BFS, Tree Construction
Tries 3 2 Medium, 1 Hard Prefix Trees, Word Search
Heap/Priority Queue 7 1 Easy, 5 Medium, 1 Hard K-Elements, Merge Operations
Backtracking 9 6 Medium, 3 Hard Permutations, Combinations, Subsets
Graphs 13 3 Medium, 10 Hard DFS, BFS, Union Find, Topological Sort
Advanced Graphs 6 6 Hard Shortest Path, MST, Advanced Algorithms
1-D Dynamic Programming 12 1 Easy, 8 Medium, 3 Hard State Transitions, Optimization
2-D Dynamic Programming 11 8 Medium, 3 Hard Grid DP, String DP
Greedy 8 2 Easy, 4 Medium, 2 Hard Local Optimal Choices
Intervals 5 1 Easy, 3 Medium, 1 Hard Merging, Scheduling
Math & Geometry 8 3 Easy, 4 Medium, 1 Hard Number Theory, Computational Geometry
Bit Manipulation 7 3 Easy, 4 Medium Bitwise Operations, XOR Tricks

📋 Complete Problem List

Arrays & Hashing (9 Problems)

No. Problem Difficulty Pattern Company Tags
1 Contains Duplicate Easy Hash Set All FAANG
2 Valid Anagram Easy Character Count All FAANG
3 Two Sum Easy Hash Map All FAANG
4 Group Anagrams Medium Hash Map, Sorting Google, Amazon
5 Top K Frequent Elements Medium Heap, Hash Map All FAANG
6 Product of Array Except Self Medium Prefix/Suffix Product Meta, Apple
7 Valid Sudoku Medium Hash Set, Matrix Apple, Amazon
8 Encode and Decode Strings Medium String Manipulation Google, Meta
9 Longest Consecutive Sequence Hard Union Find, Hash Set Google, Meta

Two Pointers (5 Problems)

No. Problem Difficulty Pattern Company Tags
10 Valid Palindrome Easy Two Pointers Meta, Apple
11 Two Sum II - Input Array Is Sorted Medium Two Pointers Amazon, Google
12 3Sum Medium Two Pointers, Sort All FAANG
13 Container With Most Water Medium Two Pointers All FAANG
14 Trapping Rain Water Hard Two Pointers Amazon, Google

Sliding Window (6 Problems)

No. Problem Difficulty Pattern Company Tags
15 Best Time to Buy and Sell Stock Easy Single Pass All FAANG
16 Longest Substring Without Repeating Characters Medium Variable Window All FAANG
17 Longest Repeating Character Replacement Medium Variable Window Google, Meta
18 Permutation in String Medium Fixed Window Meta, Amazon
19 Minimum Window Substring Hard Variable Window Meta, Amazon
20 Sliding Window Maximum Hard Deque, Fixed Window Amazon, Google

Stack (7 Problems)

No. Problem Difficulty Pattern Company Tags
21 Valid Parentheses Easy Stack Matching All FAANG
22 Min Stack Medium Stack Design Amazon, Apple
23 Evaluate Reverse Polish Notation Medium Stack Evaluation Amazon, Meta
24 Generate Parentheses Medium Backtracking, Stack Google, Meta
25 Daily Temperatures Medium Monotonic Stack Amazon, Google
26 Car Fleet Medium Stack, Sorting Tesla, Amazon
27 Largest Rectangle in Histogram Hard Monotonic Stack Google, Amazon

Binary Search (7 Problems)

No. Problem Difficulty Pattern Company Tags
28 Binary Search Easy Basic Binary Search All FAANG
29 Search a 2D Matrix Medium Matrix Binary Search Amazon, Apple
30 Koko Eating Bananas Medium Binary Search on Answer Google, Meta
31 Find Minimum in Rotated Sorted Array Medium Rotated Array All FAANG
32 Search in Rotated Sorted Array Medium Rotated Array All FAANG
33 Time Based Key-Value Store Medium Binary Search, Design Google, Amazon
34 Median of Two Sorted Arrays Hard Binary Search, Arrays Google, Amazon

Linked List (11 Problems)

No. Problem Difficulty Pattern Company Tags
35 Reverse Linked List Easy Iterative/Recursive All FAANG
36 Merge Two Sorted Lists Easy Two Pointers All FAANG
37 Reorder List Medium Multiple Pointers Meta, Amazon
38 Remove Nth Node From End of List Medium Two Pointers Amazon, Google
39 Copy List with Random Pointer Medium Hash Map, Cloning Meta, Amazon
40 Add Two Numbers Medium Simulation Meta, Amazon
41 Linked List Cycle Easy Floyd's Algorithm All FAANG
42 Find the Duplicate Number Medium Floyd's Algorithm All FAANG
43 LRU Cache Medium Design, Hash Map All FAANG
44 Merge k Sorted Lists Hard Divide & Conquer All FAANG
45 Reverse Nodes in k-Group Hard Advanced Reversal Meta, Google

Trees (15 Problems)

No. Problem Difficulty Pattern Company Tags
46 Invert Binary Tree Easy DFS/BFS All FAANG
47 Maximum Depth of Binary Tree Easy DFS/BFS All FAANG
48 Diameter of Binary Tree Easy DFS All FAANG
49 Balanced Binary Tree Easy DFS Amazon, Apple
50 Same Tree Easy DFS/BFS All FAANG
51 Subtree of Another Tree Easy DFS Amazon, Meta
52 Lowest Common Ancestor of a Binary Search Tree Medium BST Property All FAANG
53 Binary Tree Level Order Traversal Medium BFS All FAANG
54 Binary Tree Right Side View Medium BFS/DFS Amazon, Meta
55 Count Good Nodes in Binary Tree Medium DFS Amazon, Google
56 Validate Binary Search Tree Medium DFS, BST All FAANG
57 Kth Smallest Element in a BST Medium Inorder Traversal All FAANG
58 Construct Binary Tree from Preorder and Inorder Traversal Medium Tree Construction All FAANG
59 Binary Tree Maximum Path Sum Hard DFS, Path Sum All FAANG
60 Serialize and Deserialize Binary Tree Hard Tree Serialization All FAANG

Tries (3 Problems)

No. Problem Difficulty Pattern Company Tags
61 Implement Trie (Prefix Tree) Medium Trie Design All FAANG
62 Design Add and Search Words Data Structure Medium Trie, Backtracking Google, Meta
63 Word Search II Hard Trie, Backtracking All FAANG

Heap / Priority Queue (7 Problems)

No. Problem Difficulty Pattern Company Tags
64 Kth Largest Element in a Stream Easy Min Heap All FAANG
65 Last Stone Weight Easy Max Heap Amazon, Apple
66 K Closest Points to Origin Medium Min Heap All FAANG
67 Kth Largest Element in an Array Medium Quickselect, Heap All FAANG
68 Task Scheduler Medium Max Heap, Greedy All FAANG
69 Design Twitter Medium Heap, Design Amazon, Meta
70 Find Median from Data Stream Hard Two Heaps All FAANG

Backtracking (9 Problems)

No. Problem Difficulty Pattern Company Tags
71 Subsets Medium Backtracking All FAANG
72 Combination Sum Medium Backtracking All FAANG
73 Permutations Medium Backtracking All FAANG
74 Subsets II Medium Backtracking, Duplicates Amazon, Meta
75 Combination Sum II Medium Backtracking, Duplicates Amazon, Google
76 Word Search Medium Backtracking, Matrix All FAANG
77 Palindrome Partitioning Medium Backtracking, String Amazon, Google
78 Letter Combinations of a Phone Number Medium Backtracking All FAANG
79 N-Queens Hard Backtracking Google, Amazon

Graphs (13 Problems)

No. Problem Difficulty Pattern Company Tags
80 Number of Islands Medium DFS/BFS All FAANG
81 Clone Graph Medium DFS/BFS, Cloning All FAANG
82 Max Area of Island Medium DFS Amazon, Google
83 Pacific Atlantic Water Flow Medium DFS/BFS Google, Amazon
84 Surrounded Regions Medium DFS/BFS Amazon, Google
85 Rotting Oranges Medium BFS Amazon, Apple
86 Walls and Gates Medium BFS Google, Meta
87 Course Schedule Medium Topological Sort All FAANG
88 Course Schedule II Medium Topological Sort All FAANG
89 Redundant Connection Medium Union Find Google, Amazon
90 Number of Connected Components in an Undirected Graph Medium Union Find/DFS Google, Meta
91 Graph Valid Tree Medium Union Find/DFS Google, Meta
92 Word Ladder Hard BFS All FAANG

Advanced Graphs (6 Problems)

No. Problem Difficulty Pattern Company Tags
93 Reconstruct Itinerary Hard Eulerian Path Google, Amazon
94 Min Cost to Connect All Points Medium MST (Prim's/Kruskal's) Amazon, Google
95 Network Delay Time Medium Dijkstra's Algorithm Amazon, Google
96 Swim in Rising Water Hard Dijkstra's/Binary Search Google, Amazon
97 Alien Dictionary Hard Topological Sort Google, Meta
98 Cheapest Flights Within K Stops Medium Bellman-Ford/Dijkstra's Google, Amazon

1-D Dynamic Programming (12 Problems)

No. Problem Difficulty Pattern Company Tags
99 Climbing Stairs Easy Basic DP All FAANG
100 Min Cost Climbing Stairs Easy Basic DP Amazon, Apple
101 House Robber Medium Linear DP All FAANG
102 House Robber II Medium Circular Array DP All FAANG
103 Longest Palindromic Substring Medium String DP All FAANG
104 Palindromic Substrings Medium String DP Amazon, Google
105 Decode Ways Medium String DP All FAANG
106 Coin Change Medium DP, Greedy All FAANG
107 Maximum Product Subarray Medium DP All FAANG
108 Word Break Medium String DP All FAANG
109 Longest Increasing Subsequence Medium DP, Binary Search All FAANG
110 Partition Equal Subset Sum Medium Subset Sum DP Amazon, Google

2-D Dynamic Programming (11 Problems)

No. Problem Difficulty Pattern Company Tags
111 Unique Paths Medium Grid DP All FAANG
112 Longest Common Subsequence Medium String DP All FAANG
113 Best Time to Buy and Sell Stock with Cooldown Medium State Machine DP Google, Amazon
114 Coin Change 2 Medium Unbounded Knapsack Amazon, Google
115 Target Sum Medium Subset Sum DP Google, Meta
116 Interleaving String Medium String DP Google, Amazon
117 Longest Increasing Path in a Matrix Hard DFS + Memoization Google, Amazon
118 Distinct Subsequences Hard String DP Google, Amazon
119 Edit Distance Hard String DP Google, Meta
120 Burst Balloons Hard Interval DP Google, Amazon
121 Regular Expression Matching Hard String DP All FAANG

Greedy (8 Problems)

No. Problem Difficulty Pattern Company Tags
122 Maximum Subarray Medium Kadane's Algorithm All FAANG
123 Jump Game Medium Greedy All FAANG
124 Jump Game II Medium Greedy All FAANG
125 Gas Station Medium Greedy Amazon, Google
126 Hand of Straights Medium Greedy, Hash Map Google, Amazon
127 Merge Triplets to Form Target Triplet Medium Greedy Google, Amazon
128 Partition Labels Medium Greedy Amazon, Google
129 Valid Parenthesis String Medium Greedy Google, Meta

Intervals (5 Problems)

No. Problem Difficulty Pattern Company Tags
130 Insert Interval Medium Interval Merge All FAANG
131 Merge Intervals Medium Interval Merge All FAANG
132 Non-overlapping Intervals Medium Greedy Amazon, Google
133 Meeting Rooms Easy Sorting All FAANG
134 Meeting Rooms II Medium Heap, Greedy All FAANG

Math & Geometry (8 Problems)

No. Problem Difficulty Pattern Company Tags
135 Rotate Image Medium Matrix Manipulation All FAANG
136 Spiral Matrix Medium Matrix Traversal All FAANG
137 Set Matrix Zeroes Medium Matrix Modification Amazon, Apple
138 Happy Number Easy Number Theory Google, Apple
139 Plus One Easy Array Manipulation Google, Apple
140 Pow(x, n) Medium Fast Exponentiation All FAANG
141 Multiply Strings Medium String Math Google, Meta
142 Detect Squares Medium Geometry Google, Amazon

Bit Manipulation (7 Problems)

No. Problem Difficulty Pattern Company Tags
143 Single Number Easy XOR All FAANG
144 Number of 1 Bits Easy Bit Counting All FAANG
145 Counting Bits Easy DP + Bits All FAANG
146 Reverse Bits Easy Bit Reversal Apple, Amazon
147 Missing Number Easy XOR/Math All FAANG
148 Sum of Two Integers Medium Bit Arithmetic Apple, Amazon
149 Reverse Integer Medium Integer Manipulation All FAANG

📚 Study Strategy

Week 1-2: Foundation (Arrays, Two Pointers, Sliding Window)

  • Master basic patterns with arrays and strings
  • Focus on understanding time/space complexity
  • Practice implementation without looking at solutions

Week 3-4: Data Structures (Stack, Linked Lists, Trees)

  • Learn fundamental data structure operations
  • Practice traversal algorithms (DFS, BFS)
  • Understand when to use each data structure

Week 5-6: Advanced Patterns (Backtracking, Graphs, Heaps)

  • Study complex algorithmic patterns
  • Practice problem decomposition
  • Learn to identify pattern similarities

Week 7-8: Dynamic Programming & Optimization

  • Start with 1D DP problems
  • Progress to 2D DP and advanced techniques
  • Focus on state transition understanding

Week 9-10: Final Topics & Review

  • Complete remaining categories
  • Review challenging problems
  • Take timed practice sessions

🎯 Success Tips

  1. Understand Patterns: Don't just memorize solutions - understand the underlying patterns
  2. Time Yourself: Practice under time constraints (20-30 minutes per problem)
  3. Code Without IDE: Practice writing code on paper or whiteboard
  4. Explain Solutions: Be able to articulate your approach and trade-offs
  5. Review Regularly: Revisit problems you found challenging
  6. Mock Interviews: Practice explaining your solution process

🔗 Additional Resources


Happy Coding! 🚀

Remember: Consistency beats intensity. Practice a few problems daily rather than cramming everything at once.