Guides › DSA
How to Start DSA from Zero (and Not Quit After Arrays)
A beginner-friendly path into data structures and algorithms: which language, which order of topics, how many problems, and how to actually get better.
Almost everyone who starts DSA quits somewhere around arrays or recursion. Not because it is too hard, but because they start without a plan, pick problems that are too difficult, and measure themselves against people who have been practising for two years. This guide is the plan.
Step 1: Pick one language and stop worrying about it
C++, Java and Python are all fine for interviews.
| Language | Good because | Watch out for |
|---|---|---|
| C++ | Fast, STL is excellent for competitive programming | Pointers and syntax take time at first |
| Java | Very common in Indian placements, clear OOP | More typing; learn Collections well |
| Python | Short, readable code — fastest to write | Can be slow for heavy loops in contests |
If your college teaches one of them, use that. The important thing is to know your language's built-in data structures — dynamic arrays, hash maps, sets, stacks, queues and priority queues — before you start serious DSA.
Step 2: Understand Big-O before problem number one
You need just enough to answer "will my solution be fast enough?". A rough rule: a computer does about 10⁸ simple operations per second.
Input size n |
Solutions that usually pass |
|---|---|
| up to 10 | O(n!) — try every arrangement |
| up to 20 | O(2ⁿ) — try every subset |
| up to 500 | O(n³) |
| up to 5,000 | O(n²) |
| up to 10⁶ | O(n log n) or O(n) |
| larger | O(log n) or O(1) |
Reading the constraints tells you which approach the problem expects — this one habit saves hours.
Step 3: Learn topics in the right order
Each topic builds on the previous one:
- Basics — loops, patterns, digit problems, simple math
- Arrays — traversal, prefix sums, two pointers
- Strings — character counting, palindromes, anagrams
- Hashing — maps and sets for O(1) lookups
- Sorting and binary search
- Recursion and backtracking
- Linked lists, stacks and queues
- Trees and binary search trees
- Heaps
- Graphs — BFS, DFS, shortest paths
- Greedy
- Dynamic programming
The DSA roadmap breaks every one of these into sub-topics with what to learn, and the Codify DSA Sheet follows the same order.
Step 4: Use the 30-minute rule
For every problem:
- Read it twice. Write down the input, output and constraints.
- Work through the examples by hand. Most ideas come from doing this.
- Think for up to 30 minutes. If you have a brute-force idea, code it — a working slow solution teaches you more than a blank editor.
- Still stuck? Open the first hint only, and try again for 10 minutes.
- Then read the approach, close it, and write the code yourself.
- Re-solve it after 3 days without help. If you can't, it goes back on your list.
Every problem on Codify has step-by-step hints before the full solution, so you can follow this rule exactly. If you can't picture what an algorithm is doing, watch it run step by step in the Visualizer — sorting, binary search, linked lists and trees.
Step 5: How many problems is enough?
Quality beats count, but rough targets help:
- 150 problems done properly covers most service-company coding rounds.
- 250–300 problems, with a good share of Mediums, is a strong base for product companies.
"Done properly" means you can explain the approach and its complexity, not that you once pressed submit.
Step 6: Make it a daily habit
Thirty minutes every day beats five hours on Sunday. Solve the problem of the day, keep your streak alive on your dashboard, and join the weekly contest to practise under time pressure. Contests feel scary at first; after five or six, they become the most effective practice you do.
If a full contest feels like too much, start with a Code Battle: one problem, one opponent (a random coder or a friend), 15 minutes for Easy. It's the friendliest way to get used to solving with a clock running. And let the Study Planner decide which problems to do each day, so you never waste time choosing.
Common beginner mistakes
- Jumping to Hard problems to "challenge yourself". Easy problems build the pattern library that Hard problems rely on.
- Copying solutions without re-solving them. You will recognise the problem later but still not be able to solve it.
- Not dry-running code. Before submitting, trace your code on a small input with pen and paper.
- Ignoring edge cases: empty arrays, one element, all duplicates, negative numbers, integer overflow.
- Switching resources every week. Pick one sheet and finish it.
What next?
Once arrays, strings and hashing feel comfortable, read 12 DSA patterns that solve most interview questions — it will change how you look at new problems. For revision, the detailed notes on time complexity, arrays & two pointers, recursion and binary search have worked examples and practice lists.
More guides
- How to Use Codify: A 7-Day Start Plan — New here? Pick a roadmap, make a study plan, start the DSA sheet, revise with notes, practise for placements and test yourself — one step a day, then a daily routine.
- Infosys Preparation Guide: Online Test, Pseudocode and Interview — Roles (SE, DSE, SP), what each section of the Infosys online test checks, how to crack pseudocode and reasoning, a 4-week plan and the interview.
- Wipro Elite NLTH Preparation: Aptitude, Essay and Coding — The Wipro fresher test round by round — quant, logical and verbal, the written essay, two coding problems — plus a 3-week plan and interview tips.
- Accenture Preparation Guide: Cognitive, Technical, Coding and Communication — Every Accenture round explained — cognitive, MS Office/networking/cloud technical MCQs, pseudocode, coding and the spoken-English test — with a 4-week plan.