#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
⚡ FREE · INSTANT FEEDBACK

C++ MCQ Quiz: OOP, Memory and STL in 25 Questions

Test your C++ for placements and interviews, with instant explanations.

  • ➕ 25 C++ questions
  • 🧠 Memory and smart pointers
  • 📚 STL basics

How to use the C++ MCQ Quiz

  1. 1. Choose the length10 random C++ questions, or all 25.
  2. 2. AnswerTap an option. You see straight away whether it's right, with a one-line reason.
  3. 3. ReviewFinish to get your score and a list of every question with the correct answer.

What the questions cover

  • Basics: integer division, iostream, references and const member functions.
  • OOP: struct vs class, virtual functions, pure virtual functions and abstract classes, virtual destructors, overloading and which operators can't be overloaded.
  • Memory: the Rule of Three, RAII, unique_ptr, shared_ptr and weak_ptr, and delete vs delete[].
  • Modern C++: std::move, auto, range-based for loops and lambdas.
  • STL and templates: std::sort complexity, map vs unordered_map, vector growth, priority_queue and template functions.

This quiz is about C++. For plain C topics such as pointers to pointers, malloc and format strings, take the separate C programming MCQ quiz.

A sample question explained

Why should a base class with virtual functions have a virtual destructor? Suppose Base* p = new Derived(); and later delete p;. If Base's destructor isn't virtual, only Base's destructor runs, so whatever Derived allocated is never cleaned up. Formally that is undefined behaviour. Marking the destructor virtual makes delete call Derived's destructor first, then Base's.

The code questions in this quiz were compiled and run with g++ to confirm their output. For example, int a = 5; int& r = a; r++; cout << a; prints 6, because r is just another name for a. For more questions where you predict output, try the Guess the Code Output quiz.

Frequently asked questions

Which C++ standard is assumed?

C++17, with features from C++11 onwards such as auto, lambdas, smart pointers and move semantics.

Is this the same as the C programming quiz?

No. This one covers C++ features like classes, references and the STL. The C quiz covers C.

Who wrote the questions?

Uncodemy, for placement and interview practice. They aren't from any official exam.

Is the C++ MCQ quiz free to take?

Yes. The C++ MCQ quiz lets you answer every question with no form. At your first score screen we ask for your name and WhatsApp number once; after that, the C++ MCQ quiz and all other Uncodemy tools stay open.

More free tools

See all free tools