Skip to content

Priority Problems: 50 Must-Solve Problems

The essential problem set for rapid interview preparation


Overview

This curated list of 50 problems represents the highest-value problems for SDE interview preparation. Each problem was selected based on:

  • Frequency: How often similar problems appear in technical interviews
  • Pattern Coverage: Ensures all essential patterns are practiced
  • Skill Building: Problems build on each other progressively
  • Time Efficiency: Maximum learning per hour invested

Target Completion Time: 25-30 hours total (30-40 minutes per problem)


How to Use This List

  1. Solve in order - Problems are arranged by difficulty and dependency
  2. Time yourself - Set a 35-40 minute limit per problem
  3. Review solutions - After solving, study the optimal approach
  4. Document patterns - Note which pattern each problem uses
  5. Revisit failures - Re-solve any problem you could not complete

Progress Tracking Legend

[ ] Not started
[~] Attempted but incomplete
[x] Solved independently
[!] Solved with hints
[*] Mastered (can solve in <20 min)

Difficulty Ratings

RatingDescriptionTime Target
EEasy - Warm up15-20 min
MMedium - Interview standard25-35 min
HHard - Stretch goal35-45 min

Week 1 Problems (1-25)

Arrays and Strings (1-8)

#ProblemDifficultyPatternLeetCodeStatus
1Two SumEHash Map#1[ ]
2Best Time to Buy and Sell StockESingle Pass#121[ ]
3Contains DuplicateEHash Set#217[ ]
4Maximum SubarrayMKadane's#53[ ]
5Product of Array Except SelfMPrefix/Suffix#238[ ]
63SumMTwo Pointers#15[ ]
7Container With Most WaterMTwo Pointers#11[ ]
8Longest Substring Without RepeatingMSliding Window#3[ ]

Key Learning Goals:

  • Master two-pointer technique on sorted/unsorted arrays
  • Understand sliding window for substring problems
  • Recognize when to use hash maps vs sets

Hash Tables (9-12)

#ProblemDifficultyPatternLeetCodeStatus
9Valid AnagramEFrequency Count#242[ ]
10Group AnagramsMHash + Sort#49[ ]
11Top K Frequent ElementsMFrequency + Heap#347[ ]
12Longest Consecutive SequenceMHash Set#128[ ]

Key Learning Goals:

  • Use frequency maps for counting problems
  • Combine hash tables with sorting/heaps
  • Recognize O(n) solutions using hash sets

Linked Lists (13-17)

#ProblemDifficultyPatternLeetCodeStatus
13Reverse Linked ListEPointer Manipulation#206[ ]
14Merge Two Sorted ListsETwo Pointers#21[ ]
15Linked List CycleEFast/Slow Pointers#141[ ]
16Remove Nth Node From EndMTwo Pointers#19[ ]
17Reorder ListMMultiple Techniques#143[ ]

Key Learning Goals:

  • Master in-place reversal
  • Apply Floyd's cycle detection
  • Combine multiple techniques (find middle + reverse + merge)

Stacks and Queues (18-21)

#ProblemDifficultyPatternLeetCodeStatus
18Valid ParenthesesEStack Matching#20[ ]
19Min StackMAuxiliary Stack#155[ ]
20Daily TemperaturesMMonotonic Stack#739[ ]
21Largest Rectangle in HistogramHMonotonic Stack#84[ ]

Key Learning Goals:

  • Recognize monotonic stack patterns
  • Track auxiliary information in stacks
  • Handle "next greater/smaller" problems

Binary Trees (22-25)

#ProblemDifficultyPatternLeetCodeStatus
22Invert Binary TreeERecursive DFS#226[ ]
23Maximum Depth of Binary TreeEDFS/BFS#104[ ]
24Binary Tree Level Order TraversalMBFS#102[ ]
25Validate Binary Search TreeMInorder/Range#98[ ]

Key Learning Goals:

  • Master recursive tree traversals
  • Implement BFS for level-order
  • Validate tree properties with constraints

Week 2 Problems (26-50)

Trees - Advanced (26-30)

