Why Study with PlanetCert?
The Latest Questions
Practice questions and exam topics aligned with the current exam objectives.
Detailed Explanations
Go beyond the answer. Master the material with comprehensive learning and professional explanations for every concept.

AI-Powered Insights
Personalized preparation guidance that adapts to your performance and identifies weak spots automatically.
Exam Information
Official specifications published by C++ Institute
Exam Format
Registration
Validity
Skills this practice test covers
- Work out the value of an expression from operator precedence, associativity and promotion.
- Trace loops and switch statements, including fall-through and continue.
- Catch exceptions by type, and with a catch-all handler.
- Choose between passing an argument by value, by reference and by pointer.
- Manage dynamic memory with new, delete and delete[] without leaks.
- Build class hierarchies with constructors, virtual functions and access control.
Explore related topics
CPA-21-02 exam content
5 domains · 35 topics · 271 of 275 questions sorted by domain
Types & Operators24.5%67 questions
This domain covers the building blocks of every expression: the standard types and their ranges, literals, strings, aggregates, operators and conversions. Small details, such as precedence, promotion or the base of a literal, decide the value of an expression.
Skills tested
- Evaluate expressions with arithmetic, bitwise, logical and short-circuit operators.
- Read literals in decimal, octal, hexadecimal and binary form.
- Work with std::string methods such as compare(), size(), substr() and insert().
- Declare and use vectors, arrays, structures, unions and enums.
- Predict the result of type conversion, casting, promotion and sizeof.
Official topics
- Apply unary, binary, and ternary operators
- Operator usage
- Ternary conditional operator
- Data types and representations
- Literals
- String operations
- Aggregates
- Type conversions
- Declaration modifiers
Control & Exceptions18%42 questions
This domain covers how a program moves from one statement to the next, and what happens when something fails. Candidates trace if, switch and loop statements, including break, continue and goto, and handle errors with try, catch and throw.
Skills tested
- Trace while, do-while and for loops that use break and continue.
- Predict switch fall-through when a case has no break.
- Throw and catch exceptions, including with a catch-all handler.
- Recognize exception hierarchies and the throw() specifier in a function declaration.
Official topics
- Control flow statements
- Multiple-selection constructs
- Return statement
- Exception handling
- Exception hierarchies
Functions & Preprocessor Directives17.5%52 questions
This domain covers how functions are declared, called and overloaded, and what the preprocessor does before compilation. Candidates pass arguments in three ways, write recursive functions, and predict how macros expand.
Skills tested
- Pass arguments by value, by reference and by pointer, and predict the effect of each.
- Overload functions and set default parameter values without creating ambiguous calls.
- Write a recursive function with a base case and a recursive case.
- Declare main() with or without command-line arguments.
- Predict macro expansion, and control compilation with #if, #ifdef, #else and #endif.
Official topics
- Function basics
- Function types
- Function overloading
- Argument passing
- Recursion
- Main function
- Conditional compilation
- Macros
Pointers11%32 questions
Pointers hold memory addresses, and this domain tests working with them safely. Candidates declare and dereference pointers to variables, objects, functions and aggregates, use pointer arithmetic, and manage dynamic memory with new and delete.
Skills tested
- Declare and initialize pointers to variables, objects, functions and aggregates.
- Use the address-of and dereference operators correctly.
- Move through an array with pointer arithmetic, and compare pointers.
- Allocate memory with new, free it with delete or delete[], and avoid memory leaks.
Official topics
- Pointer declarations
- Pointer operations
- Pointer arithmetic
- Dynamic memory
Classes & Namespaces29%78 questions
The largest domain covers object-oriented C++. Candidates define classes with access specifiers, constructors and destructors, use inheritance and virtual functions for polymorphism, cast between class types, and organize code in namespaces.
Skills tested
- Define classes with access specifiers, the this pointer and the :: operator.
- Declare default, copy and explicit constructors, and destructors.
- Override virtual functions to get polymorphic behavior through a base class pointer.
- Cast between class types with static_cast and dynamic_cast.
- Use friend functions and classes, and named, anonymous and aliased namespaces.
Official topics
- OOP principles
- Class definition
- Constructors and destructors
- Overloading
- Inheritance
- Type casting
- Polymorphism
- Friend functions
- Namespaces
Requirements
- No formal prerequisites: anyone can book the exam.
- Recommended: entry-level C++ knowledge and a grasp of basic programming concepts.
- Recommended: a working knowledge of object-oriented ideas such as classes and inheritance.
- Recommended: completion of the C++ Essentials 2 course.
About the CPA-21-02 exam
CPA-21-02 checks the C++ rules that an associate-level programmer applies every day: how expressions are evaluated, how control flows, how functions and pointers pass data, and how classes model objects. The C++ Institute sets the exam for students and developers who already know basic programming and object-oriented ideas. Many objectives turn on exact language rules, such as operator precedence or which overload the compiler picks. Passing earns the C++ Certified Associate Programmer (CPA) certification, which does not expire.
The PlanetCert practice test leans hardest on classes and on types and operators, the two largest domains. The explanations matter most where one rule decides the answer, such as why a switch falls through to the next case, or why a base class needs a virtual destructor. Study Mode suits the pointer questions, which reward drawing memory on paper. Brainy AI Assistant can explain an ambiguous overload, or show why a macro without parentheses gives a surprising result.
How to earn the certification
- Earns
- C++ Certified Associate Programmer (CPA)Associate
The certification does not expire.
- After
- CPP C++ Certified Professional Programmer
The C++ Institute's professional-level exam and the next step in its C++ track.
- CPP C++ Certified Professional Programmer
How to prepare for CPA-21-02
- 1
Install a compiler and test every rule
Set up a standard C++ compiler and turn each syllabus rule into a tiny program. Running the code settles most doubts about precedence, promotion or overloads.
- 2
Draw memory for pointer code
Sketch each variable and pointer as a box with an address, then follow new, delete and pointer arithmetic step by step. The same habit helps with arrays, strings and objects in the other domains.
- 3
Spend the most time on classes
Classes & Namespaces carries the most weight. Write a small class hierarchy with constructors, a virtual destructor and an overridden function, then cast between the classes with static_cast and dynamic_cast.
- 4
Test macros and overloads at the edges
Write macros without parentheses and overloads that differ only slightly, then predict what the compiler does. Edge cases like these come up often in the practice test.
- 5
Time a run, then recompile the misses
Take the CPA-21-02 practice test in Timed Mode once all five domains are covered. Paste any surprising code into the compiler, and ask Brainy AI Assistant which rule explains the output.
Start a timed CPA-21-02run
C++ Essentials 2 is the C++ Institute course that prepares candidates for this exam. The C++ Institute's partner organizations include OpenEDG and Cisco Networking Academy.
Who CPA-21-02 is for
- Students who have finished an introductory C++ course and want a recognized next credential.
- Junior developers who use C++ at work and want to prove their grasp of its rules.
- Programmers from other languages who are switching to C++.
- Engineers who program embedded systems in C++.
Typical job titles: Junior C++ developer · Software developer · Embedded software engineer · Systems programmer
CPA-21-02 glossary
18 terms from the exam objectives and the vendor's official material, each defined in a sentence.
- Anonymous namespaces
- Namespaces without a name, whose contents can be used only inside the file that declares them.
- Associativity
- The rule that decides the order in which operators of equal precedence apply, from left to right or from right to left.
- Catch-all
- An exception handler written as catch (...), which catches an exception of any type.
- Default parameters
- Values given to function parameters in the declaration, used when a call leaves those arguments out.
- delete[]
- The form of delete that frees an array created with new[]. Plain delete on such an array is an error.
- Dereference operator (*)
- The operator that follows a pointer to the value stored at the address it holds.
- dynamic_cast
- A cast that checks while the program runs whether a base class pointer or reference really refers to a given derived class.
- Exception specifiers
- Declarations such as throw() after a function header, which state the exceptions that the function may throw.
- Explicit constructor
- A constructor marked explicit, which the compiler will not use for implicit conversions.
- Friend functions
- Functions that are not members of a class but may still use its private and protected members.
- Memory leaks
- Memory allocated with new that is never freed with delete, so the program cannot use it again while it runs.
- Parameterized macros
- Preprocessor macros that take arguments, expanded as plain text before compilation, which is why parentheses matter in them.
- Pointer arithmetic
- Adding an integer to a pointer or subtracting one from it, which moves the pointer by whole elements of its type.
- Promotion
- The automatic conversion of a small type, such as char or short, to int or a wider type before arithmetic.
- Short-circuit evaluation
- The rule that && and || stop as soon as the result is known, so the right-hand operand may never run.
- sizeof operator
- An operator that gives the size in bytes of a type or an object, worked out when the program compiles.
- static_cast
- A cast for conversions the compiler can check, such as between numeric types, with no check while the program runs.
- Ternary operator (?:)
- An operator that picks one of two values by a condition, written as condition ? a : b.