Technical interview questions and answers play a major role in C++ Interviews because C++ is widely used in system programming, game development, competitive coding, and performance-critical applications. Companies expect candidates to know OOP concepts, classes, inheritance, polymorphism, references, memory management, STL, and exception handling. These questions often appear in campus placements and software interviews conducted by TCS, Wipro, Infosys, Cognizant, and Capgemini. This guide covers frequently asked C++ interview questions with simple explanations that help freshers and job seekers strengthen their programming foundation. Preparing these questions will help you perform well in coding tests, technical rounds, and real-time problem-solving interviews.
Showing 10 of 92 questions
1. What is a modifier?
A modifier, also called a modifying function is a member function that changes the value of at least one data member. In other words, an operation that modifies the state of an object. Modifiers are also known as ‘mutators.
2. What is an accessor?
An accessor is a class operation that does not modify the state of an object. The accessor functions need to be declared as const operations
3. Differentiate between a template class and class template.
Template class:
A generic definition or a parameterized class not instantiated until the client provides the needed information. Its jargon for plain templates.
Class template:
A class template specifies how individual classes can be constructed much like the way a class specifies how individual objects can be constructed. Its jargon for plain classes.
4. When does a name clash occur?
A name clash occurs when a name is defined in more than one place. For example., two different class libraries could give two different classes the same name. If you try to use many class libraries at the same time, there is a fair chance that you will be unable to compile or link the program because of name clashes.
5. Define namespace.
It is a feature in c++ to minimize name collisions in the global name space. This
namespace keyword assigns a distinct name to a library that allows other libraries to use
the same identifier names without creating any name collisions. Furthermore, the
compiler uses the namespace signature for differentiating the definitions.
6. What is the use of using declaration.
A using declaration makes it possible to use a name from a namespace without the
scope operator.
7. List out some of the OODBMS available.
Ø GEMSTONE/OPAL of Gemstone systems.
Ø ONTOS of Ontos.
Ø Objectivity of Objectivity inc.
Ø Versant of Versant object technology.
Ø Object store of Object Design.
Ø ARDENT of ARDENT software.
Ø POET of POET software.
8. List out some of the object-oriented methodologies.
Ø Object Oriented Development (OOD) (Booch 1991,1994).
Ø Object Oriented Analysis and Design (OOA/D) (Coad and Yourdon 1991).
Ø Object Modelling Techniques (OMT) (Rumbaugh 1991).
Ø Object Oriented Software Engineering (Objectory) (Jacobson 1992).
Ø Object Oriented Analysis (OOA) (Shlaer and Mellor 1992).
Ø The Fusion Method (Coleman 1991).
9. What is an incomplete type?
Incomplete types refers to pointers in which there is non availability of the implementation of the referenced location or it points to some location whose value is not available for modification.
10. What is a dangling pointer?
A dangling pointer arises when you use the address of an object after its lifetime is over.
This may occur in situations like returning addresses of the automatic variables from a
function or using the address of the memory block after it is freed.