How Long Should a LeetCode Problem Take?
Target 20 minutes for an easy, 30 to 45 minutes for a medium, and about 60 minutes for a hard. When the clock passes your target, stop and read the solution.
Those are practice targets, not proof of skill. The point is to cap the time you lose on one problem.
Target time by difficulty
| Difficulty | First month | After steady practice | In a real interview |
|---|---|---|---|
| Easy | 30 to 45 minutes | 10 to 20 minutes | 10 to 15 minutes |
| Medium | 60 to 90 minutes | 25 to 45 minutes | 20 to 25 minutes |
| Hard | 2 hours or more | 45 to 75 minutes | Rarely asked alone |
The interview column is the one that matters. A 45 minute round usually holds one medium, or two problems if one is easy.
Candidates report that phone screens often pack two questions into 45 minutes. That leaves about 20 minutes each, including the explanation.
The stopping rule
Sitting on one problem for three hours teaches very little. Use a timer and a fixed limit.
- Spend 5 minutes reading the question and writing the input, the output and the edge cases.
- Spend 10 minutes finding an approach. Say it out loud before you type.
- Code it. If the whole attempt passes your target time, stop.
- Read the solution, understand it, then close it and write the code yourself.
- Add that problem to a list and redo it after one week.
Step 5 is the one most people skip. Re-solving a problem a week later is what moves it into memory.
Time yourself the way the interview does
Practice with no editor help. Turn off autocomplete, run nothing until you have finished writing, then test by hand.
The gap between untimed practice and a real round is usually 10 to 15 minutes per problem. Timed practice closes it.
How long it takes to get good
Most people need three to six months of daily practice. Mediums start to feel steady near the end of that range.
The starting point changes the number more than anything else.
| Starting point | Daily time | Time to feel steady on mediums |
|---|---|---|
| Strong data structures background | 1 hour | 6 to 10 weeks |
| Working engineer, rusty on algorithms | 1 to 2 hours | 3 to 4 months |
| Self taught, new to algorithms | 2 hours | 5 to 8 months |
Daily beats long weekend sessions. One hour every day teaches more than seven hours on a Sunday.
Progress is not smooth. Mediums feel impossible for several weeks, then a group of them becomes easy at once, because one pattern unlocked them all.
How many problems do you need
You do not need to finish the site. The library holds more than 3,000 problems and no interview covers that range.
Between 150 and 250 well chosen problems is the usual range, as long as you cover the patterns rather than picking at random.
| Goal | Problem count | Focus |
|---|---|---|
| A single upcoming interview | 75 to 100 | The most common patterns only |
| A broad job search | 150 to 250 | Every pattern, with repeats |
| Steady long term skill | 300 or more | Add contests and harder graph work |
Fifteen patterns cover most questions. The largest share goes to sliding window, two pointers, and fast and slow pointers. Merge intervals, binary search, top k elements, trees, graphs and dynamic programming cover most of the rest.
How long is a LeetCode contest
A weekly contest runs for 90 minutes and holds four problems. Biweekly contests use the same format.
The problems get harder in order. Solving two inside the time is a solid result for most people.
Contests are useful for one thing above all. They train you to produce a working answer under a clock, which is exactly what an interview asks.
How to Prepare
- Practice by pattern, not by number. Grokking the Coding Interview groups problems by the approach they share, so each one teaches the next.
- Start with the shortest list. Grokking the 75 Top Coding Interview Questions is the right choice when the interview is a few weeks away.
- Fix the base first. If arrays, maps and trees feel slow, Grokking Data Structures for Coding Interviews is faster than grinding mediums.
- Add a clock and a listener. A mock interview measures the part a solo timer cannot, which is your explanation.
- Plan the course time too. See how long it takes to finish a Grokking course before you set a study schedule.

GET YOUR FREE
Coding Questions Catalog

$99

$197

$72