- New Updates Alerts-Subscribe

Our Telegram Channel - Join Us

Our Free Email Alerts - Join Us

Important Note:Login & Check Your
Email Inbox and Activate Confirmation Link

Our Whatsapp Group - Join Us

Technical Interview Materials PDF-Free Download

Technical Interview Q & A PDF

9) What is the difference between array and a list?

• Array is a collection of homogeneous elements while list is a collection of heterogeneous elements.

• Array memory allocation is static and continuous while List memory allocation is dynamic and random.

• In Array, users don't need to keep in track of next memory allocation while In list user has to keep in track of next location where memory is allocated. 

10) What is the difference between new() and malloc()?

• new() is a preprocessor while malloc() is a function. 

• There is no need to allocate the memory while using "new" but in malloc() you have to use sizeof().

• "new" initializes the new memory to 0 while malloc() gives random value in the newly allotted memory location. 

11) What are the methods of exporting a function from a DLL?

There are two ways:

• By using the DLL's type library.

• Taking a reference to the function from the DLL instance. 

12) Define friend function.

Friend function acts as friend of the class. It can access the private and protected members of the class. The friend function is not a member of the class but it must be listed in the class definition. 

13) What is virtual function?

A virtual function is used to replace the implementation provided by the base class. The replacement is always called whenever the object in question is actually of the derived class, even if the object is accessed by a base pointer rather than a derived pointer. 

14) When should we use multiple inheritance?

You can answer this question in three manners:

• Never 

• Rarely 

• If you find that the problem domain cannot be accurately modeled any other way. 

15) What is the destructor?

Destructor is used to delete any extra resources allocated by the object. 

16) What is an overflow error?

It is a type of arithmetical error. It is happen when the result of an arithmetical operation been greater than the actual space provided by the system. 

17) What is overloading?

C++ facilitates you to specify more than one definition for a function name or an operator in the same scope. It is called function overloading and operator overloading respectively. 

18) What is function overriding?

If you inherit a class into a derived class and provide a definition for one of the base class's function again inside the derived class, then this function is called overridden function and this mechanism is known as function overriding. 

19) What is virtual inheritance?

Virtual inheritance facilitates you to create only one copy of each object even if the object appears more than one in the hierarchy. 

20) What is constructor?

Constructor is a special method that initializes object. It name must be same as class name. 

21) What is the purpose of "delete" operator?

The "delete" operator is used to release the dynamic memory created by "new" operator. 

22) Explain this pointer?

This pointer holds the address of current object. 

23) What does Scope Resolution operator?

A scope resolution operator(::) is used to define the member function outside the class. 

24) What is the difference between delete and delete[]?

Delete [] is used to release the array of allocated memory which was allocated using new[] whereas delete is used to release one chunk of memory which was allocated using new. 

25) Define the private, protected and public in C++?

Private: The data members and functions cannot be accessed from outside the class. Protected: The data members and functions are accessible to derived class only. Public: The data members and functions can be accessed from outside the class. the subject and later they continue based on further discussion and what you answer -

What is the full form of OOPS? 

Object Oriented Programming System.

What is a class? 

Class is a blue print which reflects the entities attributes and actions. Technically defining a class is designing an user defined data type. 

What is an object? 

An instance of the class is called as object.

List the types of inheritance supported in C++. 

Single, Multilevel, Multiple, Hierarchical and Hybrid.

What is the role of protected access specifier? 

If a class member is protected then it is accessible in the inherited class. However, outside the both the private and protected members are not accessible. 

What is encapsulation? 

The process of binding the data and the functions acting on the data together in an entity (class) called as encapsulation.

What is abstraction? 

Abstraction refers to hiding the internal implementation and exhibiting only the necessary details.

What is inheritance? 

Inheritance is the process of acquiring the properties of the exiting class into the new class. The existing class is called as base/parent class and the inherited class is called as derived/child class. 

Explain the purpose of the keyword volatile. 

Declaring a variable volatile directs the compiler that the variable can be changed externally. Hence avoiding compiler optimization on the variable reference. 

What is an inline function? 

A function prefixed with the keyword inline before the function definition is called as inline function. The inline functions are faster in execution when compared to normal functions as the compiler treats inline functions as macros. 

What is a storage class? 

Storage class specifies the life or scope of symbols such as variable or functions.

