C++ Quizzes
Test your C++ knowledge with our quiz questions. Practice writing code for pointers, memory management, and using the standard library. These quizzes help your understanding of C++ basics and will prepare you for building fast, efficient programs.
About C++ Quiz
Each C++ quiz consists of multiple questions, each with three to four possible answers. Only one answer is correct for each question. Select the answer you believe is correct, then click the "Check My Answers" button to see your results.
If you answer at least 75% of the questions correctly, you pass the quiz! This indicates you have a solid understanding of C++ concepts and are ready to advance to more challenging topics.
After submitting your quiz, you'll receive immediate feedback with detailed explanations for each question. This helps you understand not just what the correct answer is, but why it's correct—reinforcing your learning and helping you master C++.
Quick Tips
- Read each question carefully before selecting your answer
- Review the code examples when provided
- You can retake quizzes as many times as you want
- Sign in to save your progress and track your performance
Available Quizzes
Basics
40 in-depth questions covering C++ fundamentals, program structure, input/output operations, comments, compilation process, and exit codes — with 10 code examples to solidify understanding.
Variables & Data Types
40 in-depth questions covering C++ fundamental types, type modifiers, auto inference, type ranges, literals, and initialization patterns — with 10 code examples to solidify understanding.
Operators & Expression
40 in-depth questions covering C++ arithmetic, comparison, logical operators, compound assignments, and precedence rules — with 10 code examples to solidify understanding.
Control Flow
40 in-depth questions covering C++ control flow statements including conditional execution, loops, and flow control mechanisms — with 10 code examples to solidify understanding.
Function
40 in-depth questions covering C++ function fundamentals including declaration, parameters, overloading, passing mechanisms, and inline functions — with 10 code examples to solidify understanding.
Arrays & Strings
40 comprehensive questions on C++ arrays and strings, covering fixed-size arrays, C-style strings, std::string fundamentals, string operations, and array iteration patterns — with 20 code examples to master memory management and string handling.
Pointer
Master the fundamentals of C++ pointers including declaration, dereferencing, null pointers, pointer arithmetic, and advanced concepts like pointers to arrays and pointers to pointers.
References
Explore C++ references including binding rules, differences from pointers, const references, returning references, and reference lifetime management for safe and efficient code.
Dynamic Memory
Comprehensive C++ quiz exploring dynamic memory management including new/delete operators, array allocation, memory leaks, dangling pointers, and the motivation for smart pointers in modern C++.
Structs & Basic Classes
Comprehensive C++ quiz exploring fundamental object-oriented programming concepts including struct vs class differences, member variables, methods, access specifiers, and object initialization patterns.
Constructors & Destructors
40 in-depth questions covering C++ constructors and destructors, including default/parameterized constructors, initializer lists, copy/move constructors, and RAII concepts — with 16 code examples to master object lifecycle management.
Operator Overloading
35 in-depth questions covering C++ operator overloading, including arithmetic operators, comparison operators, stream operators, assignment rules, and best practices — with 16 code examples to master operator design and pitfalls.
The Standard Template Library (STL)
40 in-depth questions covering C++ STL fundamentals including std::vector, std::map, std::unordered_map, std::pair, std::tuple, std::set, and best practices for containers — with 16 code examples to master STL usage and pitfalls.
Iterator
40 in-depth questions covering C++ iterator fundamentals including iterator categories, STL container usage, begin/end patterns, reverse iterators, and iterator invalidation rules — with 16 code examples to master iterator-based programming.
OOP: Inheritance
40 in-depth questions covering C++ inheritance fundamentals including base and derived classes, protected members, method overriding, final and override keywords, and inheritance best practices — with 16 code examples to master object-oriented inheritance patterns.
OOP: Polymorphism
40 in-depth questions covering C++ polymorphism fundamentals including virtual functions, pure virtual functions, abstract classes, virtual destructors, and dynamic dispatch — with 16 code examples to master runtime polymorphism patterns.
Templates & Generics
40 in-depth questions covering C++ template fundamentals including function templates, class templates, template type deduction, non-type template parameters, and generic programming style — with 16 code examples to master compile-time polymorphism patterns.
Exception Handling
40 in-depth questions covering C++ exception handling mechanisms, try/catch/throw blocks, exception types, stack unwinding, custom exceptions, and noexcept specification — with 16 code examples to solidify understanding.
File I/O
40 in-depth questions covering C++ file input/output operations, stream classes, text and binary file handling, error checking, and RAII patterns — with 16 code examples to solidify understanding.
Smart Pointer
40 in-depth questions covering C++ smart pointer types, ownership semantics, memory management, and cyclic reference avoidance — with 16 code examples to solidify understanding.
Move Semantics & Perfect Forwarding
40 in-depth questions covering C++ move semantics, rvalue references, move constructors, std::move, perfect forwarding with std::forward, and performance considerations — with 16 code examples to solidify understanding.
Lambda Expressions
40 in-depth questions covering C++ lambda expressions, capture lists, mutable lambdas, returning lambdas, storing lambdas in std::function, and lambda recursion techniques — with 16 code examples to solidify understanding.
Concurrency
40 in-depth questions covering C++ concurrency with std::thread, thread synchronization, mutex types, condition variables, and race condition avoidance — with 16 code examples to solidify understanding.
Async & Futures
40 in-depth questions covering C++ async programming with std::async, std::future, std::promise, task-based concurrency, and custom thread pool patterns — with 16 code examples to solidify understanding.
Memory Management Deep Dive
40 in-depth questions covering advanced C++ memory management with custom allocators, memory pools, RAII patterns, and cache-friendly programming — with 16 code examples to solidify understanding.
Advanced Templates
40 in-depth questions covering advanced C++ template metaprogramming with SFINAE, variadic templates, constexpr, and compile-time computation — with 16 code examples to solidify understanding.
