Free · PrepAce × Ceretle
The C++ STL for contests and interviews
A free 72-slide deck on the C++ standard library for contests and coding interviews: from iterators and vector growth to red-black trees, hashing, iterator invalidation and contest patterns, with an 8-level question bank and a 4-page cheatsheet. Every number in it was measured by compiling and running the code.
PDF · 72 slides · 1.6 MB · no sign-up
One example from the deck: 50,000 keys picked as multiples of the bucket count took 2,408 ms in an unordered_map with std::hash, and 2.3 ms with a randomised hash (measured on libc++).
Library mistakes it covers
if (m[k] == 0)quietly inserts k into the map.std::lower_bound(s.begin(), s.end(), x)on a std::set is O(n) per call; s.lower_bound(x) is O(log n).multiset.erase(x)removes every copy of x, not one.priority_queue<int, vector<int>, greater<int>>is a min-heap, even though greater sorts descending.
What's inside
- 1Complexity guarantees
- 2Iterators and ranges
- 3vector internals
- 4array, deque and list
- 5string and string_view
- 6stack, queue and priority_queue
- 7set and map (red-black trees, bounds, multiset)
- 8Hashing and anti-hash tests
- 9Algorithms
- 10Lambdas, utilities and bitset
- 11Iterator invalidation and choosing a container
- 12Contest patterns and a debugging lab
- 13The same structures in C++, Java and Python
- 14An 8-level exam bank
Plus a 4-page cheatsheet at the end.
After the deck
Practise free on Ceretle
Visualizers, problems and exam-style questions. Free account to save progress.
ceretle.space (opens in a new tab)Not sure what to prepare next?
Book a free 30-minute roadmap call (opens in a new tab)Live cohorts with mentors
DSA Interview Cohort
Starts Sun 3 Jan
₹12,999
See the DSA cohortSystem Design Cohort (LLD + HLD)
Starts Sun 3 Jan
₹19,999
See the System Design cohort