Sefism early access is open for X and Instagram followers and university students.Get early access
Learning and skills

How do I start DSA when I cannot solve problems and never know which approach to use?

Tauseef Fayyaz

Answered by Tauseef Fayyaz

Asked 9 timesUpdated 15 Sept 2026
Short answer

Stop solving random problems. Learn one data structure at a time, then study problems by pattern so each question points you to an approach. Two focused hours on weekdays for eight to ten weeks, with re-solving and spaced review, is enough to go from stuck to steady.

What people tell me

I know a programming language, but when I open a LeetCode problem I have no idea where to start, and even after reading solutions I cannot tell which method a question needs. I want to know how many hours a day it takes to get comfortable in about two months. Honestly DSA also feels boring, and I am not sure whether I should focus on it or on development projects first.

A composite of the messages behind this question, with personal details left out.

Key takeaways

  • Being stuck at the start is normal. Pattern recognition is a learnable skill, not a talent you either have or lack.
  • Learn in this order: language basics, complexity, one data structure at a time, then patterns.
  • Solve 4 to 6 problems per pattern, then re-solve them a few days later without looking.
  • Around 2 hours on weekdays and 4 on weekends for 8 to 10 weeks covers the core for most people starting fresh.
  • Do DSA and development together: DSA for screening rounds, projects for proof and motivation.

Why it feels impossible at first

Almost everyone opens their first medium problem, stares at it, reads the solution, understands it, and then cannot solve the next one. That is not a sign you are bad at this. It happens because problem solving has two separate skills: knowing the tools (data structures and techniques) and recognising which tool a problem is asking for. Most beginners try to learn the second before the first, by grinding random questions.

Fix the order and it gets dramatically easier.

The learning order that works

  1. Language fluency. Loops, conditions, functions, recursion, and your language's lists, sets, dictionaries or maps. If you still look up how to sort a list, start here.
  2. Complexity. Big O for time and space, well enough to compare two approaches.
  3. Core data structures, one at a time. Arrays and strings, hash maps and sets, linked lists, stacks and queues, trees, heaps, graphs.
  4. Patterns. Reusable approaches that map problem shapes to solutions.
  5. Mixed practice. Random problems only once patterns are familiar, so you practise recognition.

Patterns: how you know which method to use

A pattern is a signal in the problem statement that suggests an approach. Once you know around fifteen of them, most interview-style questions stop looking unfamiliar.

If the problem says or impliesTry this pattern
Sorted array, find a pair or tripletTwo pointers
Longest or shortest contiguous subarray or substringSliding window
Sorted input, or "minimum value that satisfies a condition"Binary search
Count or look up seen elements quicklyHash map or set
Next greater or smaller element, matching bracketsStack (monotonic stack)
Top K, K-th largest, merging sorted listsHeap
Shortest path in an unweighted grid or graphBFS
All paths, connected regions, tree traversalDFS
All combinations, permutations, subsetsBacktracking
Overlapping subproblems, "number of ways", min or max costDynamic programming
Detect a cycle, find the middle of a linked listFast and slow pointers
Overlapping ranges, meeting roomsSort then merge intervals
Dependencies, ordering of tasksTopological sort

Use the pattern and topic tags on LeetCode to find problems for each one, and curated lists such as Blind 75 or NeetCode 150 once you have the basics.

How to practise a single problem

  1. Read the problem, write two examples and one edge case.
  2. Spend up to 20 minutes trying. Write the brute-force approach even if it is slow.
  3. If stuck, read only a hint or the approach, not the code, and try again.
  4. If still stuck, study the full solution until you can explain every line.
  5. Re-solve it from scratch after two or three days. This is the step most people skip, and it is where learning actually sticks.
  6. Keep a short note per problem: pattern, key insight, mistake you made.

How many hours, and for how long

For someone who knows a language but is new to DSA:

WeeksFocusWeekday timeWeekend time
1 to 2Complexity, arrays, strings, hash maps2 hours4 hours
3 to 4Two pointers, sliding window, binary search, stacks2 hours4 hours
5 to 6Linked lists, trees, BFS and DFS, heaps2 hours4 hours
7 to 8Backtracking, graphs, introductory dynamic programming2 hours4 hours
9 to 10Mixed timed practice and re-solving weak topics2 hours4 hours

If you are revising rather than starting fresh, you can compress this. The hours matter less than focus: two hours with your phone in another room beats five with notifications on.

DSA or development first?

Both, in parallel. Screening rounds at many companies still use problem solving, so ignoring it closes doors. But projects are what you talk about in interviews and what keep you motivated. A simple split works well: weekdays for DSA, weekends for your project, or the reverse if that suits your energy.

What to do when it feels boring

  • Track visible progress. A streak calendar or a list of patterns you now recognise turns vague effort into something you can see.
  • Practise with a friend and explain solutions to each other. Teaching is more engaging than reading.
  • Connect it to real code. When you use a hash map to fix a slow lookup in your project, DSA stops feeling abstract.
  • Keep sessions short and frequent. Boredom often means the session is too long, not that the subject is wrong for you.

If you are still stuck

The full list of problem shapes with worked reasoning is in Fifteen problem shapes and the move that solves each, and Choosing a data structure is choosing what to make cheap explains the thinking behind picking one. Roadmaps and practice resources are in the resource library. If consistency is the real issue, book a free 1:1 session and we can build a plan you will actually follow.

Was this answer helpful?

Ask your own

Your situation is not quite this one?

Members get written answers to their own questions, a roadmap built for them and feedback on their projects. Early access is open to X and Instagram followers and university students. Prefer to talk? A free call works too.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.

Follow along

New writing, resources and project ideas land here first.

More questions people ask

All questions