Interview Compendiums
The Modern C++ and STL Interview Compendium
Interview Questions and Answers for Modern C++ Developers
A practical interview reference covering Modern C++ language features, STL usage, concurrency, and performance.
About this book
The Modern C++ and STL Interview Compendium is a question-and-answer reference for developers preparing for C++ interviews, and for anyone who wants to explain what modern C++ does and what it costs rather than only use it. It contains more than nine hundred questions across twenty-four chapters, and each answer goes past the definition to the mechanism behind it and the trade-off it carries, so that readers can reason about a question they have not seen before instead of reciting a memorized reply.
The core of the book, Chapters 2 through 14, covers language fundamentals, memory management and RAII, pointers, references, and value categories, object-oriented C++, templates, STL containers and iterators, algorithms and ranges, strings and regular expressions, exceptions and error handling, concurrency, metaprogramming, design patterns, and performance and low-level optimization. Chapter 1 is a short orientation to the language's standards, from C++98 through the C++26 cycle. Chapters 15 through 20 turn to engineering practice and reference: build systems and linking, testing and debugging, standard-library utilities, migration and modernization, a set of decision guides, and a deeper STL reference. The last four chapters look at where C++ earns its place, in games and high-performance computing, parallelism and accelerators, systems and distributed engineering, and embedded and real-time work, and they ask as often when not to use C++ as when to use it.
Most chapters open with core questions, continue with questions labeled Beginner, Intermediate, or Advanced, and close with senior-level scenarios: what is wrong with a piece of code, which option to choose and why, and how to debug a specific failure. In Chapters 2 through 14 the listings are mostly complete programs that can be compiled and changed, while the later chapters lean on decision tables and shorter fragments. The book covers the standards from C++11 through C++23 and treats C++26 as a direction rather than a portable default.
Readers come away able to say who owns an object and how long a borrowed reference stays valid, to explain move semantics and value categories, to choose among containers and algorithms on locality and invalidation as well as complexity, and to reason about the memory model, data races, and safe shutdown. They should also be able to design a benchmark that measures what it claims, interpret a sanitizer report, explain how ABI boundaries affect a shared library, and describe how to modernize a legacy codebase in stages.
It is written for developers who already work in C++, from mid-level engineers preparing for senior interviews to developers arriving from managed languages, and it is not a first tutorial. The chapters can be read in order or consulted by topic, which makes the book useful both as a study plan and as a reference before a technical interview.
More books
-
Interview Compendiums
The React and TypeScript Interview Compendium
Interview Questions and Answers for React and TypeScript Developers
-
Interview Compendiums
The Python and Django Interview Compendium
Interview Questions and Answers for Python and Django Developers
-
Interview Compendiums
The Java and Spring Boot Interview Compendium
Interview Questions and Answers for Java and Spring Boot Developers