Roadmap · Foundations
Competitive programming
Opens with creditsFor students who want to play competitive programming as a sport, on Codeforces, AtCoder and in ICPC, from a first contest to a regional with their university team. By the end you can write fast, correct C++ under a timer, recognise the standard techniques at your rating, learn from every contest by upsolving and play a five-hour team round with a plan.
By the end, you will be able to
- Write contest C++ with the STL from a template you know by heart, and read the constraints to pick a complexity before writing any code
- Recognise and implement the core techniques for your rating band: maths basics, greedy with proofs, binary search, prefix sums, graphs, DP and range structures
- Take part in rated contests regularly and upsolve the problem just above your level after each one
- Find your own bugs with edge cases, sanitizers and stress tests instead of guessing
- Play an ICPC-style five-hour team contest with clear roles, problem triage, penalty awareness and a tested team notebook
The path
10 stages, in the order to learn them. Open one to start.
1C++ for contestsSet up a compiler and a template, learn the STL containers and algorithms contests use every day, and learn to read constraints so you know what complexity you can afford.7 topics · ~3 weeks
- 1Reading constraints and time limitsEvery problem gives limits, such as n up to 2 * 10^5, and a time limit, usually one or two seconds.
- 2Compiler, editor and flagsInstall a C++ compiler, usually g++ (the GNU compiler), and an editor you like, such as VS Code.
- 3Your template and fast input and outputA template is the short file you start every problem from: one header that includes the whole standard library, a
long longalias, two lines for fast input… - 4Vectors, pairs and sortingA
vectoris a resizable array, the container you will use in almost every problem. - 5Sets, maps and priority queues
setandmapkeep elements sorted in a balanced binary search tree, so inserting, erasing and finding cost O(log n). - 6STL algorithms you will use weeklyThe standard library already has functions for most small jobs.
- 7Integer overflow and choosing typesAn
intholds values up to about 2.1 * 10^9, and along longup to about 9.2 * 10^18.
7 in this stageOpen this stage2Maths basicsLearn the number theory easier contests use: modular arithmetic, gcd, primes and divisors, fast powers, and spotting invariants such as parity.6 topics · ~3 weeks
- 1Modular arithmeticWhen an answer is enormous, a problem asks for it modulo a number, usually 10^9 + 7 or 998244353.
- 2GCD, LCM and Euclid's algorithmThe greatest common divisor (gcd) of two numbers is the largest number that divides both.
- 3Primes and the sieveA prime is a whole number above 1 whose only divisors are 1 and itself.
- 4Factorisation and divisorsEvery number splits uniquely into primes, its prime factorisation, such as 360 = 2^3 * 3^2 * 5.
- 5Fast exponentiationComputing a^e by multiplying e times is far too slow when e is 10^18.
- 6Parity and invariantsAn invariant is a quantity that an allowed operation never changes.
6 in this stageOpen this stage- Greedy and sortingLearn to make the locally best choice, prove it is safe with an exchange argument, and use sorting to turn messy problems into one pass. Build the habit of checking ideas with a brute force.6 topics · ~4 weeksOpens with credits
- Binary searchSearch sorted data with the STL, then learn the bigger idea: binary searching over the answer whenever a yes or no check only flips once.5 topics · ~3 weeksOpens with credits
- Prefix sums and two pointersAnswer range sums in O(1), apply many range updates in O(1) each, and walk two indexes through an array to count or find subarrays in linear time.5 topics · ~3 weeksOpens with credits
- GraphsStore graphs as adjacency lists, traverse them with BFS and DFS, treat grids and trees as graphs, and find weighted shortest paths with Dijkstra. At higher levels, add topological order and lowest common ancestors.6 topics · ~5 weeksOpens with credits
- Dynamic programmingLearn to define a state and a transition, fill a table in the right order and recognise the classic DP shapes: linear, grid and knapsack, then LIS, bitmask DP and DP on trees.5 topics · ~6 weeksOpens with credits
- Data structuresMeet disjoint set union, Fenwick trees and segment trees, understand what each is for, and write each once. You will use them properly after a few months of contests.5 topics · ~5 weeksOpens with credits
- Contest strategy and upsolvingTake part in rated contests regularly, spend contest time well, read verdicts correctly, find bugs with stress tests and learn from every contest by upsolving the problem just above your level.8 topics · ~4 weeksOpens with credits
- Team play and ICPCLearn how the ICPC works, from registration and eligibility to scoring, penalty time and the frozen scoreboard, and train as a team of three on one computer with roles, triage and a tested team notebook.7 topics · ~4 weeksOpens with credits
8 more stages, 47 more topics, free with an account.
You have seen the open stages of the Competitive programming roadmap. Every topic it covers is listed above, and an account opens the rest: what each topic means, a question to check yourself, the courses, the practice and Tauseef's advice for every stage. Early access is open: sign up and your account is active shortly after.
Everything here is free to learn from. A few things, like adding a roadmap, keeping a cheat sheet or asking Tauseef a question, use credits. You get 15 when you join, your first roadmap is free, and if you are learning seriously and run out, you can ask for more. Credits only make sure the platform goes to people who are actually learning.
Build a project
A finished project proves more than a certificate.
- Start with this oneintermediate1 semester · 2 to 3 studentsCompetitive Programming Training Tracker for University Clubs and ICPC Coaches
Build the tool your own club needs: contest history, upsolving backlogs and topic coverage from the Codeforces API
- Next.js or React
- Node.js or Python (FastAPI)
- PostgreSQL
- Codeforces public API
- Cron job or queue worker for syncing
Related on Sefism
Picked from the other libraries by shared topics.
Career questions
See all- Is DSA still worth learning when AI can write code?Yes, but for a different reason than before. AI can produce a sorting function; it cannot tell you whether your design will fall over at scale or whether the code it wrote is quietly quadratic. DSA teaches you to judge code, and many companies still test it. Learn the core patterns well, skip the endless grind.
- I understand tutorials but cannot build anything myself. Why does coding feel so different when I am alone?Tutorials train recognition, not production. When you follow along, someone else makes every decision. Building alone requires you to break a problem down and make choices, which is a separate skill. Build it with small projects, planning on paper first, and a rule to struggle before you look anything up.
- How many LeetCode problems are enough, and how do I practise them properly?For most junior and mid-level interviews, 150 to 250 well-understood problems, organised by pattern, are enough. The number matters far less than whether you can recognise the pattern, explain your approach aloud and solve a similar problem a week later without help.
Cheat sheets
See allStuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
- 1:1 Mentorship
- Fresh Graduate Mentorship
- Career Guidance
Brand deals, promos and partnerships: tauseeffayyaz@gmail.com