C++ Interview Questions
Pointers, references, OOP, virtual functions, templates, the STL, RAII and smart pointers.
61 questions
Popular Searches
1. What is C++ and Its Key Features?
easyFundamentals 6 mins2. Difference Between C and C++
easyFundamentals 6 mins3. What are Pointers in C++?
mediumMemory 7 mins4. References vs Pointers in C++
mediumMemory 7 mins5. What are Constructors and Destructors in C++?
easyOOP 6 mins6. What is a Copy Constructor in C++?
mediumOOP 7 mins7. What are Virtual Functions in C++?
hardOOP 8 mins8. What is Polymorphism in C++?
mediumOOP 7 mins9. What is Operator Overloading in C++?
mediumOOP 7 mins10. How Does Inheritance Work in C++?
mediumOOP 7 mins11. What is an Abstract Class in C++?
mediumOOP 7 mins12. What are Templates in C++?
mediumGeneric 7 mins13. What are STL Containers in C++?
mediumSTL 7 mins14. How Do Vectors Work in C++?
easySTL 6 mins15. What is RAII in C++?
hardMemory 8 mins16. What are Smart Pointers in C++?
hardMemory 7 mins17. How Do new and delete Work in C++?
mediumMemory 6 mins18. What is the static Keyword in C++?
mediumCore 6 mins19. What is the const Keyword in C++?
mediumCore 6 mins20. What are Inline Functions in C++?
mediumCore 6 mins21. What are Friend Functions in C++?
mediumOOP 6 mins22. What are Namespaces in C++?
easyCore 6 mins23. How Does Exception Handling Work in C++?
mediumCore 7 mins24. What are Move Semantics in C++?
hardAdvanced 9 mins25. What are Lambda Expressions in C++?
mediumAdvanced 7 mins26. What is the this Pointer in C++?
easyOOP 6 mins27. What is Function Overloading in C++?
easyOOP 6 mins28. Shallow Copy vs Deep Copy in C++
mediumMemory 7 mins29. Stack vs Heap Memory in C++
mediumMemory 7 mins30. lvalue vs rvalue in C++
hardAdvanced 8 mins31. What is a Pointer in C++?
easyFundamentals 5 mins32. What is OOP in C++?
easyFundamentals 6 mins33. What is a Constructor in C++?
easyFundamentals 5 mins34. What is a Destructor in C++?
easyFundamentals 5 mins35. Stack vs Heap in C++
mediumMemory Management 6 mins36. What is the STL in C++?
mediumStandard Library 6 mins37. What is a Vector in C++?
mediumStandard Library 6 mins38. What is a Template in C++?
mediumGeneric Programming 6 mins39. What is a Namespace in C++?
hardLanguage Fundamentals 7 mins40. Pass by Value vs Reference in C++
hardLanguage Fundamentals 7 mins41. What Is Const Correctness in C++?
hardLanguage Fundamentals 6 mins42. What Is a Friend Function in C++?
hardClasses & Encapsulation 6 mins43. What Is a Memory Leak in C++?
hardMemory Management 7 mins44. When Does Copy Elision Apply, and When Is It Guaranteed?
hardValue Semantics 8 mins45. Explain the Rule of Zero, Three and Five
mediumResource Management 8 mins46. Why Does std::vector Care Whether Your Move Constructor Is noexcept?
hardValue Semantics 8 mins47. What Are the Main Categories of Undefined Behaviour in C++?
hardCorrectness and Safety 9 mins48. How Do Dangling References Arise, and How Do You Prevent Them?
hardCorrectness and Safety 9 mins49. What Is a shared_ptr Reference Cycle and How Do You Break It?
hardResource Management 9 mins50. How Do You Express Ownership in a C++ API Using Smart Pointers?
hardAPI Design 9 mins51. What Are the Exception Safety Guarantees, and How Does RAII Deliver Them?
hardException Safety 10 mins52. When Do You Need a Virtual Destructor, and What Is Object Slicing?
mediumPolymorphism 8 mins53. How Does Template Argument Deduction Work, and What Is a Forwarding Reference?
hardTemplates 10 mins54. What Is SFINAE, and How Do Concepts Replace It?
hardTemplates 10 mins55. What Does constexpr Guarantee, and How Does It Differ From consteval and constinit?
hardCompile-Time Programming 10 mins56. Explain the C++ Memory Model and the Atomic Memory Orderings
hardConcurrency 11 mins57. What Are the Iterator Invalidation Rules for STL Containers?
mediumSTL 9 mins58. How Does std::vector Grow, and When Should You Call reserve?
mediumSTL 9 mins59. What Is the Small String Optimisation and How Does It Affect Performance?
mediumSTL 8 mins60. What Is the One Definition Rule, and How Do ODR Violations Cause Bugs?
hardBuild and Linkage 10 mins61. How Would You Debug an Intermittent Memory Corruption Crash in Production?
hardDebugging 10 mins