#ProblemDifficultyPatternLeetCodeStatus
26Lowest Common Ancestor of BSTMBST Properties#235[ ]
27Lowest Common Ancestor of BTMRecursive DFS#236[ ]
28Construct Binary Tree from Preorder and InorderMDivide and Conquer#105[ ]
29Serialize and Deserialize Binary TreeHBFS/DFS#297[ ]
30Binary Tree Maximum Path SumHDFS + Global Max#124[ ]

Key Learning Goals:

  • Handle complex tree recursion
  • Build trees from traversals
  • Track global state during recursion

Graphs (31-36)

#ProblemDifficultyPatternLeetCodeStatus
31Number of IslandsMDFS/BFS Grid#200[ ]
32Clone GraphMBFS + Hash Map#133[ ]
33Pacific Atlantic Water FlowMMulti-source BFS#417[ ]
34Course ScheduleMTopological Sort#207[ ]
35Course Schedule IIMTopological Sort#210[ ]
36Graph Valid TreeMUnion-Find#261[ ]

Key Learning Goals:

  • Apply BFS/DFS to grids and graphs
  • Detect cycles using multiple methods
  • Implement Union-Find structure

Binary Search (37-39)

#ProblemDifficultyPatternLeetCodeStatus
37Search in Rotated Sorted ArrayMModified Binary Search#33[ ]
38Find Minimum in Rotated Sorted ArrayMBinary Search#153[ ]
39Koko Eating BananasMBinary Search on Answer#875[ ]

Key Learning Goals:

  • Handle rotated arrays
  • Apply binary search to answer spaces
  • Recognize monotonic properties

Backtracking (40-42)

#ProblemDifficultyPatternLeetCodeStatus
40SubsetsMBacktracking#78[ ]
41PermutationsMBacktracking#46[ ]
42Combination SumMBacktracking#39[ ]

Key Learning Goals:

  • Master the backtracking template
  • Handle duplicates and pruning
  • Understand time complexity of exhaustive search

Dynamic Programming (43-50)

#ProblemDifficultyPatternLeetCodeStatus
43Climbing StairsEFibonacci DP#70[ ]
44House RobberM1D DP#198[ ]
45Coin ChangeMUnbounded Knapsack#322[ ]
46Longest Increasing SubsequenceMLIS Pattern#300[ ]
47Word BreakMString DP#139[ ]
48Unique PathsMGrid DP#62[ ]
49Longest Common SubsequenceM2D DP#1143[ ]
50Edit DistanceM2D DP#72[ ]

Key Learning Goals:

  • Define DP states clearly
  • Implement 1D and 2D DP tables
  • Optimize space when possible

Problem-Pattern Mapping

Quick reference for which pattern each problem uses:

By Pattern

PatternProblem Numbers
Two Pointers6, 7, 14, 16
Sliding Window8
Fast/Slow Pointers15
Hash Map/Set1, 3, 9, 10, 11, 12
Stack18, 19, 20, 21
Binary Search37, 38, 39
Tree DFS22, 23, 25, 26, 27, 28, 30
Tree BFS24, 29
Graph DFS/BFS31, 32, 33
Topological Sort34, 35
Union-Find36
Backtracking40, 41, 42
DP (1D)43, 44, 45, 46, 47
DP (2D)48, 49, 50

By Difficulty

DifficultyProblems
Easy (11)1, 2, 3, 9, 13, 14, 15, 18, 22, 23, 43
Medium (36)4, 5, 6, 7, 8, 10, 11, 12, 16, 17, 19, 20, 24, 25, 26, 27, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50
Hard (3)21, 29, 30

Daily Practice Schedule

If You Have 2 Weeks

DayProblemsFocus Area
Day 11-6Arrays and Two Pointers
Day 27-12Sliding Window and Hash
Day 313-17Linked Lists
Day 418-21Stacks
Day 522-25Binary Trees
Day 626-30Advanced Trees
Day 7Review + MockConsolidation
Day 831-36Graphs
Day 937-39Binary Search
Day 1040-42Backtracking
Day 1143-46DP Basics
Day 1247-50DP Advanced
Day 13Mixed PracticeRandom Selection
Day 14Review + MockFinal Prep

