Skip to content

Cpp Programming Practice Exam

Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.

📝 50 questions · ⏱ 60 minutes · 🎯 Pass mark 70% · 🆓 Free, no signup

Exam details

  • 50 questions drawn from 170 cards
  • Countdown timer — auto-submits when time runs out
  • Pass mark 70% (real certification threshold)
  • Full review of wrong answers at the end
  • No signup required — save your score with a free account

Sample Questions

5 shown

What are the four main principles of OOP in C++?

Show ▼

The four pillars of OOP are:

  • Encapsulation – bundling data and methods together
  • Abstraction – hiding complex implementation details
  • Inheritance – deriving new classes from existing ones
  • Polymorphism – using a single interface for different types

What is a class in C++?

Show ▼

A class is a user-defined type that encapsulates data members and member functions. Defined with the class keyword:
class MyClass { public: int x; void show(); };

What is the difference between a class and a struct in C++?

Show ▼

The only default difference is access control:

  • class members are private by default
  • struct members are public by default
Both can have methods, constructors, and inheritance.

What is inheritance in C++?

Show ▼

Inheritance allows a derived class to inherit members from a base class:
class Dog : public Animal { };
This promotes code reuse and establishes an is-a relationship.

What are virtual functions in C++?

Show ▼

A virtual function is declared with the virtual keyword in a base class, enabling runtime polymorphism:
virtual void speak() { }
Derived classes can override it, and the correct version is called via a base class pointer using the vtable.

🎯 Take the Cpp Programming Practice Exam