C++ Interview Questions

 
1.
What is C++?
2.
What is a modifier in C++?
3.
What is an accessor in C++?
4.
Differentiate between a template class and class template in C++?
5.
When does a name clash occur in C++?
6.
Define namespace in C++?
7.
What is the use of ‘using' declaration in C++?
8.
What is an Iterator class in C++?
9.
What is an incomplete type in C++?
10.
What is a dangling pointer in C++?
11.
Differentiate between the message and method in C++?
12.
What is an adaptor class or Wrapper class in C++?
13.
What is a Null object in C++?
14.
What is class invariant in C++?
15.
What do you mean by Stack unwinding in C++?
16.
Define precondition and post-condition to a member function in C++?
17.
What are the conditions that have to be met for a condition to be an invariant of the class?
18.
What are proxy objects in C++?
19.
Name some pure object oriented languages?
20.
What is a node class in c++?
21.
What is an orthogonal base class in C++?
22.
What is a container class? What are the types of container classes in C++?
23.
How do you write a function that can reverse a linked-list in C++?
24.
What is polymorphism in C++?
25.
How do you find out if a linked-list has an end? (i.e. the list is not a cycle)
26.
How can you tell what shell you are running on UNIX system?
27.
What is Boyce Codd Normal form?
28.
What is pure virtual function?
29.
Write a Struct Time where integer m, h, s are its members
30.
How do you traverse a Btree in Backward in-order?
31.
What is the two main roles of Operating System?
32.
In the derived class, which data member of the base class are visible?
33.
How do you find out if a linked-list has an end? (i.e. the list is not a cycle)
34.
What is the difference between realloc() and free()?
35.
What is function overloading and operator overloading?
36.
What is the difference between declaration and definition?
37.
What are the advantages of inheritance in C++?
38.
How do you write a function that can reverse a linked-list?
39.
What do you mean by inline function?
40.
Write a program that ask for user input from 5 to 9 then calculate the average
41.
Write a short code using C++ to print out all odd number from 1 to 100 using a for loop
42.
What is public, protected, private in C++?
43.
Write a function that swaps the values of two integers, using int* as the argument type.
44.
Tell how to check whether a linked list is circular.
45.
What is virtual constructors/destructors?
46.
What is the difference between an ARRAY and a LIST?
47.
Does c++ support multilevel and multiple inheritance?
48.
What is a template in C++?
49.
Define a constructor - What it is and how it might be called (2 methods).
50.
You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. new() and malloc()
51.
What is the difference between class and structure in C++?
52.
What is RTTI in C++?
53.
What is encapsulation in C++?
54.
What is a C++ object?
55.
Describe PRIVATE, PROTECTED and PUBLIC – the differences and give examples.
56.
What is C++ namespace?
57.
What do you mean by inheritance?
58.
What is a COPY CONSTRUCTOR and when is it called?
59.
What is Boyce Codd Normal form in C++?
60.
What is virtual class and friend class?
61.
What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?
62.
What do you mean by binding of data and functions?
63.
What are 2 ways of exporting a function from a DLL?
64.
What is the difference between an object and a class?
65.
Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].
66.
What is a C++ class?
67.
What is friend function in C++?
68.
Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?
69.
What is abstraction in C++?
70.
What are virtual functions in C++?
71.
What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator.
72.
What is a scope resolution operator?
73.
What do you mean by pure virtual functions?
74.
What is polymorphism in C++? Explain with an example?
75.
How can you quickly find the number of elements stored in a a) static array b) dynamic array ?
Why is it difficult to store linked list in an array?
How can you find the nodes with repetetive data in a linked list?
76.
What is the output of the following program? Why?
77.
Why are arrays usually processed with for loop?
78.
What is an HTML tag?
79.
Explain which of the following declarations will compile and what will be constant ...
80.
You are given a simple code for the class BankCustomer. Write the following functions ...
81.
What problems might the following macro bring to the application?
82.
Anything wrong with this code?
T *p = new T[10];
delete p;
83.
Anything wrong with this code?
T *p = 0;
delete p;
84.
How do you decide which integer type to use?
85.
What is the best way to declare and define global variables?
86.
What does extern mean in a function declaration?
87.
What can I safely assume about the initial values of variables which are not explicitly initialized?
88.
What is the difference between char a[] = “string?; and char *p = “string?;?
89.
What is the auto keyword good for in C++?
90.
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
91.
What does extern mean in a function declaration in C++?
92.
How do I initialize a pointer to a function?
93.
How do you link a C++ program to C functions?
94.
Explain the scope resolution operator.
95.
What are the differences between a C++ struct and C++ class?
96.
How many ways are there to initialize an int with a constant?
97.
How does throwing and catching exceptions differ from using setjmp and longjmp?
98.
What is a default constructor in C++?
99.
What is a conversion constructor C++?
100.
What is the difference between a copy constructor and an overloaded assignment operator?
101.
When should you use multiple inheritance?
102.
Explain the ISA and HASA class relationships. How would you implement each in a class design?
103.
When is a template a better solution than a base class?
104.
What is a mutable member?
105.
What is an explicit constructor?
106.
What is the Standard Template Library (STL)?
107.
Describe run-time type identification.
108.
What problem does the namespace feature solve?
109.
Are there any new intrinsic (built-in) data types?
110.
Will the following program execute?
111.
Will this C++ program execute or not?
112.
What is the difference between Mutex and Binary semaphore?
113.
In C++, what is the difference between method overloading and method overriding?
114.
What methods can be overridden in Java?
115.
What are the defining traits of an object-oriented language?
116.
Can you be bale to identify between Straight- through and Cross- over cable wiring? and in what case do you use Straight- through and Cross-over?
117.
If you hear the CPU fan is running and the monitor power is still on, but you did not see any thing show up in the monitor screen. What would you do to find out what is going wrong?
118.
Assignment Operator - What is the diffrence between a "assignment operator" and a "copy constructor"?
119.
RTTI - What is RTTI in C++?
120.
STL Containers - What are the types of STL containers?
121.
What is C++?
122.
What is a modifier in C++?
123.
What is an accessor in C++?
124.
Differentiate between a template class and class template in C++?
125.
When does a name clash occur in C++?
126.
Define namespace in C++?
127.
What is the use of ‘using' declaration in C++?
128.
What is an Iterator class in C++?
129.
What is an incomplete type in C++?
130.
What is a dangling pointer in C++?
131.
Differentiate between the message and method in C++?
132.
What is an adaptor class or Wrapper class in C++?
133.
What is a Null object in C++?
134.
What is class invariant in C++?
135.
What do you mean by Stack unwinding in C++?
136.
Define precondition and post-condition to a member function in C++?
137.
What are the conditions that have to be met for a condition to be an invariant of the class?
138.
What are proxy objects in C++?
139.
Name some pure object oriented languages?
140.
What is a node class in c++?
141.
What is an orthogonal base class in C++?
142.
What is a container class? What are the types of container classes in C++?
143.
How do you write a function that can reverse a linked-list in C++?
144.
What is polymorphism in C++?
145.
How do you find out if a linked-list has an end? (i.e. the list is not a cycle)
146.
How can you tell what shell you are running on UNIX system?
147.
What is Boyce Codd Normal form?
148.
What is pure virtual function?
149.
Write a Struct Time where integer m, h, s are its members
150.
How do you traverse a Btree in Backward in-order?
151.
What is the two main roles of Operating System?
152.
In the derived class, which data member of the base class are visible?
153.
How do you find out if a linked-list has an end? (i.e. the list is not a cycle)
154.
What is the difference between realloc() and free()?
155.
What is function overloading and operator overloading?
156.
What is the difference between declaration and definition?
157.
What are the advantages of inheritance in C++?
158.
How do you write a function that can reverse a linked-list?
159.
What do you mean by inline function?
160.
Write a program that ask for user input from 5 to 9 then calculate the average
161.
Write a short code using C++ to print out all odd number from 1 to 100 using a for loop
162.
What is public, protected, private in C++?
163.
Write a function that swaps the values of two integers, using int* as the argument type.
164.
Tell how to check whether a linked list is circular.
165.
What is virtual constructors/destructors?
166.
What is the difference between an ARRAY and a LIST?
167.
Does c++ support multilevel and multiple inheritance?
168.
What is a template in C++?
169.
Define a constructor - What it is and how it might be called (2 methods).
170.
You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. new() and malloc()
171.
What is the difference between class and structure in C++?
172.
What is RTTI in C++?
173.
What is encapsulation in C++?
174.
What is a C++ object?
175.
Describe PRIVATE, PROTECTED and PUBLIC – the differences and give examples.
176.
What is C++ namespace?
177.
What do you mean by inheritance?
178.
What is a COPY CONSTRUCTOR and when is it called?
179.
What is Boyce Codd Normal form in C++?
180.
What is virtual class and friend class?
181.
What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?
182.
What do you mean by binding of data and functions?
183.
What are 2 ways of exporting a function from a DLL?
184.
What is the difference between an object and a class?
185.
Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].
186.
What is a C++ class?
187.
What is friend function in C++?
188.
Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?
189.
What is abstraction in C++?
190.
What are virtual functions in C++?
191.
What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator.
192.
What is a scope resolution operator?
193.
What do you mean by pure virtual functions?
194.
What is polymorphism in C++? Explain with an example?
195.
How can you quickly find the number of elements stored in a a) static array b) dynamic array ?
Why is it difficult to store linked list in an array?
How can you find the nodes with repetetive data in a linked list?
196.
What is the output of the following program? Why?
197.
Why are arrays usually processed with for loop?
198.
What is an HTML tag?
199.
Explain which of the following declarations will compile and what will be constant ...
200.
You are given a simple code for the class BankCustomer. Write the following functions ...
201.
What problems might the following macro bring to the application?
202.
Anything wrong with this code?
T *p = new T[10];
delete p;
203.
Anything wrong with this code?
T *p = 0;
delete p;
204.
How do you decide which integer type to use?
205.
What is the best way to declare and define global variables?
206.
What does extern mean in a function declaration?
207.
What can I safely assume about the initial values of variables which are not explicitly initialized?
208.
What is the difference between char a[] = “string?; and char *p = “string?;?
209.
What is the auto keyword good for in C++?
210.
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
211.
What does extern mean in a function declaration in C++?
212.
How do I initialize a pointer to a function?
213.
How do you link a C++ program to C functions?
214.
Explain the scope resolution operator.
215.
What are the differences between a C++ struct and C++ class?
216.
How many ways are there to initialize an int with a constant?
217.
How does throwing and catching exceptions differ from using setjmp and longjmp?
218.
What is a default constructor in C++?
219.
What is a conversion constructor C++?
220.
What is the difference between a copy constructor and an overloaded assignment operator?
221.
When should you use multiple inheritance?
222.
Explain the ISA and HASA class relationships. How would you implement each in a class design?
223.
When is a template a better solution than a base class?
224.
What is a mutable member?
225.
What is an explicit constructor?
226.
What is the Standard Template Library (STL)?
227.
Describe run-time type identification.
228.
What problem does the namespace feature solve?
229.
Are there any new intrinsic (built-in) data types?
230.
Will the following program execute?
231.
Will this C++ program execute or not?
232.
What is the difference between Mutex and Binary semaphore?
233.
In C++, what is the difference between method overloading and method overriding?
234.
What methods can be overridden in Java?
235.
What are the defining traits of an object-oriented language?
236.
Can you be bale to identify between Straight- through and Cross- over cable wiring? and in what case do you use Straight- through and Cross-over?
237.
If you hear the CPU fan is running and the monitor power is still on, but you did not see any thing show up in the monitor screen. What would you do to find out what is going wrong?
238.
Assignment Operator - What is the diffrence between a "assignment operator" and a "copy constructor"?
239.
RTTI - What is RTTI in C++?
240.
STL Containers - What are the types of STL containers?