Skip to content
Codeloom
DSA

DSA Interview Checklist: 75 Must-Know Problems

The complete DSA interview checklist — 75 essential problems organized by pattern, study schedules for 4, 8, and 12 weeks, a pattern recognition framework, and what interviewers actually look for.

·16 min read · By Codeloom
Beginner 30 min read

What you'll learn

  • 75 must-know problems organized by pattern and data structure
  • How to build a 4-week, 8-week, or 12-week study schedule
  • A framework for recognizing which pattern to apply to unknown problems
  • Common mistakes that cost offers — and how to avoid them
  • What interviewers actually evaluate beyond correctness

Prerequisites

Preparing for coding interviews without a checklist is like studying for an exam without a syllabus. You end up solving random problems, spending weeks on niche topics, and missing the patterns that actually show up. This post gives you the complete checklist: 75 problems, organized by pattern, with study schedules and a framework for tackling problems you have never seen before.

Interview checklist


The 75 Must-Know Problems

These problems are curated for maximum coverage. Each one teaches a reusable pattern. Solving all 75 means you have seen every major pattern that appears in FAANG-level interviews.

Arrays and Hashing (10 problems)

#ProblemDifficultyLeetCodeKey Pattern
1Two SumEasy#1Hash map lookup
2Valid AnagramEasy#242Frequency count
3Group AnagramsMedium#49Sorted key + hash map
4Top K Frequent ElementsMedium#347Bucket sort / heap
5Product of Array Except SelfMedium#238Prefix/suffix products
6Longest Consecutive SequenceMedium#128Hash set + sequence start
7Contains DuplicateEasy#217Hash set
8Encode and Decode StringsMedium#271Length prefix encoding
9Maximum SubarrayMedium#53Kadane’s algorithm
10Subarray Sum Equals KMedium#560Prefix sum + hash map

Two Pointers (5 problems)

#ProblemDifficultyLeetCodeKey Pattern
11Valid PalindromeEasy#125Two pointers inward
123SumMedium#15Sort + two pointers
13Container With Most WaterMedium#11Shrink the shorter side
14Trapping Rain WaterHard#42Left/right max pointers
15Two Sum II (Sorted)Medium#167Two pointers on sorted

Sliding Window (5 problems)

#ProblemDifficultyLeetCodeKey Pattern
16Best Time to Buy/Sell StockEasy#121Track min so far
17Longest Substring Without RepeatingMedium#3Expand/shrink window
18Longest Repeating Character ReplacementMedium#424Window + max freq
19Minimum Window SubstringHard#76Two hash maps + window
20Sliding Window MaximumHard#239Monotonic deque

Stack (5 problems)

#ProblemDifficultyLeetCodeKey Pattern
21Valid ParenthesesEasy#20Stack matching
22Min StackMedium#155Auxiliary min stack
23Daily TemperaturesMedium#739Monotonic stack
24Largest Rectangle in HistogramHard#84Monotonic stack
25Evaluate Reverse Polish NotationMedium#150Stack evaluation

Binary Search (5 problems)

#ProblemDifficultyLeetCodeKey Pattern
26Binary SearchEasy#704Classic template
27Search in Rotated Sorted ArrayMedium#33Find sorted half
28Find Minimum in Rotated Sorted ArrayMedium#153Pivot detection
29Koko Eating BananasMedium#875BS on answer
30Search a 2D MatrixMedium#74Flatten to 1D

Linked Lists (6 problems)

#ProblemDifficultyLeetCodeKey Pattern
31Reverse Linked ListEasy#206Three-pointer reversal
32Merge Two Sorted ListsEasy#21Dummy head + merge
33Linked List CycleEasy#141Fast/slow pointers
34Remove Nth Node From EndMedium#19Two-pass or gap pointers
35Reorder ListMedium#143Split + reverse + merge
36LRU CacheMedium#146Hash map + doubly linked list

Trees (10 problems)

#ProblemDifficultyLeetCodeKey Pattern
37Invert Binary TreeEasy#226Recursive swap
38Maximum Depth of Binary TreeEasy#104DFS depth
39Same TreeEasy#100Simultaneous DFS
40Subtree of Another TreeEasy#572DFS + same tree check
41Lowest Common Ancestor of BSTMedium#235BST property split
42Binary Tree Level Order TraversalMedium#102BFS with queue
43Validate BSTMedium#98In-order or range check
44Kth Smallest Element in BSTMedium#230In-order traversal
45Binary Tree from Preorder/InorderMedium#105Recursive construction
46Serialize and Deserialize Binary TreeHard#297BFS or preorder + null markers

