How many DSA problems should you solve before an interview?
There's no magic number of DSA problems. What matters is how many patterns you can spot and solve on your own. Here's how many to solve for each pattern, how to practice them, and how to tell when you're ready.

Someone learning Spanish before a trip asks how many words they need. A few hundred words they can use in a real conversation will carry them further than thousands they'd only recognize on a flashcard. DSA practice works the same way: what counts is what you can use on a problem you've never seen.
There's no fixed number of DSA problems that makes you ready for an interview. Count patterns instead. You're ready when, for each common pattern, you can spot it in a problem you haven't seen and solve a medium one without hints, in about the time a round gives you. The rest of this post shows how to get there and how to check.
Why doesn't the number of problems matter much?
Because two people can solve the same number of problems and learn very different amounts.
One person tries each problem for five minutes, opens the solution, and copies it in. Another tries for half an hour, takes one hint, and gets there. Their counts match. Only the second one could solve the next problem alone.
The count also hides what you practiced. Ten problems on a pattern you already know teach less than two on a pattern you don't. And interview problems are new to you by design, so what carries over isn't any one problem. It's the pattern: "count with a Map", "walk two pointers in from both ends", "use breadth-first search for the fewest steps".
How many problems should you solve for each pattern?
Enough to solve a medium one on your own. A good routine for each pattern:
- Read how it works. Each page on the algorithm map explains one pattern from zero, with a picture you can step through.
- Solve its easy problems. They show the pattern in its plainest shape.
- Solve a medium one without hints. Medium problems take more thought, and more often mix the pattern with a second one.
- Move on, and come back later to check that it stuck.
For a simple pattern like hash set lookup, that might be two or three easy problems and one medium. Patterns with many shapes, like dynamic programming or graphs, need more, because each new problem teaches a new way the same idea can look.

Which patterns should you cover?
Start with the patterns that most problems are built from. Each link below goes to the pattern's page, which lists its practice problems:
- Hashing: counting with a hash map and hash set lookup.
- One pass over a list: two pointers from opposite ends and the variable-size sliding window.
- Searching: binary search, and binary search on the answer.
- Stacks and queues: matching brackets with a stack, and the monotonic stack.
- Backtracking: generating subsets.
- Trees: depth-first search and level-order traversal.
- Heaps: top K elements.
- Graphs: breadth-first search, depth-first search, and topological sort.
- Dynamic programming: memoization.
- Intervals: merging overlapping intervals.
That list follows the map's order, and each section builds on the one before it. If you're not sure where to begin, the DSA roadmap for beginners explains the order.
How do you know you're ready?
Pick a few problems you haven't seen, from different sections, and check yourself against this list. It's close to the rubric the mock interview scores a coding round on:
- You spot the pattern. On the DSA practice problems page, the algorithm names stay hidden until you solve a problem, so you practice reading the clues. Leave Show algorithms off.
- You solve it without hints. The On my own badge counts problems solved without a hint or the solution. Watch it grow.
- You solve it in time. A mock interview gives you 30 minutes for an easy coding problem, 40 for a medium, and 45 for a hard one, and that includes explaining.
- It's fast enough. In JavaScript and TypeScript, Submit runs big tests as large as the constraints allow. A correct answer that's too slow gets stopped there.
- You can explain it. Say the time and space complexity with a reason, and name the edge cases: an empty input, duplicates, and the largest values allowed.
If you can do all five for most patterns, you're ready. If one pattern keeps failing, that's your next week of practice.
How should you practice each problem?
Read the constraints first. They tell you how fast the answer must be. A loop inside a loop is fine when the input has a thousand items, but not a hundred thousand. As a rough limit, about 10^8 simple steps is the most you can afford, which brute force explains.
Try before you ask for help. Give it real effort before you open a hint. On this site, each hint lowers the problem's XP a little, never below half, so the score shows how much you did alone. The second hint names the algorithm and links to its page.
Say the slow way first. Then improve it. The mock interview's rubric expects exactly that from a mid-level candidate, and it gives you a correct answer to fall back on.
Read the solution, even after you pass. Each worked solution walks from the first idea most people have to the fastest one. You'll often find a shorter way than yours.
Solve it again later. A few days on, try the problems you found hardest without looking. The Status filter's "Tried, not solved" option finds the ones you left halfway.
What should you do in the last week?
Stop learning new patterns. Mix the ones you know instead: set Section to all sections and Status to not solved, and pick problems from all over the list, so you never know the pattern in advance. Take a timed mock coding round or two, and read each report's rubric for the items you missed.
When you're ready to start, open the algorithm map, or go straight to the practice problems. If you're a frontend developer wondering how much of this you need, read do frontend developers need DSA?.