If You Have 1 Week

Focus on starred problems (highest priority):

DayPriority Problems
Day 11*, 4*, 6*, 8*
Day 213*, 15*, 18*, 20*
Day 324*, 25*, 27*
Day 431*, 34*
Day 540*, 41*, 42*
Day 644*, 45*, 49*
Day 7Review + Mock

Solution Approach Notes

Problem 1: Two Sum

Pattern: Hash Map
Key Insight: Store seen numbers with their indices
Time: O(n), Space: O(n)
Edge Cases: Same element used twice, no solution

Problem 6: 3Sum

Pattern: Sort + Two Pointers
Key Insight: Fix one number, use two pointers for rest
Time: O(n^2), Space: O(1) or O(n) for sorting
Edge Cases: Duplicate triplets, all same numbers

Problem 21: Largest Rectangle in Histogram

Pattern: Monotonic Stack (Increasing)
Key Insight: For each bar, find left and right boundaries
Time: O(n), Space: O(n)
Edge Cases: Single bar, all same heights

Problem 34: Course Schedule

Pattern: Topological Sort (Kahn's Algorithm)
Key Insight: Build in-degree array, process zero-degree nodes
Time: O(V + E), Space: O(V + E)
Edge Cases: Cycle exists, single course, no prerequisites

Problem 45: Coin Change

Pattern: Unbounded Knapsack DP
Key Insight: dp[amount] = min coins to make amount
Time: O(amount * coins), Space: O(amount)
Edge Cases: Amount = 0, impossible amount

Problem 50: Edit Distance

Pattern: 2D String DP
Key Insight: dp[i][j] = min ops for word1[0:i] to word2[0:j]
Time: O(m*n), Space: O(m*n) or O(n) optimized
Edge Cases: Empty strings, identical strings

Progress Tracker

Week 1 Summary

Arrays/Strings:    ___/8  completed
Hash Tables:       ___/4  completed
Linked Lists:      ___/5  completed
Stacks/Queues:     ___/4  completed
Binary Trees:      ___/4  completed
Week 1 Total:      ___/25 completed

Week 2 Summary

Trees Advanced:    ___/5  completed
Graphs:            ___/6  completed
Binary Search:     ___/3  completed
Backtracking:      ___/3  completed
Dynamic Programming: ___/8  completed
Week 2 Total:      ___/25 completed

Overall Progress

Total Completed:   ___/50
Mastered (*):      ___/50
Need Review (~):   ___/50

Patterns Covered:
[ ] Two Pointers
[ ] Sliding Window
[ ] Fast/Slow Pointers
[ ] Hash Map/Set
[ ] Stack (including Monotonic)
[ ] Binary Search
[ ] Tree DFS/BFS
[ ] Graph DFS/BFS
[ ] Topological Sort
[ ] Union-Find
[ ] Backtracking
[ ] DP (1D and 2D)

Tips for Problem Solving

Before Coding

  1. Read the problem twice
  2. Identify the pattern (see Pattern Selection Flowchart)
  3. Think about edge cases
  4. Explain your approach verbally

During Coding

  1. Start with a clear function signature
  2. Write pseudocode comments first
  3. Implement step by step
  4. Handle edge cases explicitly

After Coding

  1. Trace through with an example
  2. Test edge cases
  3. Analyze time and space complexity
  4. Consider optimization opportunities

When Stuck

  • 10 minutes: Look at the hint/pattern
  • 20 minutes: Review the solution concept
  • 30 minutes: Study the full solution, then implement yourself

Additional Resources

LeetCode Lists

Video Explanations

  • NeetCode YouTube channel
  • Take U Forward (Striver's A2Z)
  • Back to Back SWE

Practice Platforms

  • LeetCode Premium (recommended for company-tagged problems)
  • Pramp (free mock interviews)
  • Interviewing.io (paid mock interviews)

Track your progress daily and review Common Mistakes to avoid pitfalls.


Last updated: January 2026