Heap / Priority Queue (3 problems)

#ProblemDifficultyLeetCodeKey Pattern
47Find Median from Data StreamHard#295Two heaps
48Merge K Sorted ListsHard#23Min-heap of heads
49Top K Frequent WordsMedium#692Min-heap of size k

Backtracking (5 problems)

#ProblemDifficultyLeetCodeKey Pattern
50SubsetsMedium#78Include/exclude
51Combination SumMedium#39Backtrack with reuse
52PermutationsMedium#46Swap-based backtrack
53Word SearchMedium#79Grid DFS + visited
54Letter Combinations of PhoneMedium#17Cartesian product

Graphs (8 problems)

#ProblemDifficultyLeetCodeKey Pattern
55Number of IslandsMedium#200BFS/DFS flood fill
56Clone GraphMedium#133BFS + hash map
57Pacific Atlantic Water FlowMedium#417Reverse BFS from edges
58Course ScheduleMedium#207Topological sort (cycle)
59Course Schedule IIMedium#210Topological sort (order)
60Graph Valid TreeMedium#261Union-Find or DFS
61Number of Connected ComponentsMedium#323Union-Find
62Word LadderHard#127BFS shortest path

Dynamic Programming (10 problems)

#ProblemDifficultyLeetCodeKey Pattern
63Climbing StairsEasy#70Fibonacci DP
64House RobberMedium#198Take/skip DP
65House Robber IIMedium#213Circular array DP
66Longest Increasing SubsequenceMedium#300DP + binary search
67Coin ChangeMedium#322Unbounded knapsack
68Word BreakMedium#139DP + hash set
69Unique PathsMedium#62Grid DP
70Decode WaysMedium#911D DP with conditions
71Longest Common SubsequenceMedium#11432D string DP
72Edit DistanceMedium#722D string DP

Intervals and Greedy (3 problems)

#ProblemDifficultyLeetCodeKey Pattern
73Merge IntervalsMedium#56Sort + merge overlaps
74Non-Overlapping IntervalsMedium#435Greedy earliest end
75Meeting Rooms IIMedium#253Min-heap or sweep line

Study Schedules

4-Week Sprint (Tight Deadline)

For those with < 1 month to prepare. Solve 3-4 problems per day, focusing on the most common patterns.

schedule_4_week = {
    "Week 1: Foundations": [
        "Day 1-2: Arrays + Hashing (#1-10)",
        "Day 3: Two Pointers (#11-15)",
        "Day 4: Sliding Window (#16-20)",
        "Day 5: Stack (#21-25)",
        "Day 6: Binary Search (#26-30)",
        "Day 7: Review + revisit weak spots",
    ],
    "Week 2: Data Structures": [
        "Day 1: Linked Lists (#31-36)",
        "Day 2-3: Trees (#37-46)",
        "Day 4: Heaps (#47-49)",
        "Day 5: Backtracking (#50-54)",
        "Day 6-7: Review + mock interview",
    ],
    "Week 3: Graphs + DP": [
        "Day 1-2: Graphs (#55-62)",
        "Day 3-5: Dynamic Programming (#63-72)",
        "Day 6: Intervals (#73-75)",
        "Day 7: Review all patterns",
    ],
    "Week 4: Polish": [
        "Day 1-3: Redo problems you struggled with",
        "Day 4-5: Timed mock interviews (45 min each)",
        "Day 6: System design review (if applicable)",
        "Day 7: Rest and light review",
    ],
}

8-Week Standard Plan

The sweet spot for most candidates. Solve 2 problems per day with deeper understanding.

schedule_8_week = {
    "Weeks 1-2": "Arrays, Hashing, Two Pointers, Sliding Window (20 problems)",
    "Weeks 3-4": "Stack, Binary Search, Linked Lists, Trees (21 problems)",
    "Weeks 5-6": "Heaps, Backtracking, Graphs (16 problems)",
    "Weeks 7-8": "DP, Intervals, review, and mock interviews (18 problems)",
}

