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
21. Name the operators that cannot be overloaded.
sizeof . .* .-> :: ?:
22. What is a node class?
A node class is a class that,
Ø relies on the base class for services and implementation,
Ø provides a wider interface to te users than its base class,
Ø relies primarily on virtual functions in its public interface
Ø depends on all its direct and indirect base class
Ø can be understood only in the context of the base class
Ø can be used as base for further derivation
Ø can be used to create objects.
A node class is a class that has added new services or functionality beyond the services
23. What is an orthogonal base class?
If two base classes have no overlapping methods or data they are said to be
independent of, or orthogonal to each other. Orthogonal in the sense means that two classes operate in different dimensions and do not interfere with each other in any way.The same derived class may inherit such classes with no difficulty.
24. What is a container class? What are the types of container classes?
A container class is a class that is used to hold objects in memory or external
storage. A container class acts as a generic holder. A container class has a predefined
behavior and a well-known interface. A container class is a supporting class whose
purpose is to hide the topology used for maintaining the list of objects in memory. When
a container class contains a group of mixed objects, the container is called a
heterogeneous container; when the container is holding a group of objects th
25. What is a protocol class?
An abstract class is a protocol class if:
Ø it neither contains nor inherits from classes that contain member data, non-virtual
functions, or private (or protected) members of any kind.
Ø it has a non-inline virtual destructor defined with an empty implementation,
Ø all member functions other than the destructor including inherited functions, are
declared pure virtual functions and left undefined.
26. What is a mixin class?
A class that provides some but not all of the implementation for a virtual base
class is often called mixin. Derivation done just for the purpose of redefining the virtual
functions in the base classes is often called mixin inheritance. Mixin classes typically
don't share common bases.
27. What is a concrete class?
A concrete class is used to define a useful object that can be instantiated as an
automatic variable on the program stack. The implementation of a concrete class is
defined. The concrete class is not intended to be a base class and no attempt to minimize
dependency on other classes in the implementation or behavior of the class.
28. What is the handle class?
A handle is a class that maintains a pointer to an object that is programmatically
accessible through the public interface of the handle class.
29. What is an action class?
The simplest and most obvious way to specify an action in C++ is to write a
function. However, if the action has to be delayed, has to be transmitted 'elsewhere'
before being performed, requires its own data, has to be combined with other actions, etc
then it often becomes attractive to provide the action in the form of a class that can
execute the desired action and provide other services as well. Manipulators used with
iostreams is an obvious example.
30. When can you tell that a memory leak will occur?
A memory leak occurs when a program loses the ability to free a block of dynamically allocated memory.