On this page
If you are starting data structures and algorithms (DSA) for college coding rounds or a computing olympiad, the usual mistake is doing everything at once: mixed problems, a new topic every evening, and the solution opened the moment you get stuck. Learn one structure at a time, solve problems on it in order of difficulty, and treat the problems you could not solve as your real syllabus.
How do you start data structures and algorithms practice?
Pick one language and stay with it. Python, C++ and Java all work.
A sensible order follows the way university courses build up. MIT's 6.006 Introduction to Algorithms (Spring 2020) moves from data structures and sorting to hashing, binary trees, binary heaps, breadth-first and depth-first search, shortest paths, and then four lectures on dynamic programming.
What order should you learn data structures in?
Here is an eight-week version for a school or first-year college student with about an hour a day:
Week 1: arrays and strings (indexing, two pointers, prefix sums)
Week 2: hashing (sets and maps, counting frequencies)
Week 3: stacks and queues
Week 4: sorting and binary search
Week 5: binary trees and recursion
Week 6: heaps and priority queues
Week 7: graphs (breadth-first and depth-first search)
Week 8: dynamic programming
After week 8, switch to mixed sets so you learn to spot which structure a problem needs; our plan for interleaved practice explains why.
How hard should your first problems be?
Split every week into three rungs. Rung 1 is direct use: build the structure or use it exactly as taught. Rung 2 adds a short twist, such as using a stack to check whether brackets are balanced. Rung 3 asks you to notice that the structure applies at all.
The CSES Problem Set groups its problems by topic, starting with introductory problems and sorting and searching, followed by sections such as dynamic programming and graphs. Most weeks, aim for four or five rung 1 problems, three rung 2 problems and one or two rung 3 problems.
What should you do with a problem you could not solve?
Struggling before you are shown the method can help: a 2021 meta-analysis in Review of Educational Research by Tanmay Sinha and Manu Kapur pooled 53 studies with 166 comparisons and found a moderate advantage (Hedges' g = 0.36) for problem solving followed by instruction over instruction followed by problem solving. It covered learning new concepts generally, not coding, and for the youngest learners (second to fifth graders) and for domain-general skills the results favoured instruction first. Take this as a reason to try first, not a promise.
So give each problem a fixed time box, say half an hour of honest effort, before you look at hints. Then read the solution actively. In a classic 1989 study in Cognitive Science, Michelene Chi and colleagues found that the more successful students, studying worked mechanics examples, generated many explanations of the solution steps and related them to principles in the text, while weaker students explained less and relied more on the examples. For code, that means asking of every line: why is this here, and what breaks if I remove it?
Finally, close the solution and write it again from a blank file a few days later. In Roediger and Karpicke's 2006 experiments, students who took recall tests remembered prose passages better 2 days and 1 week later than students who restudied them, even though restudying made them more confident and did better on a test given after 5 minutes. Re-solving is a recall test for code.
Sometimes the gap is not the problem but the idea under it, such as why recursion on a tree works. The Fermi Concept Library has a lesson for each concept in computing as well as mathematics and the sciences, so you can fix the idea before going back to the problem.
Worked example: one week on stacks
Day 1: learn push, pop and peek, and code a stack with a list. Solve two rung 1 problems.
Day 2: two more rung 1 problems, then balanced brackets (rung 2).
Day 3: rung 2, such as the next greater element in an array. Write a card for anything unsolved.
Day 4: re-solve one Day 1 problem, then try one rung 3 problem.
Day 5: queues, with one rung 1 and one rung 2 problem.
Day 6: re-solve every card from this week from a blank file.
Day 7: rest, or one more rung 3 problem.
Cards you still cannot re-solve go into next week's Day 6.
Parents, you do not need to know code to help. Ask to see the cards rather than the solved count.
Aiming at campus jobs? See our placement preparation timeline for B.Tech students. Olympiad students can read moving from a computing olympiad to college competitive programming. If you are not sure where to begin, Fermi's AI tutor can work out what you already know and build a plan for the session.



