100+ Free C++ CPP Practice Questions
Pass your C++ Institute Certified Professional Programmer exam on the first try — instant access, no signup required.
Which STL sequence container provides constant-time random access AND amortized constant-time push_back, but only linear-time insertion in the middle?
Key Facts: C++ CPP Exam
40
Exam Questions
C++ Institute CPP-22-02 syllabus
65 min
Exam Duration
C++ Institute CPP-22-02 syllabus
70%
Passing Score
C++ Institute CPP-22-02 syllabus
$295
Exam Fee (USD)
C++ Institute / Pearson VUE
Pearson VUE
Test Provider
OpenEDG C++ Institute
CPA
Recommended Prereq
C++ Institute prerequisites
C++ Certified Professional Programmer (CPP-22-02) is a 40-question, 65-minute proctored exam delivered by Pearson VUE. Passing score is 70% and the exam fee is approximately $295 USD. CPP tests advanced STL fluency: vector, deque, list, stack, queue, priority_queue, set, multiset, map, multimap; iterator categories; non-modifying algorithms (find, count, search); modifying algorithms (copy, transform, replace, remove, reverse, rotate, partition); sort, stable_sort, lower_bound, upper_bound, binary_search; merge and heap operations; min/max and set operations; functional utilities (function, bind, mem_fn, ref); advanced I/O manipulators; and function and class templates with full and partial specialization.
Sample C++ CPP Practice Questions
Try these sample questions to test your C++ CPP exam readiness. Each question includes a detailed explanation. Start the interactive quiz above for the full 100+ question experience with AI tutoring.
1Which STL sequence container provides constant-time random access AND amortized constant-time push_back, but only linear-time insertion in the middle?
2Given std::vector<int> v = {1,2,3,4,5}; v.erase(v.begin() + 2); what does v contain afterwards?
3What is the iterator category of std::list<T>::iterator?
4Why does std::sort require its iterator range to be random-access?
5What does this code print? #include <iostream> #include <vector> int main() { std::vector<int> v; v.reserve(10); std::cout << v.size() << ' ' << v.capacity(); }
6What is the time complexity of std::map<Key, Value>::find?
7Which function object should you pass as the third template argument of std::priority_queue<int> to turn it into a min-heap?
8What does this code print? #include <iostream> #include <vector> #include <algorithm> int main() { std::vector<int> v = {3, 1, 4, 1, 5, 9, 2, 6}; std::sort(v.begin(), v.end()); for (int x : v) std::cout << x; }
9What does the erase-remove idiom achieve?
10What does this code print? #include <iostream> #include <vector> #include <algorithm> int main() { std::vector<int> v = {1, 2, 3, 2, 4, 2, 5}; auto it = std::remove(v.begin(), v.end(), 2); std::cout << v.size() << ' ' << (it - v.begin()); }
About the C++ CPP Exam
The C++ Institute CPP exam (CPP-22-02) validates advanced C++ skills: STL sequence and associative containers, iterators, non-modifying and modifying algorithms, sorting and binary search, merge and heap operations, function objects and binders, advanced I/O with stream manipulators, and function and class templates with specialization.
Questions
40 scored questions
Time Limit
65 minutes
Passing Score
70%
Exam Fee
$295 (C++ Institute / OpenEDG)
C++ CPP Exam Content Outline
Sequence Containers and Container Adapters
vector, deque, list, forward_list, array, and the stack/queue/priority_queue adapters: invariants, iterator invalidation, complexity, and idiomatic use.
Associative and Unordered Containers
set, multiset, map, multimap with comparators; unordered_set/unordered_map basics; insertion, lookup, and erase semantics.
Non-Modifying and Modifying Algorithms
find, count, search, mismatch, equal; copy, transform, replace, remove (erase-remove idiom), reverse, rotate, partition, and unique.
Sorting, Binary Search, Merge, and Heap
sort, stable_sort, partial_sort, nth_element; lower_bound, upper_bound, equal_range, binary_search; merge, inplace_merge, set operations; make_heap, push_heap, pop_heap, sort_heap.
Function Objects, Binders, and Lambdas
Standard function objects, std::function, std::bind, std::mem_fn, std::ref, and lambda expressions used as predicates and unary/binary functors.
Advanced I/O Streams
Stream state, manipulators (setw, setfill, setprecision, fixed, scientific, hex, boolalpha, showbase, showpos), stream iterators, and string streams.
Function and Class Templates
Template syntax, instantiation, full and partial specialization, default template parameters, non-type template parameters, and template-dependent name lookup.
How to Pass the C++ CPP Exam
What You Need to Know
- Passing score: 70%
- Exam length: 40 questions
- Time limit: 65 minutes
- Exam fee: $295
Keys to Passing
- Complete 500+ practice questions
- Score 80%+ consistently before scheduling
- Focus on highest-weighted sections
- Use our AI tutor for tough concepts
C++ CPP Study Tips from Top Performers
Frequently Asked Questions
What is on the C++ Institute CPP exam?
CPP-22-02 tests advanced C++ Standard Library skills. Major topics include STL sequence containers (vector, deque, list, forward_list, array), container adapters (stack, queue, priority_queue), associative containers (set, multiset, map, multimap), non-modifying algorithms (find, count, search), modifying algorithms (copy, transform, replace, remove, reverse, rotate, partition), sorting and binary search (sort, stable_sort, lower_bound, upper_bound, binary_search), merge and heap operations, set operations, function objects and binders, advanced stream I/O with manipulators, and function and class templates with full and partial specialization.
How long is the CPP exam and how many questions does it have?
The CPP-22-02 exam contains 40 questions delivered in 65 minutes, with about 10 additional minutes for the non-disclosure agreement and tutorial. Items are single-choice and multiple-choice questions, and many present a short C++ code listing and ask what the program prints.
What is the passing score for CPP?
The CPP-22-02 passing score is 70%. You need to answer at least 28 of the 40 items correctly. Because there is no published difficulty curve, treat 80% on practice tests as your safety margin before scheduling the live exam.
How much does the CPP exam cost?
The current C++ Institute CPP-22-02 exam fee is approximately USD 295 for a single attempt, with bundle pricing around USD 375 that includes one paid retake. Pricing is set by C++ Institute and OpenEDG and can vary by region or promotional voucher.
What are the prerequisites for CPP?
There are no formal prerequisites to register for CPP-22-02, but C++ Institute strongly recommends holding the CPA (C++ Certified Associate Programmer) credential first. CPA covers core language fundamentals; CPP assumes you already know inheritance, polymorphism, exceptions, operator overloading, and pointers, and focuses on the Standard Template Library and templates.
Who should take the C++ CPP certification?
CPP is built for working C++ developers who want a vendor-neutral validation of advanced Standard Library skills. Strong candidates write modern C++ daily, are fluent in STL container choice and iterator categories, can read template code that uses specialization, and routinely use algorithms, lambdas, and stream manipulators rather than reinventing them.