1. What are the access privileges in C++?
2. What is polymorphism? What is the mechanism used in C++ to implement it?
3. What are the implicitly generated member functions?
4. What are the differences between a pointer and a reference?
5. What is copy constructor? What is the argument type? Why?
6. When are copy constructors called?
7. What are the differences between copy constructor and assignment operator?
8. When and why do you need virtual destructor?
9. Why it is not good to have exception in destructor?
10. What are the advantages to use initialization list in constructor?
11. When do you need private constructor?
12. What are the static class members, class methods? What are the differences comparing with non static?
13. What is the singleton? How to implement singleton?
14. What is virtual inheritance?
15. What is smart pointer?
16. What is the difference between inline and ordinary functions?
17. What will happen if inline function has a recursion?
18. What is a keyword "mutable" mean?
19. When is a keyword "volatile" used?
20. How is to write a class such that no class can be inherited from it?
21. When is a keyword "explicit" used?
22. What is RTTI?
23. When do you use private inheritance?
24. Why it is not good to call virtual functions from constructor/destructor?
25. What is Resource Acquisition is Initialization (RAII)?
25. What is a template?
27. What are the sizes of the following classes? (assume int is 4 bytes)
class A {
int i;
}
class B {
int i;
void f();
}
class C {
int i;
virtual void f();
}
class D {
int i;
virtual void f1();
virtual void f2();
}
28. You have an unsorted array of 99 elements where the numbers from 1 to 100. Find the missing number using most effective way.
29. Write a function that reverses a string without allocation additional memory.
30. Is the following code fragment correct? When do you need such thing?
send(register short *to, register short *from, register int count)
{
register n=(count+7)/8;
switch(count%8){
case 0: do{ *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
case 4: *to = *from++;
case 3: *to = *from++;
case 2: *to = *from++;
case 1: *to = *from++;
}while(--n>0);
}
}
|