Last 30 Days
No notifications
You've covered syntax โ OOP โ memory โ templates โ STL โ modern features. The remaining skill is pattern fluency โ recognising which tool fits a problem in seconds. That comes from solving 200+ problems, not from reading.
| Block | What | Time |
| Warm-up | One Easy on LeetCode/HackerRank | 15 min |
| Focus | One Medium in a topic you're learning | 45 min |
| Reading | Editorial of yesterday's Medium | 15 min |
One hour, five days a week. That's enough.
1. LeetCode โ Best UI, best community editorials, interview-aligned. 2. HackerRank โ C++ track โ Beginner-friendly, language-specific. 3. Codeforces โ Real competitive programming, weekly contests. 4. AtCoder Beginner Contests (ABCs) โ Crystal-clear problem statements, gentle difficulty curve. 5. CSES Problem Set โ Hand-picked classic algorithms, no fluff.
| Week | Focus | Daily set |
| 1 | Arrays + strings | Two Sum, Best Time to Buy Stock, Reverse String, Valid Anagram |
| 2 | Hashmap + two-pointer | Group Anagrams, Top K Frequent, Move Zeroes, 3Sum |
| 3 | Sorting + binary search | Sort Colors, Search Insert, Find First/Last, Median of Two Arrays |
| 4 | Graph/Tree basics | BFS, DFS, Number of Islands, LCA |
Reaching the practice phase means you stop *learning the language* and start *thinking algorithmically in it*. C++ is a fantastic vehicle here โ fast enough that brute force often passes, expressive enough that elegant code is short.
#include <bits/stdc++.h>
using namespace std;int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n; cin >> n;
vector<int> a(n);
for (auto& x : a) cin >> x;
// ...
return 0;
}
includes the entire STL (g++ extension) โ fine for contests, avoid in production.sync_with_stdio(false) + cin.tie(nullptr) makes cin/cout ~10ร faster.# Day-to-day
g++ -std=c++20 -O2 -Wall -Wextra solution.cpp -o sol# Heavy debugging
g++ -std=c++20 -O0 -g -Wall -Wextra -fsanitize=address,undefined solution.cpp -o sol
-fsanitize=address,undefined is the killer flag โ catches buffer overruns, use-after-free, signed overflow at runtime.
1. Read it twice. Note inputs, outputs, constraints. Check if N โค 100 (any algorithm), 10โต (need O(n log n)), 10โธ (O(n) only).
2. Solve by hand on a tiny example. What pattern emerges?
3. Pick a data structure. Need fast lookup โ unordered_map. Need sorted โ set / priority_queue. Stack-like โ stack or vector::back().
4. Write & test on edge cases. Empty input, all same, all different, max constraint.
5. Read the editorial AFTER, even if you solved it. That's where you find the elegant solution and learn new patterns.
Phase A โ Fundamentals (50 problems)
โโโ Array / String manipulation
โโโ Hashmap counting
โโโ Two pointers
โโโ Sliding window
โโโ Prefix sumsPhase B โ Sorting & Searching (40 problems)
โโโ Sort + scan
โโโ Binary search on sorted array
โโโ Binary search on the answer
โโโ Heap / priority_queue (top-k)
Phase C โ Recursion & DP (60 problems)
โโโ Recursion โ memoization โ DP table
โโโ Knapsack family
โโโ LIS / LCS
โโโ Interval DP
Phase D โ Graphs (30 problems)
โโโ BFS / DFS
โโโ Topological sort
โโโ Union-Find (DSU)
โโโ Dijkstra (priority_queue)
Phase E โ Advanced (20 problems)
โโโ Segment tree / Fenwick (BIT)
โโโ Trie
โโโ Math (gcd / sieve / mod inverse)
โโโ String (KMP / Z / hashing)
int l = 0, r = n - 1;
while (l < r) {
if (arr[l] + arr[r] == target) return {l, r};
if (arr[l] + arr[r] < target) ++l;
else --r;
}int l = 0, best = 0, sum = 0;
for (int r = 0; r < n; ++r) {
sum += arr[r];
while (sum > limit) sum -= arr[l++];
best = max(best, r - l + 1);
}unordered_map<int, int> seen;
for (int i = 0; i < n; ++i) {
int need = target - arr[i];
if (seen.count(need)) return {seen[need], i};
seen[arr[i]] = i;
}queue<pair<int,int>> q;
vector<vector<bool>> visited(R, vector<bool>(C, false));
q.push({sr, sc}); visited[sr][sc] = true;const int dr[] = {-1, 1, 0, 0};
const int dc[] = { 0, 0,-1, 1};
while (!q.empty()) {
auto [r, c] = q.front(); q.pop();
for (int d = 0; d < 4; ++d) {
int nr = r + dr[d], nc = c + dc[d];
if (nr < 0
nr >= R nc < 0
nc >= C) continue;
if (visited[nr][nc]) continue;
visited[nr][nc] = true;
q.push({nr, nc});
}
}function<void(int)> dfs = [&](int u) {
visited[u] = true;
for (int v : adj[u]) if (!visited[v]) dfs(v);
};priority_queue<pair<long,int>, vector<pair<long,int>>, greater<>> pq;
vector<long> dist(n, LLONG_MAX);
dist[src] = 0;
pq.push({0, src});
while (!pq.empty()) {
auto [d, u] = pq.top(); pq.pop();
if (d > dist[u]) continue;
for (auto [v, w] : adj[u]) {
if (dist[u] + w < dist[v]) {
dist[v] = dist[u] + w;
pq.push({dist[v], v});
}
}
}vector<int> memo(n + 1, -1);
function<int(int)> dp = [&](int i) -> int {
if (i <= 1) return i;
if (memo[i] != -1) return memo[i];
return memo[i] = dp(i - 1) + dp(i - 2);
};| Title | Why |
| A Tour of C++ by Bjarne Stroustrup | Author's own modern overview, ~200 pages |
| Effective Modern C++ by Scott Meyers | 42 items, every modern feature explained with pitfalls |
| C++ Primer by Lippman et al. | Comprehensive language reference |
| Competitive Programmer's Handbook by Antti Laaksonen | Free PDF, every CP topic with C++ examples |
| CppReference.com | The reference. Bookmark it. |
leetcode-solutions. One file per problem.| Direction | Next steps |
| Game / graphics | Learn OpenGL or Vulkan, ECS patterns, math (linalg, quaternions) |
| Embedded | ARM Cortex toolchains, no-heap C++ subset, RTOS |
| HFT / quant | Lock-free data structures, low-latency I/O, profiling |
| Compilers | LLVM, Clang AST tools |
| Systems | Linux kernel API, ZeroMQ, Folly, Boost |
1. Solve a problem on your own. 2. Read the editorial โ even if you solved it. 3. Solve the same problem again, the editorial's way.
That third step is where the patterns lodge. Skip it and you re-invent the wheel forever.
You finished the C++ track. Build something โ a small game, a CLI tool, an HTTP server. Real projects compress months of practice into weeks. Good luck. ๐