Saturday, September 22, 2007

When to use exceptions and when to use return codes

Use exceptions in exceptional conditions and use return codes to control program flow.

Monday, September 3, 2007

Section-Templates

1. What is template specialization?

Template specialization is the mechnaism to override the default template implementation to handle a particular type in a different way.

2. What is partial template specialization?

Using a template that specializes on one feature but still lets the class user choose other features as part of the template
Can you make member variable as default parameter of a member function?

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?