C++ Smart Pointer Interview Questions ( unique_ptr , shared_ptr , weak_ptr ) Senior interviews on smart pointers go well beyond "what is unique_ptr ?". Interviewers want to see that you understand ownership design, control-block mechanics, thread safety, performance costs, and the classic bugs. This set of 22 questions progresses from fundamentals to implementation-level topics, each with an interview-ready answer, explanation, and example. Fundamentals 1. What problem do smart pointers solve, and how do the three types differ? Smart pointers encode ownership in the type system and use RAII to release the resource automatically, including when exceptions are thrown. They largely eliminate manual delete , leaks, and double-frees. Type Ownership Copyable? Typical cost unique_ptr Exclusive (one owner) No (move only) Same as a raw pointer (with the default deleter) shared_ptr Shared (reference counted) Yes Control block + atomic reference counting ...
Top 15 C++26 Features C++26 is the first release since C++11 that changes what the language can do , not just how conveniently you write it. The ISO committee finished technical work on C++26 at its March 2026 meeting in London Croydon. The draft then moves through the ISO approval ballot and final editorial work toward publication. These are the 15 most important features, ordered by impact. The first three (reflection, contracts, std::execution ) are the headline features. Items 4 and 5 are the big safety wins. The rest are the language and library additions you are most likely to use or be asked about. A note on compiler support: implementations are still catching up, and some items below are only partially available. GCC 16 is reported to support most of the C++26 features, but check the cppreference C++26 compiler support table for the exact toolchain you ship on. The code below follows the final design, but small syntax details may differ from what your compiler accept...