Interview Questions

C++ Back

Describe the main characteristics of static functions.

Ans:  The main characteristics of static functions include, It is without the a this pointer, It can't directly access the non-static members of its class, It can't be declared const, volatile or virtual, It doesn't need to be invoked through an object of its class, although for convenience, it may.

What is cloning?

Ans:  An object can carry out copying in two ways i.e. it can set itself to be a copy of another object, or it can return a copy of itself. The latter process is called cloning.

What are proxy objects?

Ans:  Objects that points to other objects are called proxy objects or surrogates. Its an object that provides the same interface as its server object but does not have any functionality. During a method.

What is reflexive association?

Ans:  The 'is-a' is called a reflexive association because the reflexive association permits classes to bear the is-a association not only with their super-classes but also with themselves. It differs from a 'specializes-from' as 'specializes-from' is usually used to describe the association between a super-class and a sub-class. For example:Printer is-a printer.

What is a mixin class?

Ans:  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.

What is a protocol class?

Ans:  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.

What is a container class? What are the types of container classes ?

Ans:  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.

What is an orthogonal base class ?

Ans:  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.

Name the operators that cannot be overloaded ?

Ans:  sizeof, *, ->, ::, ?: .

Name some pure object oriented languages ?

Ans:  Smalltalk,Java,Eiffel,Sather.