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++.
Stage 1: Measure your code
Week 1Goal: Tell a fast solution from a slow one before you write it.
Learn
- Big O Notation Graph & Examples, Explained SimplyPart 1 · 10 min · open to all
- Binary Search Algorithm ExplainedPart 2 · 9 min · open to all
- Pick one language and learn its arrays, strings and hash maps
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²).
Stage 2: Recursion and sorting
Weeks 2–3Goal: Think in smaller copies of the same problem.
Learn
- Recursion ExplainedPart 3 · 10 min · free with sign-in
- Sorting Algorithms ExplainedPart 4 · 11 min · free with sign-in
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.
Stage 3: Linear data structures
Weeks 3–5Goal: Know which structure fits which job.
Learn
- Linked List in Data StructurePart 5 · 11 min · free with sign-in
- Stack vs QueuePart 6 · 9 min · free with sign-in
- Hashing in Data StructurePart 7 · 11 min · free with sign-in
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.
Stage 4: Trees, graphs and DP basics
Weeks 5–8Goal: Handle data that branches, and stop recomputing the same answer.
Learn
- Binary Search TreePart 8 · 12 min · free with sign-in
- BFS vs DFSPart 9 · 12 min · free with sign-in
- Dynamic Programming for BeginnersPart 10 · 12 min · free with sign-in
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.
Stage 5: The interview patterns
Weeks 8–14Goal: Spot the pattern from the wording of a question.
Learn
- Two Pointers TechniquePart 11 · 10 min · free with sign-in
- Sliding Window Technique Explained SimplyPart 12 · 11 min · free with sign-in
- Prefix Sum ExplainedPart 13 · 10 min · free with sign-in
- Binary Search on AnswerPart 14 · 11 min · free with sign-in
- Fast and Slow PointersPart 15 · 9 min · free with sign-in
- Merge Intervals ExplainedPart 16 · 9 min · free with sign-in
- Monotonic Stack ExplainedPart 17 · 10 min · free with sign-in
- Heap and Top-K Problems ExplainedPart 18 · 10 min · free with sign-in
- Binary Tree PatternsPart 19 · 11 min · free with sign-in
- Grid BFS and Topological SortPart 20 · 12 min · free with sign-in
- Backtracking ExplainedPart 21 · 11 min · free with sign-in
- Dynamic Programming PatternsPart 22 · 12 min · free with sign-in
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.
Stage 6: Test and revise
Weeks 14–16Goal: Make it stick under interview pressure.
Learn
- Which DSA PatternPart 23 · 15 min · free with sign-in
- Timed mock interviews (45 minutes, talk while you code)
- Revisit every problem you got wrong
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.