Skip to content
TeachTrails

Free learning path

DSA roadmap for beginners (2026)

Most people quit DSA because they start with random LeetCode problems. This roadmap goes in the order topics depend on each other: first how to judge a solution, then the core data structures, then the 12 patterns that most interview questions use. Each step links to a free lesson with a live demo and code in Python, Java and C++.

⏱ About 12–16 weeks at an hour a day6 stagesUpdated 17 November 2026
  1. Stage 1: Measure your code

    Week 1

    Goal: Tell a fast solution from a slow one before you write it.

    Learn

    Practise

    For every loop you write this week, say its Big O out loud.

    You're ready to move on when

    ✅ You can explain why binary search is O(log n) and a nested loop is O(n²).

  2. Stage 2: Recursion and sorting

    Weeks 2–3

    Goal: Think in smaller copies of the same problem.

    Learn

    Practise

    Write merge sort from memory, then trace it on a 6-number array.

    You're ready to move on when

    ✅ You can draw the call stack for a recursive function without running it.

  3. Stage 3: Linear data structures

    Weeks 3–5

    Goal: Know which structure fits which job.

    Learn

    Practise

    Solve 5 easy problems per structure (reverse a list, valid parentheses, two sum).

    You're ready to move on when

    ✅ Given a problem, you can say why a hash map or a stack would help.

  4. Stage 4: Trees, graphs and DP basics

    Weeks 5–8

    Goal: Handle data that branches, and stop recomputing the same answer.

    Learn

    Practise

    Tree traversals in 3 orders, BFS on a small graph, and climbing stairs with memoisation.

    You're ready to move on when

    ✅ You know when to use BFS instead of DFS, and can turn a recursive solution into DP.

  5. Stage 5: The interview patterns

    Weeks 8–14

    Goal: Spot the pattern from the wording of a question.

    Learn

    Practise

    3–5 problems per pattern. After each one, write down the words in the question that gave the pattern away.

    You're ready to move on when

    ✅ You can name the pattern for a new medium problem within a minute.

  6. Stage 6: Test and revise

    Weeks 14–16

    Goal: Make it stick under interview pressure.

    Learn

    Practise

    Take the 30-question pattern challenge, then redo the patterns you missed.

    You're ready to move on when

    ✅ You score 25+ on the challenge and can explain your approach before coding.

Mistakes that slow beginners down

Grinding problems without patterns

500 random problems teach less than 60 problems grouped by pattern. Learn the pattern, then practise it.

Switching languages

Pick one language and stay with it. Interviewers care about your logic, not which language you use.

Reading solutions too early

Struggle for 20–30 minutes first. If you look, close it and solve it again the next day.

Skipping Big O

Every interviewer asks for the complexity. It's one day of study and you'll use it in every answer.

Frequently asked questions

How long does it take to learn DSA?

About 3–4 months at an hour a day to be interview-ready for most product companies. Faster if you already code daily, slower if you're also learning to program.

Which language is best for DSA?

Any mainstream one: Python, Java or C++. Python is shortest to write, C++ is common in competitive programming, Java is common in Indian college placements. Every TeachTrails lesson has code in all three.

How many LeetCode problems should I solve?

Around 150–250 well-chosen problems is enough for most interviews, if they cover every pattern. Quality and review matter more than the count.

Is DSA still worth learning with AI coding tools?

Yes. Interviews still test it, and you need it to judge whether AI-written code is fast and correct.

Is this roadmap free?

Yes. Every lesson is free. The first two lessons are open to everyone; enrolling (free) unlocks the rest and saves your progress.

Ready to start?

The course follows this roadmap lesson by lesson, with live demos and quizzes, and remembers where you left off.