We use cookies for site analytics. Accept to help us understand how the site is used. See our Privacy Policy for details.
Test your C++ knowledge with questions on memory management, STL, templates, RAII, smart pointers, and modern C++ features.
Memory management (new/delete, smart pointers), STL containers and algorithms, templates, RAII, copy/move semantics, virtual functions and polymorphism, operator overloading, and modern C++ features (auto, lambda, range-based for, constexpr). For game dev, also know memory pools and cache optimization.
Companies working on performance-critical software: game studios (Epic, Blizzard), trading firms (Citadel, Two Sigma), embedded systems companies, browser teams (Chrome, Firefox), and companies building databases, compilers, or operating systems. Google and Meta also use C++ extensively.
unique_ptr has sole ownership and is the default choice. shared_ptr uses reference counting for shared ownership. weak_ptr breaks circular references with shared_ptr. Use unique_ptr unless you genuinely need shared ownership. Avoid raw new/delete in modern C++.
Resource Acquisition Is Initialization ties resource lifetime to object lifetime. Resources (memory, files, locks) are acquired in constructors and released in destructors. This guarantees cleanup even when exceptions occur. RAII is the foundation of safe C++ resource management.
Copy creates a duplicate of data (expensive for large objects). Move transfers ownership of resources without copying (cheap - just pointer swaps). Move semantics were introduced in C++11 with rvalue references (&&) and std::move. They dramatically improve performance for containers and return values.
Templates enable generic programming - writing code that works with any type. Function templates and class templates are instantiated at compile time for each type used. Template specialization handles specific types differently. Modern C++ adds concepts (C++20) to constrain template parameters.