Getting everything ready for you…

Loading courses, problems and your progress. This takes just a moment.

0s

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:

  1. Basics — loops, patterns, digit problems, simple math
  2. Arrays — traversal, prefix sums, two pointers
  3. Strings — character counting, palindromes, anagrams
  4. Hashing — maps and sets for O(1) lookups
  5. Sorting and binary search
  6. Recursion and backtracking
  7. Linked lists, stacks and queues
  8. Trees and binary search trees
  9. Heaps
  10. Graphs — BFS, DFS, shortest paths
  11. Greedy
  12. 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:

  1. Read it twice. Write down the input, output and constraints.
  2. Work through the examples by hand. Most ideas come from doing this.
  3. 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.
  4. Still stuck? Open the first hint only, and try again for 10 minutes.
  5. Then read the approach, close it, and write the code yourself.
  6. 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:

"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

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