C++ Rapid-Fire Questions & Answers
50 questions for the rapid-fire stage — 27 easy, 22 medium, 1 hard.
About the rapid-fire round
Rapid-fire questions are quick definitions and one-line answers that interviewers fire at the start or end of a round to check your C++ basics. Aim to answer each in under 20 seconds.
Tips for the rapid-fire round
- Answer in one or two sentences, then stop.
- If you don't know, say so quickly and move on; don't guess at length.
- Revise these the morning of the interview.
- Practise with a friend who reads them in random order.
What is CMake and why is it used for C++ projects?
Show answer
What are header guards and #pragma once?
Show answer
Compare pass by value, pass by pointer and pass by reference.
Show answer
What are structured bindings and how do they work with range-based for loops?
Show answer
What is the difference between a process and a thread?
Show answer
What are the main components of the Standard Template Library?
Show answer
What are non-type template parameters?
Show answer
What is the difference between struct and class in C++?
Show answer
What do auto and decltype do?
Show answer
What is the difference between an inline function and a macro?
Show answer
Explain unique_ptr, shared_ptr and weak_ptr.
Show answer
What is std::string_view and what are its pitfalls?
Show answer
What is C++ and how is it different from C?
Show answer
What kinds of constructors does C++ have?
Show answer
Compare std::vector, std::list and std::deque.
Show answer
What is pointer arithmetic?
Show answer
What is a memory leak and how do you detect one?
Show answer
What are default arguments and what rules apply to them?
Show answer
What is template argument deduction and class template argument deduction?
Show answer
What is undefined behaviour in C++? Give examples.
Show answer
What is the difference between a static library and a dynamic library?
Show answer
How do virtual functions work internally?
Show answer
What is the difference between std::map and std::unordered_map?
Show answer
What is RAII and why is it central to C++?
Show answer
What are lambdas and how do capture modes work?
Show answer
What is a void pointer and when would you use it?
Show answer
Which profiling tools do you use for C++ and what does each show?
Show answer
What is the difference between push_back and emplace_back?
Show answer
Explain the stages of compiling and running a C++ program.
Show answer
Compare std::mutex, lock_guard, unique_lock and scoped_lock.
Show answer
How does std::vector grow, and what is the difference between size, capacity and reserve?
Show answer
What is the difference between full and partial template specialization?
Show answer
What is the difference between new/delete and malloc/free?
Show answer
What does C++20 std::jthread add over std::thread?
Show answer
What is a pure virtual function and an abstract class?
Show answer
What is function overloading and how does the compiler choose an overload?
Show answer
Explain the rule of three, rule of five and rule of zero.
Show answer
What is the difference between stack and heap memory?
Show answer
What are the four pillars of object-oriented programming in C++?
Show answer
What is a dangling pointer?
Show answer
What is the difference between const int*, int* const and const int* const?
Show answer
What is the difference between overloading and overriding, and what do override and final do?
Show answer
What is the difference between a shallow copy and a deep copy?
Show answer
What is the erase-remove idiom and what replaced it in C++20?
Show answer
What is the difference between a declaration and a definition?
Show answer
What is the difference between ++i and i++?
Show answer
What are race conditions and data races?
Show answer
What are the fundamental data types in C++ and their typical sizes?
Show answer
Why should a base class have a virtual destructor?
Show answer
Frequently asked questions
What happens in the C++ rapid-fire round?
Rapid-fire questions are quick definitions and one-line answers that interviewers fire at the start or end of a round to check your C++ basics. Aim to answer each in under 20 seconds.
How do I clear the rapid-fire round?
Answer in one or two sentences, then stop. If you don't know, say so quickly and move on; don't guess at length. Revise these the morning of the interview.
Which round comes next?
A typical order is online assessment, telephonic screening, one or two technical rounds, a managerial round and HR. Use the other round pages to practise each stage.