12-Week Deep Dive

For career changers or those starting from scratch. 1-2 problems per day with time for theory.

schedule_12_week = {
    "Weeks 1-3": "Learn data structures + solve Easy problems",
    "Weeks 4-6": "Arrays, Strings, Linked Lists, Trees (patterns + Medium)",
    "Weeks 7-9": "Graphs, DP, Binary Search (core Medium/Hard)",
    "Weeks 10-11": "Mock interviews, company-specific problems",
    "Week 12": "Review, rest, confidence building",
}

Pattern Recognition Framework

When you see an unknown problem, run through this decision tree.

Step 1: What Are You Given?

def identify_input(problem):
    """
    First, classify the input type.
    """
    input_patterns = {
        "Sorted array": "Binary search or two pointers",
        "Unsorted array": "Hash map, sorting, or sliding window",
        "String": "Hash map, two pointers, or DP",
        "Linked list": "Two pointers (fast/slow)",
        "Tree": "DFS or BFS",
        "Graph": "BFS, DFS, or Union-Find",
        "Matrix/Grid": "BFS/DFS or DP",
        "Set of choices": "Backtracking or DP",
    }
    return input_patterns

Step 2: What Are You Asked For?

Asked ForLikely Pattern
”Find a pair/triplet”Two pointers or hash map
”Longest/shortest substring”Sliding window
”All permutations/subsets”Backtracking
”Minimum/maximum of something”DP, binary search, or greedy
”Is it possible?”BFS/DFS or DP
”Count the number of ways”DP
”Shortest path”BFS (unweighted) or Dijkstra (weighted)
“Connected components”Union-Find or DFS
”Top K elements”Heap
”Order of tasks”Topological sort

Step 3: Recognize Sub-Patterns

def recognize_pattern(problem_clues):
    """
    Common clue words and their patterns.
    """
    clue_to_pattern = {
        "contiguous subarray": "Sliding window or prefix sum",
        "subsequence": "DP (often 2D)",
        "parentheses/brackets": "Stack",
        "next greater/smaller": "Monotonic stack",
        "k-th largest/smallest": "Heap or quickselect",
        "intervals overlap": "Sort by start, merge or sweep line",
        "minimize the maximum": "Binary search on answer",
        "maximize the minimum": "Binary search on answer",
        "at most k distinct": "Sliding window + hash map",
        "all paths/combinations": "Backtracking (DFS)",
        "optimal substructure": "DP",
    }
    return clue_to_pattern

The 5-Minute Rule

If you cannot identify the pattern in 5 minutes:

  1. Try brute force first — write the O(n^2) or O(2^n) solution
  2. Ask: what work is repeated? — that reveals the optimization
  3. Ask: is there a monotonic property? — that reveals binary search or stack
  4. Ask: can I break this into subproblems? — that reveals DP

Common Mistakes That Cost Offers

Mistake 1: Jumping to Code Too Fast

Wrong: Read problem, immediately start coding.

Right: Spend 3-5 minutes on examples, edge cases, and approach discussion before writing a single line.

# The interview framework:
# 1. Clarify (1-2 min): constraints, edge cases, input format
# 2. Examples (2-3 min): walk through 2-3 examples by hand
# 3. Approach (2-3 min): explain your algorithm, state complexity
# 4. Code (15-20 min): write clean code
# 5. Test (5 min): trace through your code with examples
# 6. Optimize (if time): discuss improvements

Mistake 2: Not Handling Edge Cases

Always check these before submitting:

  • Empty input ([], "", None)
  • Single element
  • All elements the same
  • Already sorted / reverse sorted
  • Negative numbers
  • Integer overflow (less common in Python)
  • Input at constraint boundaries
def safe_solution(nums):
    # ALWAYS handle edge cases first
    if not nums:
        return 0
    if len(nums) == 1:
        return nums[0]
    # ... main logic

Mistake 3: Ignoring Time Complexity

Wrong: “My solution works!” (but it is O(n^3) on n = 10^5)

Right: Check constraints first.

# Rough guide for what passes in ~1 second:
# n <= 10:       O(n!) or O(2^n) is fine
# n <= 20:       O(2^n) is fine
# n <= 500:      O(n^3) is fine
# n <= 5000:     O(n^2) is fine
# n <= 10^5:     O(n log n) needed
# n <= 10^6:     O(n) needed
# n <= 10^8:     O(log n) or O(1) needed

