Monday, July 23, 2007

Most frequently asked questions in CPP interview's

What are the various types of constructors?

What type of copy will be called if we initialize an object with another object by using assignment operator?

What is the difference between ‘constant pointer’ and ‘reference’?

What are the steps involved internally to create an object like ‘class_name obj’ ?

How do you handle an exception which is raised while creating object like ‘class_name obj’ ?

Why do we need virtual destructors?

What happens when create an object to an Abstract class?

What is the size of the class if the class contains three virtual functions?

What is Vptr and what it contains?

Explain about virtual table (what are the fields in that table/ is it hash table if so what is the key and what is the value)?

How do you create runtime library for the Template functionality?

When will be the copy of the Template instantiation created (run time/compile time)?

How do you create runtime library of Template classes/functions?

What is placement new?

Difference between shallow and deep copy?

Is this type of invocation possible method().method1() in CPP?

Can we have a memeber(variable or reference) with same data type and name in the both Base and Derived class, if so how do you differentiate while accessing by using derived class object?