Cpp Interview Questions, Object-Oriented Programming Questions
Hello guys, welcome back to my blog. In this article, I will discuss Cpp interview questions, object-oriented programming interview questions asked during interviews, OOPs interview questions, etc.
If you have any doubts related to electrical, electronics, and computer science, then ask question. You can also catch me @ Instagram – Chetan Shidling.
Also, read:
- 1000+ Interview Questions On Java, Java Interview Questions, Freshers.
- Difference Between Structured, Unstructured, And Semi-structured Data.
- What Is MongoDB, Tutorial On MongoDB, CURD Operation In MongoDB.
Cpp Interview Questions
02. Explain the features of object oriented programming?
03. List out the basic concepts of OOPs. Explain Objects and Classes?
04. With neat diagram, explain the basic idea of Inheritance and Polymorphism?
05. Explain the benefits of OOPs?
07. Write a C++ program to define a class to read name and age of a person and display them on screen?
09. Explain the benefits of using classes in C++ over the limitations of structures in C?
11. Explain how member functions are defined for a class. Demonstrate with a C++ program?
12. Explain how member functions are defined for a class. Demonstrate with a C++ program?
15. Explain the output of this program?
#include<iostream.h>
using namespace std;
class sample { int x; }
int main() {sample obj; obj.x=100; cout<<“x=”<<obj.x<<endl;}
16. Write C++ program to read time in HH:MM:SS format and convert into total seconds using class?
18. Explain the use of scope resolution operator in C++? Give an example?
20. Write a C++ program to demonstrate the use of inline and friend functions?
23. Explain parameterized constructor? How is it useful?
24. Differentiate between a default constructor and copy constructor, giving suitable examples of each?
28. Write a C++ program to demonstrate how to dynamically create single or multiple objects?
29. Define smart pointer. Justify, how smart pointer is different from delete operator?
30. Define Exception. Explain how exceptions are handled in C++?
31. Discuss the advantages of using exception handling mechanisms in a program?
32. Explain when a catch(…) handler is used?
33. Explain try/catch block to handle arithmetic exceptions?
34. Write a C++ program to demonstrate the concept of rethrowing an exception?
35. Write a C++ program that illustrates the application of multiple catch blocks?
38. Explain the virtual base class. When do we make a class virtual. Justify with the help of program?
39. Define abstract classes. Write a C++ program to demonstrate the use of abstract classes in C++?
43. Define pointer and this pointer. What does this pointer point to?
44. List the applications of this pointer?
45. Explain how a pointer can point to an object created by a class?
46. Explain pointers to derived class?
47. Explain virtual functions and list the rules for virtual functions?
48. Explain when to make a virtual function “pure”?
49. True or false: A pointer to a base class can point to objects of a derived class?
50. Explain constructor overloading?
51. Discuss the usage of function overloading?
52. Discuss how a function is different from an overloaded function?
53. Explain operator overloading and list the restrictions and limitations of operator overloading?
54. Write a C++ program to demonstrate the concept of Unary operator?
55. Write a C++ program to demonstrate the concept of binary operator?
56. Write a C++ program to demonstrate the concept of function overloading?
57. Write a C++ program to demonstrate the concept of constructor overloading?
59. Explain generic programming and how it is implemented in C++?
60. Differentiate between overloaded function and function templates?
61. Write C++ program to display largest among two numbers using function templates?
62. Write C++ program to add, subtract, multiply and divide two numbers using class template?
63. Define STL is C++. Explain the core components of STL?
64. What are containers in C++. Explain the containers supported by C++?
65. Write a C++ program to demonstrate use of vector class?
66. Define and explain iterators and its characteristics?
67. What are the different modes of inheritance?
68. What is private mode inheritance in Cpp?
69. What is protected mode inheritance in Cpp?
70. What is public mode inheritance in Cpp?
71. What is Compile time Polymorphism in Cpp?
72. What is Runtime Polymorphism in Cpp?
73. Difference between global and local variable?
75. What is inline function and why it is used?
76. What is friend function and why it is used?
I hope this article “Cpp Interview Questions” may help you all a lot. Thank you for reading “Cpp Interview Questions”.
Also, read:
- 100+ C Programming Projects With Source Code, Coding Projects Ideas
- 1000+ Interview Questions On Java, Java Interview Questions, Freshers
- App Developers, Skills, Job Profiles, Scope, Companies, Salary
- Applications Of Artificial Intelligence (AI) In Renewable Energy
- Applications Of Artificial Intelligence, AI Applications, What Is AI
- Applications Of Data Structures And Algorithms In The Real World
- Array Operations In Data Structure And Algorithms Using C Programming
- Artificial Intelligence Scope, Companies, Salary, Roles, Jobs