PrepAce

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.

Download the PDF (free)

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

What's inside

  1. 1Complexity guarantees
  2. 2Iterators and ranges
  3. 3vector internals
  4. 4array, deque and list
  5. 5string and string_view
  6. 6stack, queue and priority_queue
  7. 7set and map (red-black trees, bounds, multiset)
  8. 8Hashing and anti-hash tests
  9. 9Algorithms
  10. 10Lambdas, utilities and bitset
  11. 11Iterator invalidation and choosing a container
  12. 12Contest patterns and a debugging lab
  13. 13The same structures in C++, Java and Python
  14. 14An 8-level exam bank

Plus a 4-page cheatsheet at the end.

After the deck