Top 50 Easy LeetCode Problems: Ranked, Ordered, and Explained

May 29, 202611 min read
interview-prepdsaleetcodealgorithms
Top 50 Easy LeetCode Problems: Ranked, Ordered, and Explained
TL;DR
  • Easy LeetCode problems have one purpose: build mechanical vocabulary before mediums, not to train pattern recognition
  • Two Sum (#1) introduces the hash map complement lookup that recurs across dozens of harder problems
  • Diameter of Binary Tree (#543) teaches the global-max/local-return pattern that drives most hard tree problems
  • Word Pattern (#290) is the most underrated: the bidirectional mapping bug trips people on medium and hard problems for years
  • Kadane's algorithm (#53) and Boyer-Moore voting (#169) both appear at easy level but transfer directly to medium-level patterns
  • Finish a category's easy set, then move to mediums in that same category before exhausting all 50 easies
  • Search Insert Position (#35) is the canonical binary search template for writing loop invariants correctly

"Easy" on LeetCode is a relative term. Relative to getting a PhD in algorithms, sure. Relative to an interview where you're nervous and thinking out loud for the first time in your life? Not always.

Easy problems have one job. Build mechanical vocabulary before the real problems start. They're not where you learn pattern recognition, because easy problems announce their pattern in the first sentence of the prompt. What they give you is fluency: the ability to write a hash map lookup, reverse a linked list, or run a clean DFS without stopping to think about what curr.next means.

If you're fumbling with basic pointer manipulation inside a medium problem, you're not solving the medium problem. You're still solving the easy one. These 50 problems fix that.

Who This Is For

Engineers starting prep who want a structured foundation. New grads who learned algorithms in lecture but haven't written much interview code. Career switchers who need fluency fast before moving to mediums.

If you've already solved 100+ problems and mediums feel comfortable, this list isn't for you. You're past this. Go do something else.

Don't Watch Someone Else Solve These

The worst way to use this list is to open a problem, stare at it for three minutes, then pull up a YouTube solution and watch someone explain it. You'll feel like you understood. You didn't. You watched understanding.

Set a 15-minute timer per problem. No tags visible. Write the solution, then look at the optimal version and explicitly name what you missed. For problems you've seen before, close your eyes, recall the core insight, and code from scratch. Recognition is not the same as recall. Interviews test recall.

After finishing a category, move to mediums in that category before working through every easy on this list. Easy problems announce the pattern. Mediums hide it. That gap is the actual skill. Cycle between the two.

Arrays: The Vocabulary Layer

Every other structure eventually gets compared to arrays. Start here. These ten problems cover the moves you'll use in everything else.

#ProblemWhat It Teaches
1Two SumHash map complement lookup: store what you've seen, check the difference
121Best Time to Buy and Sell StockSingle-pass min tracking: one variable carries the running minimum
217Contains DuplicateHash set membership: your first explicit O(1) lookup trade
53Maximum SubarrayKadane's algorithm: local vs. global max, DP showing up in array clothing
283Move ZeroesWrite-pointer pattern: slow pointer tracks next valid write position
66Plus OneCarry propagation right to left: the edge case is all nines
26Remove Duplicates from Sorted Arrayk-valid-elements pattern: write pointer, everything after is garbage
136Single NumberXOR self-cancellation: a ^ a = 0 and a ^ 0 = a, in one pass
268Missing NumberGauss formula vs. XOR: expected sum minus actual, or XOR reduction
169Majority ElementBoyer-Moore voting: cancellation proof when majority is guaranteed

The Two Sum insight carries forward into dozens of problems. Any time you see "find a pair satisfying condition X," ask whether storing complements in a hash map gets you to O(n). It usually does. Building that reflex here pays dividends everywhere else.

Strings: Two Moves Cover Most Problems

Strings are character arrays with an immutability tax. Most string problems reduce to one of two moves: converge from both ends, or count character frequencies. That is genuinely most of them.

#ProblemWhat It Teaches
125Valid PalindromeTwo pointers with filter: skip non-alphanumeric, converge inward
344Reverse StringIn-place swap: the simplest converging two-pointer template
242Valid AnagramFrequency count: int[26] beats a hash map on known character sets
387First Unique CharacterTwo-pass hash: count first, scan second
14Longest Common PrefixVertical scanning: compare column by column, stop on any mismatch
13Roman to IntegerHash map with lookahead: subtract when current value is less than next
392Is SubsequenceGreedy two pointer: advance source pointer only on a match
28Find the Index of the First OccurrenceBrute-force O(nm) baseline: the problem that makes you appreciate KMP

Problem 392 is more useful than it looks. The greedy pointer advance is provably correct, and understanding why transfers to interval scheduling and stream matching problems at the medium level.

Linked Lists: Pointers Are Not Optional

Before you touch any linked list problem, you need to be comfortable modifying next pointers without losing track of nodes. If you haven't practiced this, you will drop nodes. Not sometimes. Every time. Practice Reverse Linked List until it takes under two minutes. Everything else here is built on it.

#ProblemWhat It Teaches
206Reverse Linked Listprev/curr/next iterative reversal: the fundamental pointer manipulation
21Merge Two Sorted ListsDummy head node: avoids null-checking the head as a special case
141Linked List CycleFloyd's slow/fast detection: two pointers in the same structure
83Remove Duplicates from Sorted ListSkip-ahead pointer: curr.next.val == curr.val, then bypass
234Palindrome Linked ListSlow/fast + reverse second half: two techniques combined in one problem
876Middle of the Linked ListSlow/fast for midpoint: when fast reaches end, slow is at the middle

The dummy head node in problem 21 feels unnecessary until you try to write merge without it. Try without it. Then add it back. That five-minute exercise teaches more than any explanation.

Trees: Trust the Recursion

Tree problems teach recursion in a way array problems can't. Each node is a subproblem with the same structure as the whole. The hard part isn't the code. It's believing the recursive call handles the subtree correctly without you tracing every branch yourself.

#ProblemWhat It Teaches
104Maximum Depth of Binary TreeFirst recursive DFS: base case is null, return 1 + max(left, right)
226Invert Binary TreeSwap children recursively: three lines, teaches the trust-the-recursion mindset
101Symmetric TreeMirror comparison: check outer pairs then inner pairs recursively
100Same TreeStructural equality: null-null match, value match, recurse both sides
112Path SumRoot-to-leaf DFS: carry a running sum, check at every leaf node
110Balanced Binary TreeHeight and balance combined: return -1 to propagate imbalance upward
543Diameter of Binary TreeGlobal max with local return: the pattern behind most tree optimization
872Leaf-Similar TreesDFS leaf collection: extract, collect, then compare outside the recursion

Problem 543 (Diameter) carries more weight than its difficulty tag suggests. Your recursive function returns one thing to the parent (height) and updates a global maximum for something else (diameter). This exact pattern appears in Maximum Path Sum, Binary Tree Cameras, and a long list of hard tree problems. Learn it here on an easy problem, not there under pressure.

Stack: Two Problems. That's It.

#ProblemWhat It Teaches
20Valid ParenthesesPush/pop matching: bracket problems, expression validation, nested structures
155Min StackAuxiliary structure design: shadow stack tracks a running minimum in O(1)

Valid Parentheses shows up as a warmup in real interviews. If it takes more than five minutes, that's useful information. Not a judgment. Information. Do more stack work before moving on.

Hashing: Spend Space, Save Time

Hash problems build the habit of storing precomputed state to avoid redundant work. That habit transfers to more problems than any single pattern.

#ProblemWhat It Teaches
202Happy NumberCycle detection via set: stop when you've seen a state before
383Ransom NoteFrequency subtraction: magazine letters fund the ransom letter
349Intersection of Two ArraysSet conversion and intersection: O(n+m) via two sets
290Word PatternBidirectional mapping: both directions must map consistently

Word Pattern (#290) is the most underrated problem on this list. The bidirectional mapping bug trips people on harder problems for years. One-directional mapping looks correct until you hit a test case where two patterns map to the same word, and then you spend twenty minutes in a medium problem wondering why your solution fails. Debug that mistake here, not there.

Dynamic Programming: Five Problems, One Framework

These five problems exist so DP doesn't feel foreign by the time you hit mediums. Each introduces exactly one piece of the framework.

Don't skip Fibonacci because it's trivial. Watching memoization cut O(2^n) to O(n) explicitly is worth five minutes. That moment when the call tree collapses into a straight line is the whole point. It's also the clearest demonstration that caching works.

#ProblemWhat It Teaches
509Fibonacci NumberMemoization basics: from O(2^n) recursion to O(n) by caching states
70Climbing StairsFibonacci disguised as DP: spot the recurrence relation under the story
746Min Cost Climbing StairsOptimal substructure: dp[i] = min(dp[i-1], dp[i-2]) + cost[i]
198House RobberSkip-one DP: dp[i] = max(dp[i-1], dp[i-2] + nums[i])
118Pascal's Triangle2D DP construction: each cell depends on exactly two cells from the row above

The recurrence patterns here appear repeatedly at the medium level. Solve these until pattern identification is instant, then read Dynamic Programming Is Just Recursion With a Memory to see how they fit together.

Binary Search: One Invariant, Endless Off-by-Ones

Binary search takes ten minutes to learn and years to stop getting wrong at the edges. Not an exaggeration. Joshua Bloch, the author of Effective Java and a former Google engineer, found a binary search bug in Java's standard library that had been sitting there for nine years. The bug was (low + high) / 2 overflowing. In production code. At Google.

#ProblemWhat It Teaches
35Search Insert PositionLeftmost binary search: where would this element go if absent?
374Guess Number Higher or LowerBinary search on answer space: not an array, just a numerical range
1351Count Negative Numbers in Sorted MatrixStaircase search: start top-right, move left or down

Search Insert Position (#35) is the canonical binary search template. Get the loop invariant right here and you'll stop writing off-by-one bugs in most future problems. For the full treatment, see Binary Search: One Invariant to Rule the Search Space.

Math and Bit Manipulation: Four Worth Knowing

#ProblemWhat It Teaches
7Reverse IntegerOverflow detection: check the guard before you multiply, not after
231Power of TwoBit trick: n & (n-1) clears the lowest set bit, result is 0 for powers of 2
191Number of 1 BitsPopcount via n & (n-1) loop: each iteration clears one set bit
338Counting BitsDP plus bits: dp[i] = dp[i >> 1] + (i & 1) ties two things together

Counting Bits (#338) connects DP state transitions and bit patterns in a single problem. That combination shows up in bitmask DP at the hard level. One problem, two birds.

What's Next After Easy LeetCode Problems

Don't finish all 50 before touching mediums. Finish a category's easy set, then move to mediums in that same category. Easy problems announced the pattern. Mediums hide it. That gap is what you're actually training for.

If you're finishing mediums but struggling to explain your thinking in real time, the gap isn't more problems. Solving on your couch and explaining under interview pressure are different skills. SpaceComplexity runs realistic DSA mock interviews with real-time feedback on your communication, not just your code. Train both.

Further Reading