Mention the storage classes names in C++. 

The following are storage classes supported in C++

auto, static, extern, register and mutable

What is the role of mutable storage class specifier? 

A constant class object’s member variable can be altered by declaring it using mutable storage class specifier. Applicable only for non-static and non-constant member variable of the class. 

Distinguish between shallow copy and deep copy. 

Shallow copy does memory dumping bit-by-bit from one object to another. Deep copy is copy field by field from object to another. Deep copy is achieved using copy constructor and or overloading assignment operator. 

What is a pure virtual function? 

A virtual function with no function body and assigned with a value zero is called as pure virtual function.

What is an abstract class in C++? 

A class with at least one pure virtual function is called as abstract class. We cannot instantiate an abstract class.

What is a reference variable in C++? 

A reference variable is an alias name for the existing variable. Which mean both the variable name and reference variable point to the same memory location. Therefore updation on the original variable can be achieved using reference variable too. 

What is role of static keyword on class member variable? 

A static variable does exit though the objects for the respective class are not created. Static member variable share a common memory across all the objects created for the respective class. A static member variable can be referred using the class name itself. 

Explain the static member function. 

A static member function can be invoked using the class name as it exits before class objects comes into existence. It can access only static members of the class. 

Name the data type which can be used to store wide characters in C++. 


What are/is the operator/operators used to access the class members? 

Dot (.) and Arrow ( -> )

Can we initialize a class/structure member variable as soon as the same is defined? 

No, Defining a class/structure is just a type definition and will not allocated memory for the same.

What is the data type to store the Boolean value? 

bool, is the new primitive data type introduced in C++ language.

What is function overloading? 

Defining several functions with the same name with unique list of parameters is called as function overloading.

What is operator overloading? 

Defining a new job for the existing operator w.r.t the class objects is called as operator overloading.

Do we have a String primitive data type in C++? 

No, it’s a class from STL (Standard template library).

Name the default standard streams in C++. 

cin, cout, cerr and clog.

Which access specifier/s can help to achive data hiding in C++? 

Private & Protected.

When a class member is defined outside the class, which operator can be used to associate the function definition to a particular class? 

Scope resolution operator (::)

What is a destructor? Can it be overloaded? 

A destructor is the member function of the class which is having the same name as the class name and prefixed with tilde (~) symbol. It gets executed automatically w.r.t the object as soon as the object loses its scope. It cannot be overloaded and the only form is without the parameters. 

What is a constructor? 

A constructor is the member function of the class which is having the same as the class name and gets executed automatically as soon as the object for the respective class is created. 

What is a default constructor? Can we provide one for our class? 

Every class does have a constructor provided by the compiler if the programmer doesn’t provides one and known as default constructor. A programmer provided constructor with no parameters is called as default constructor. In such case compiler doesn’t provides the constructor. 

Which operator can be used in C++ to allocate dynamic memory? 

‘new’ is the operator can be used for the same.

What is the purpose of ‘delete’ operator? 

‘delete’ operator is used to release the dynamic memory which was created using ‘new’ operator.

Can I use malloc() function of C language to allocate dynamic memory in C++? 

Yes, as C is the subset of C++, we can all the functions of C in C++ too.

Can I use ‘delete’ operator to release the memory which was allocated using malloc() function of C language? 

No, we need to use free() of C language for the same.

What is a friend function? 

A function which is not a member of the class but still can access all the member of the class is called so. To make it happen we need to declare within the required class following the keyword ‘friend’. 

What is a copy constructor? 

A copy constructor is the constructor which take same class object reference as the parameter. It gets automatically invoked as soon as the object is initialized with another object of the same class at the time of its creation. 

Does C++ supports exception handling? If so what are the keywords involved in achieving the same. 

C++ does supports exception handling. try, catch & throw are keyword used for the same.

Explain the pointer – this. 

This, is the pointer variable of the compiler which always holds the current active object’s address.

What is the difference between the keywords struct and class in C++? 

By default the members of struct are public and by default the members of the class are private.

Can we implement all the concepts of OOPS using the keyword struct? 


Source: Contents are provided by Technicalsymposium Google Group Members. 
Disclaimer: All the above contents are provided by Google Group members. 
Further, this content is not intended to be used for commercial purpose. is not liable/responsible for any copyright issues. Quick Links & Study Notes PDF- Free Download