Skip to main content
Journey Uncommon Logo
JourneyUncommon
C++ · PRACTICE

C++ interview questions.

C++ gives direct control over memory and object lifetime. Almost every interview question is really a lifetime question.

523questions
82easy
235medium
206hard

Object lifetime and dangling references, move semantics, RAII, undefined behaviour, template instantiation, and virtual dispatch cost.

Where it shows up: Systems, trading, embedded, graphics, game engines, and performance-critical infrastructure.

Sample C++ questions

Twenty real C++ questions from the library, code snippet included. Nothing here is paraphrased for search engines. It is the same text a signed-in user sees.

Sign in to answer

Everything above is free to read. Answering needs a free account.

We keep the correct answer, the explanation and the scoring behind sign-in so the platform stays honest, which is why the answer options and the worked explanation for every C++ question stay behind a free account. Signing in is free and takes a few seconds.

C++ topics covered

58 distinct C++ topics are tagged across the library. These are the real topic labels stored on the questions, not a hand-written list.

  • perfect forwarding std::forward (25)
  • custom allocators (22)
  • SFINAE and enable_if (20)
  • multiple and virtual inheritance layout (20)
  • variadic templates (18)
  • shared_ptr and weak_ptr (16)
  • strict aliasing rules (16)
  • type traits library (15)
  • move semantics and rvalue refs (14)
  • rule of 5 and rule of 0 (14)
  • atomics and memory ordering (14)
  • copy elision RVO NRVO (14)
  • relaxed memory semantics (14)
  • structured bindings (13)
  • constexpr consteval constinit (13)
  • const correctness (12)
  • Itanium ABI and name mangling (12)
  • inlining and the as-if rule (12)
  • unique_ptr (11)
  • CRTP (11)
  • vtable and vptr layout (11)
  • ODR and linkage (11)
  • template metaprogramming (11)
  • fundamental types and auto (10)
  • optional variant any (10)
  • concepts basics (10)
  • vector basics (9)
  • undefined behavior catalog (9)
  • object lifetime and std::launder (9)
  • noexcept (8)
  • the C++ memory model (8)
  • exception unwinding cost (8)
  • sequencing and evaluation order (8)
  • constructors and destructors (7)
  • references vs pointers (6)
  • ranges library (6)
  • exception-safety guarantees (6)
  • false sharing and cache lines (6)
  • empty base optimization (6)
  • threads and async basics (6)
  • function and operator overloading (5)
  • classes and members (5)
  • STL algorithms sort find (5)
  • move-capture lambdas (5)
  • STL containers map set list (4)
  • string and string_view (4)
  • range-based for (3)
  • RAII basics (3)
  • nullptr and using aliases (2)
  • generic lambdas (2)
  • basic templates (2)
  • namespaces and headers (2)
  • enum and enum class (2)
  • C++ memory model (2)
  • shared_ptr weak_ptr (2)
  • iterators (1)
  • generic and move-capture lambdas (1)
  • Multiple inheritance layout (1)

Search and filter every C++ question

Difficulty