To learn DSA from scratch, get comfortable with one language, learn Big O basics, then study topics in a fixed order from arrays to dynamic programming. Spend one to two weeks per topic and solve problems in each before moving on. Most fresher placement tests focus on the first half of the list, so you can start applying before you finish everything.
This guide gives the topic order, what to master in each topic, a 16-week plan and links to practice on our site.
Before you start DSA
You are ready to begin DSA when you can do these in your chosen language without searching:
- Write loops, conditions and functions
- Work with arrays and strings: read, update, loop through
- Write a simple class with fields and methods
- Read input and print output in the format a test asks for
If not, spend two to four weeks on the basics first. Number and string problems such as reverse a number without using strings and count the vowels and consonants in a string are good warm-ups.
Pick one language and stay with it. Java, C++ and Python all work. Know its built-in structures: lists or arrays, maps, sets, and a stack or queue.
Learn Big O first, briefly
Big O tells you how running time grows as input grows. You need it to judge whether a solution will pass a test's time limit.
| Big O | Name | Example |
|---|---|---|
| O(1) | Constant | Reading an array element by index |
| O(log n) | Logarithmic | Binary search on a sorted array |
| O(n) | Linear | One loop through an array |
| O(n log n) | Linearithmic | Efficient sorting such as merge sort |
| O(n²) | Quadratic | Two nested loops over the same array |
You do not need formal proofs. You need to look at your code and say roughly how it grows. Our DSA guide explains this with examples.
The DSA topic order
Learn in this order. Each topic uses ideas from the ones before it.
| # | Topic | What to master | Placement weight |
|---|---|---|---|
| 1 | Arrays | Traversal, prefix sums, in-place changes | Very high |
| 2 | Strings | Character counts, reversing, palindromes, substrings | Very high |
| 3 | Hashing (maps and sets) | Frequency counts, fast lookups, duplicates | Very high |
| 4 | Sorting and binary search | Bubble, selection, insertion, then merge and quick sort; binary search and its variants | High |
| 5 | Two pointers and sliding window | Pairs in sorted arrays, longest or shortest subarray | High |
| 6 | Recursion and backtracking | Base case, recursive case, subsets, permutations | Medium to high |
| 7 | Stacks and queues | Brackets, next greater element, queue using stacks | High |
| 8 | Linked lists | Reverse, find middle, detect a cycle, merge | Medium to high |
| 9 | Trees and binary search trees | Traversals, height, BST insert and search | Medium |
| 10 | Heaps (priority queues) | Top k elements, merging sorted lists | Medium |
| 11 | Graphs | Representation, BFS, DFS, connected parts | Medium, higher for product companies |
| 12 | Dynamic programming | Breaking into overlapping subproblems; 1D, then 2D | Mostly product companies |
"Placement weight" is a rough guide to how often a topic shows up in fresher coding tests and interviews. Services company tests lean on topics 1 to 7. Product company interviews often go through all twelve.
Pro tip: For each topic, first learn how it works and the cost of its main operations, then solve 3 easy problems, then medium ones. Do not jump to hard problems before easy ones feel routine.
How to study one topic
Use the same cycle for every topic:
- Learn the idea (day 1). Read or watch one explanation. Draw it on paper.
- Implement it yourself (day 1 to 2). For example, write binary search or reverse a linked list without copying.
- Solve easy problems (days 2 to 5). Five to eight problems.
- Solve medium problems (days 5 to 10). Five to ten problems. Struggle 20 to 30 minutes before a hint.
- Review (last day). Re-solve the problems you could not do alone. Write a short note on the patterns you saw.
For the method to read and break down each problem, see how to improve problem-solving skills for coding.
Practice problems on our site, by topic
| Topic | Problems to start with |
|---|---|
| Arrays | Second largest element, move all zeros to the end, Kadane's algorithm |
| Strings | Check anagrams, first non-repeating character |
| Hashing | Two sum, frequency of each element |
| Sorting and searching | Binary search, merge sort |
| Two pointers | Merge two sorted arrays, pair with a given sum |
| Recursion | Tower of Hanoi |
| Stacks | Valid parentheses |
| Linked lists | Reverse a linked list |
Browse the full Problems section for more in each topic.
The 16-week DSA study plan
This plan assumes one to two hours on college days and a little more on free days.
| Weeks | Topic | Target by the end |
|---|---|---|
| 1 | Language check and Big O | 10 basic programs; explain the Big O of each |
| 2 to 3 | Arrays | 20 problems; prefix sums used at least twice |
| 4 | Strings | 15 problems |
| 5 | Hashing | 15 problems using a map or set |
| 6 to 7 | Sorting and binary search | Write merge sort and binary search from memory; 15 problems |
| 8 | Two pointers and sliding window | 12 problems |
| 9 | Recursion and backtracking | 10 problems; draw the call tree for 3 |
| 10 | Stacks and queues | 12 problems |
| 11 | Linked lists | 10 problems; reverse a list from memory |
| 12 to 13 | Trees and BST | 15 problems; all four traversals from memory |
| 14 | Heaps and graphs (BFS, DFS) | 10 problems |
| 15 | Dynamic programming basics | 8 classic 1D problems |
| 16 | Mixed timed practice | Two timed sets of 2 problems in 60 minutes |
If you are targeting services companies soon, you can start taking their tests after week 10 and continue the rest alongside. If you are in third year, see how to prepare for placements in third year for how DSA fits with projects and internships.
Common mistake: Restarting DSA from arrays every time you take a break. Keep a progress sheet. When you return, re-solve five old problems to warm up, then continue from where you stopped.
Keep a mistake log
The fastest way to improve is to study your own mistakes. Keep a sheet with these columns:
| Problem | Topic | What went wrong | Fix or pattern | Re-solve date |
|---|
Before every mock test, read this log instead of new material.
Preparing for the interview side
Coding tests check whether your code passes. Interviews also check whether you can explain it. For each topic, be ready to answer:
- How does this structure work, and what is the time of insert, search and delete?
- When would you use it instead of another one? For example, array vs linked list or stack vs queue.
- What is the time and space of your solution, and can you improve it?
Our DSA interview questions page covers the common theory questions.
Where this fits in placement preparation
DSA is one part of placement preparation, next to aptitude, projects, CS fundamentals and communication. For a final-year schedule that combines them, see the placement preparation roadmap for 2027. Start DSA today with one topic and one problem. Progress comes from showing up daily, not from finding the perfect list.
Picking a language for DSA? Read Python vs C++ for placements before you start.

