Skip to main content

C++ FAQ's

"C++/OOPS Programming" Questions With Answers".


Here, are some sample questions based on "C++/OOPS Programming Language". Read it carefully as these questions will improve your basic concept on C++/OOPS programming language, and will help you in cracking any interview.

Click on any question to find out it's answers:


1) What is a class ?
2) What is an object ?
3) List the advantages of object oriented programming ?
4) What is meant by 'call by value' ?
5) What is meant by 'call by reference' ?


6) What is a reference variable ? What is its use ?
7) What are inline functions ? What is the advantage of using them ? How are they declared ?
8) What are the defining traits of an object-oriented language ?
9) What is the purpose of the scope resolution operator ?
10) What are the differences between type casting and automatic type conversion ?


11) Why ‘char’ is often considered as an integer data type ?
12) What is the difference between structure and class in C++ ?
13) What is the purpose of ios:app ?
14) What is the purpose of ios::ate ?
15) How is random access of data achieved in C++ ?


16) Which header file is required for creating and manipulating data files in C++ ?
17) What is an access specifier ?
18) How is memory allocated to a class and its objects ?
19) What is the difference between an object and a class ?
20) Differentiate between data hiding and encapsulation ?


21) What is polymorphism? Explain with an example ?
22) What is public, protected and private ?
23) What is the significance of the protected access specifier ?
24) Do 'derivation' and 'friendship' mean the same ?
25) Enlist some advantages of object oriented programming ?


26) Is prototyping mandatory in C++ ? Why ?
27) When should a function be made inline ?
28) How is a static variable different from a static function ?
29) What is meant by macro ?
30) What do you mean by inline function?


31) What is a constructor? Why would I ever use one?
32) What are destructors really for? Why would I ever use them?
33) Is a default constructor equivalent to a constructor having default arguments?
34) Why is a destructor function required in a class?
35) What is a parameterized constructor?


36) What is a copy constructor?
37) What is a default constructor? What is its role?
38) What is meant by constructor overloading?
39) What is operator overloading?
40) What operators can/cannot be overloaded?


41) How is operator overloading implemented successfully in C++?
42) What is abstract class?
43) What is concrete class?
44) What is function overloading and operator overloading?
45) What is a ‘friend’ function?


46) Do ‘friends’ violate encapsulation?
47) What are some advantages/disadvantages of using friends?
48) What do you mean by the friend function and friend class?
49) Why should I use `new' instead of trustworthy old malloc()?
50) How do I allocate / unallocate an array of things?


51) What if I forget the `[ ]' when `delete'ing array allocated via `new X[n]'?
52) What are free store operators?
53) What do you mean by free storage list or AVAIL list?
54) What is meant by static memory allocation?
55) What is dynamic memory allocation?


56) Define free store ?
57) What do you mean by a self referential structure?
58) What is inheritance? What the types of inheritance?
59) What are the different types of inheritances?
60) What is the difference between a virtual base class and a normal base class?


61) What is meant by a visibility mode?
62) What's the difference between `public:', `private:', and `protected:' visibility modes?
63) When should you use inheritances?
64) How do you express `private inheritance'?
65) What are the access rules with `private' and `protected' inheritance?


66) What is meant by inheritance hierarchy ?
67) Differentiate between multiple and multilevel inheritances ?
68) What is an ABC (`Abstract Base Class') ?
69) What is a `virtual destructor' ?
70) What is a dangling pointer or wild pointers ?


71) What is abstraction?
72) How is abstraction and encapsulation interrelated?
73) What is an adaptor class or Wrapper class?
74) What is a container class? What are the types of container classes?
75) What is polymorphism?


76) What do you mean by a static data member and a static member function?
77) What is modularity in C++?
78) What do you mean by data abstraction?
79) What is a pointer? How will you define a pointer to an integer and a pointer to a character?
80) How does a pointer variable differ from a simple variable?


81) What is a nested structure ?
82) How are arrays and structures related to each other ?
83) What is the difference between structure and class?
84) What is the difference between get and getline member functions ?
85) Differentiate between ifstream class and ofstream class?


86) Name the streams generally used for file operations.
87) What do you mean by ‘this’ pointer?
88) What is a data structure?
89) List four major operations associated with linear data structures?
90) What are trees in C++?


91) State conditions under which binary search is applicable.
92) What is a linked list?
93) Differentiate between functions read() and write().
94) What is a null pointer?
95) What is a memory leak?

96) What is a stack?
97) What is meant by overflow in C++?
98) What is an infix expression?
99) What do you mean by static binding?
100) What do you mean by a node?


Comments

Popular posts from this blog

Tell Me Something About Yourself - Interview Answers.

Try to introduce some of your most important employment-oriented skills as well as your education and accomplishments to the interviewer. Answer to this question is very important because it positions you for the rest of the interview . That's why this statement is often called the "Positioning Statement". One should take the opportunity to show his/her communication skills by speaking clearly and concisely in an organized manner. Since there is no right or wrong answer for this question hence it is important to appear friendly. YOUR ANSWERS CAN BE: 1) I am a person with strong interpersonal skills and have the ability to get along well with people . I enjoy challenges and looking for creative solutions to problems. 2) Besides the details given in my resume, I believe in character values, vision and action. I am quick in learning from mistakes. I am confident that the various tests that you have conducted will corroborate my competencies apti...

What Is (Are) Your Weakness (Weaknesses)? - Interview Answers

There’s a saying – “However small the thorn maybe it has the ability to pierce.” Never say you are a Workaholic, a Perfectionist, etc. because it sounds negative. Try to convert these negative biased qualities into positive ones. For Example, In   place of Workaholic you can say you are a hard worker and always willing to work for extra hours. In place of Perfectionist , you can say you are detail oriented and like to set high standard for work. “Try to specify your weakness as your strength and also highlight it as a benefit.” Your answers can be: 1) One of my weaknesses as I perceive is occasional compromise on time for quality and perfection. 2) I feel I am not very detail-oriented . I’m a person that wants accomplish as much as possible. I realized this hurts quality and therefore I‘m trying hard to find a balance between quality and quantity. 3) At times even when I need help, I try to solve my own problems instead of asking a co-worker who might know...

What Is (Are) Your Strengths? - Interview Answers

This is a simple and popular interview question. Generally people answer it in two ways. There are people who simply state their strength like “I am Young, Dynamic, Intelligent, Smart and so on…”. Such answer is neither right nor wrong but does not help u in any way also. Secondly there are peoples who state their strengths and explain them how he can use his strength for the job and industry. Do not simply state your strength. Everyone has some strength, all you need is to convert them into benefits. In short, try to advertise yourself by converting your features into strengths. “EVERYONE CLAIM THEY ARE HONEST, HARDWORKING, SMART AND SO ON….. BUT WITH AN EXAMPLE IT IS MUCH MORE BELIEVABLE.” Your answers can be : 1) I am a hard worker and because of this ability I can work for additional hours to accomplish my tasks.I am commitment oriented and hence I always enjoy the trust and confidence of my team mates which enables me to perform my duties very easily. 2) I am a...