Here is a compilation of most frequently asked CPP programs for interviews. These programs are generally asked in technical rounds or coding rounds.
You are more than welcome to suggest other solutions for the below listed C++ programs. To suggest a solution, click the C++ program link and write your program / solution as a comment.
C++ Programs List
Arrays
Classes and Objects
- CPP program to illustrate this pointer
- Cpp program to create objects of distance class and add them
- CPP program using friend function
- Cpp program to illustrate the use of constructor and destructor
- Cpp program demonstrating a bank account
- CPP program for illustrating function overloading in adding the distance between objects
- CPP program to illustrate pointer to a class
- CPP program for illustrating access specifiers
Exception Handling
Functions
- Cpp program to illustrate function overloading by adding two numbers
- CPP program to illustrate function overloading
- CPP program to illustrate inline functions
- CPP program to demonstrate the use of default arguments
- Call By Value and Call By Reference Program in C++
Inheritance
- CPP program to illustrate the order of execution of constructors and destructors in inheritance
- CPP program to implement virtual base class
- CPP program to show how constructors are invoked in derived class
- Pure Virtual Function Program in C++
Polymorphism
- CPP program to overload assignment operator
- CPP program to overload binary operator using non member function
- CPP program to overload unary operator using member function
- CPP program to demonstrate runtime polymorphism
STL (Standard Template Library)
Templates (Generics)
- CPP program to illustrate template class
- CPP program to illustrate class template with multiple parameters
- Cpp program to create a function template to swap two numbers
- CPP program to create a function template for power of a number
- CPP program to illustrate member function template
Others
- CPP program to illustrate enumerations
- CPP program to print Hello World
- CPP program for if else statement
- CPP program to calculate the fare for the passengers travelling in a bus
- CPP for loop program
- CPP program to add three numbers
- CPP program to calculate simple interest and compound interest
- CPP program to illustrate scope resolution operator
- CPP program to print your name
- CPP program to display basic data type values
Suryateja Pericherla, at present is a Research Scholar (full-time Ph.D.) in the Dept. of Computer Science & Systems Engineering at Andhra University, Visakhapatnam. Previously worked as an Associate Professor in the Dept. of CSE at Vishnu Institute of Technology, India.
He has 11+ years of teaching experience and is an individual researcher whose research interests are Cloud Computing, Internet of Things, Computer Security, Network Security and Blockchain.
He is a member of professional societies like IEEE, ACM, CSI and ISCA. He published several research papers which are indexed by SCIE, WoS, Scopus, Springer and others.
Hello,
Thank you for this interview question you cover all the things very carefully this will be very helpful for all who want to make career in this field…I used to follow you blog since long time.looking forward for some more blogs from you..Thank you once again
I need c++ unit materials.
They are available here