C++ Interview Questions

 
1.
What is C++?
2.
How do you find out if a linked-list has an end? (i.e. the list is not a circular)
3.
What is the difference between realloc() and free()?
4.
What is function overloading and operator overloading?
5.
What is the difference between declaration and definition?
6.
What are the advantages of inheritance?
7.
How do you write a function that can reverse a linked-list?
8.
What do you mean by inline function?
9.
Write a program that ask for user input from 5 to 9 then calculate the average
10.
Write a short code using C++ to print out all odd number from 1 to 100 using a for loop
11.
What is public, protected, private?
12.
Tell how to check whether a linked list is circular.
13.
What is virtual constructors/destructors?
14.
Virtual constructor: Constructors cannot be virtual. Declaring a constructor as a virtual function is a syntax error. Does c++ support multilevel and multiple inheritance?
15.
What is the difference between an ARRAY and a LIST?
16.
Does c++ support multilevel and multiple inheritance?
17.
What is a template?
18.
Define a constructor - What it is and how it might be called (2 methods).
19.
You have two pairs: new() and delete() and another pair : alloc() and free().
Explain differences between eg. new() and malloc()
20.
What is the difference between class and structure?
21.
What is RTTI?
22.
What is encapsulation?
23.
How can you tell what shell you are running on UNIX system?
24.
What do you mean by inheritance?
25.
Describe PRIVATE, PROTECTED and PUBLIC - the differences and give examples.
26.
What is namespace?
27.
What is a COPY CONSTRUCTOR and when is it called?
28.
What is virtual class and friend class?
29.
What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?
30.
What do you mean by binding of data and functions?
31.
What are 2 ways of exporting a function from a DLL?
32.
What is the difference between an object and a class?
33.
What is a class?
34.
What is friend function?
35.
Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?
36.
What is abstraction?
37.
What are virtual functions?
38.
What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator.
39.
What is a scope resolution operator?
40.
What do you mean by pure virtual functions?
41.
What is polymorphism? Explain with an example?
42.
Why are arrays usually processed with for loop?
43.
Explain which of the following declarations will compile and what will be constant - a pointer or the value pointed at: * const char *
* char const *
* char * const
44.
What problems might the following macro bring to the application?
45.
What does extern mean in a function declaration?
46.
What can I safely assume about the initial values of variables which are not explicitly initialized?
47.
Explain the scope resolution operator.
48.
What are the differences between a C++ struct and C++ class?
49.
What is a conversion constructor?
50.
What is the difference between a copy constructor and an overloaded assignment operator?
51.
What is an explicit constructor?
52.
Describe run-time type identification.
53.
What problem does the namespace feature solve?
54.
Name some major differences between C++ and Java.
55.
What is a node class?
56.
What is a container class? What are the types of container classes?
57.
What is polymorphism?
58.
Differentiate between the message and method.
59.
What is an adaptor class or Wrapper class?
60.
What is a Null object?
61.
What is class invariant?
62.
What do you mean by Stack unwinding?
63.
Define precondition and post-condition to a member function.
64.
What are the conditions that have to be met for a condition to be an invariant of the class?
65.
Name some pure object oriented languages.
66.
What is an orthogonal base class?
67.
Define namespace.
68.
What is the use of 'using' declaration. ?
69.
What is an Iterator class ?
70.
Differences of C and C++
Could you write a small program that will compile in C but not in C++ ?
71.
In C++, what is the difference between method overloading and method overriding?
72.
What methods can be overridden in Java?
73.
What are the defining traits of an object-oriented language?