Mistake 4: Poor Variable Names

# BAD — what do i, j, t mean?
def f(a, k):
    t = 0
    for i in range(len(a)):
        t += a[i]
        if t > k:
            return i
    return -1

# GOOD — self-documenting
def find_first_prefix_exceeding(nums, target):
    running_sum = 0
    for idx in range(len(nums)):
        running_sum += nums[idx]
        if running_sum > target:
            return idx
    return -1

Mistake 5: Not Testing Your Code

# After coding, trace through at least:
# 1. The given example
# 2. An edge case (empty/single element)
# 3. A tricky case (duplicates, negatives, boundary)

# Do this OUT LOUD in the interview:
# "Let me trace through [2, 7, 11, 15] with target 9..."
# "i=0, complement = 9-2 = 7, not in map, add 2->0"
# "i=1, complement = 9-7 = 2, found in map at index 0!"
# "Return [0, 1]. Correct."

What Interviewers Actually Look For

1. Problem-Solving Process (40% of evaluation)

  • Do you ask clarifying questions?
  • Do you consider multiple approaches before committing?
  • Can you reason about trade-offs?

2. Code Quality (25% of evaluation)

  • Is your code clean, readable, and well-structured?
  • Do you use meaningful names?
  • Do you handle edge cases?

3. Communication (20% of evaluation)

  • Do you think out loud?
  • Can you explain your reasoning clearly?
  • Do you respond well to hints?

4. Correctness (15% of evaluation)

  • Does your code actually work?
  • Do you test it yourself before declaring “done”?

Surprising truth: Many candidates who write correct but messy code with no communication get rejected. Candidates who communicate well, write clean code, but need one small hint often get hired.

# What interviewers want to hear:
good_communication = [
    "Let me make sure I understand the problem...",
    "My initial thought is brute force O(n^2), but I think we can do better",
    "I'll use a hash map because we need O(1) lookups",
    "The key insight is that if we sort first...",
    "Let me trace through this example to verify...",
    "The time complexity is O(n log n) because of the sort",
    "An edge case to consider: what if the array is empty?",
]

Quick Reference: Pattern to Complexity

PatternTypical TimeTypical Space
Hash map lookupO(n)O(n)
Two pointers (sorted)O(n)O(1)
Sliding windowO(n)O(k)
Binary searchO(log n)O(1)
BS on answerO(n log M)O(1)
BFS/DFSO(V + E)O(V)
Topological sortO(V + E)O(V)
BacktrackingO(2^n) or O(n!)O(n)
DP (1D)O(n) or O(n * k)O(n)
DP (2D)O(n * m)O(n * m) or O(m)
Heap (top K)O(n log k)O(k)
Union-FindO(n * alpha(n))O(n)

Your Action Plan

  1. Bookmark this page. Use the 75-problem table as your checklist.
  2. Pick a schedule. 4 weeks if you are in a rush, 8 weeks for balanced prep, 12 weeks if starting from zero.
  3. Track your progress. For each problem, note: solved independently (green), needed hint (yellow), needed solution (red). Revisit yellow/red problems weekly.
  4. Do mock interviews. Solving problems alone is not enough. Practice explaining your thought process under time pressure.
  5. Review patterns, not solutions. After solving a problem, ask: “What pattern did this use? Where else can I apply it?”
# Track your progress
progress = {
    "two_sum": "green",           # solved independently
    "trapping_rain_water": "yellow",  # needed hint about two pointers
    "serialize_tree": "red",      # needed to see the solution
}

# Revisit yellows after 3 days, reds after 1 day
# A problem isn't "done" until it's green

Key Takeaways

  1. 75 problems are enough if you understand the patterns. Random grinding of 500 problems is less effective.
  2. Pattern recognition > memorization. Learn to map problem clues to techniques.
  3. Communication matters more than perfection. A clean O(n log n) solution explained well beats an O(n) solution with no explanation.
  4. Edge cases show maturity. Handling empty input, single elements, and boundary conditions signals an experienced engineer.
  5. Practice under pressure. Set a 25-minute timer. If you cannot solve it, study the solution and re-solve in 3 days.