1. Tell us what do you mean by internal linking and external linking in c++?

A symbol is said to be linked internally when it can be accessed only from with-in the scope of a single translation unit. By external linking a symbol can be accessed from other translation units as well. This linkage can be controlled by using static and extern keywords.

2. Explain what do you mean by pure virtual functions in C++?

Pure virtual function is a function which doesn't have an implementation and the same needs to be implemented by the the next immediate non-abstract class. (A class will become an abstract class if there is at-least a single pure virtual function and thus pure virtual functions are used to create interfaces in c++).

3. Tell me 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.

4. Do you know 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.

5. Tell me what is this pointer?

The ‘this' pointer is passed as a hidden argument to all nonstatic member function calls and is available as a local variable within the body of all nonstatic functions. ‘this' pointer is a constant pointer that holds the memory address of the current object. ‘this' pointer is not available in static member functions as static member functions can be called without any object (with class name).

6. Explain 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.

7. Please explain 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.

8. What is an inline function in C++?

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.

9. Tell me what do you mean by persistent and non persistent objects?

Persistent objects are the ones which we can be serialized and written to disk, or any other stream. So before stopping your application, you can serialize the object and on restart you can deserialize it. [ Drawing applications usually use serializations.]
Objects that can not be serialized are called non persistent objects. [ Usually database objects are not serialized because connection and session will not be existing when you restart the application. ]

10. Tell me the types of inheritance supported in C++?

☛ Single,
☛ Multilevel,
☛ Multiple,
☛ Hierarchical and
☛ Hybrid.

Download Interview PDF