C++ Interview Questions

Top C++ Interview Questions for Freshers & College Students

Top 25 Latest C++ Interview Questions

  1. What’s the deal with constructors?
  2. Which constructor gets called when I create an array of Fred objects?
  3. Should my constructors use “initialization lists” or “assignments”?
  4. Is there any difference between List x; and List x();?
  5. Can one constructor of a class call another constructor of the same class to initialize this object?
  6. Is the default constructor of the same class to initialize this object?
  7. Should my class declare a member function or a friend function?
  8. What does it mean that “friendship is not inherited, transitive or reciprocal”?
  9. What are some advantages/disadvantages of using friend functions?
  10. Do friend functions violates encapsulation?

Also read: Most important questions in c for bca and bscit

  1. Construct a program to demonstrate how a class first has granted its friendship to the class second to access the private data of the class first through the public member function of the class second.
  2. Various Operations that can be performed casins file handling/ stream class.
  3. What do you mean by the OOPS function?
  4. Explain the concept of Exceptions Handling. Discuss try, catch, and throw using a suitable program.
  5. What are virtual function modes in which a file can be accessed with the help of a simple program?
  6. Explain the various mode in which a file can be accessed with the help of a simple program.
  7. How do the properties of the following two derived classes differ?
    1. class X: public A{//..}
    2. class Y: private A{//..}
  8. What is Generic Programming? Explain with example.
  9. Write a program to show the overloading of function templates.
  10. What do you mean by operator overloading? Explain the concept of operator overloading using the program of the binary operator.
  11. Discuss Inline function with syntax.
  12. Write a program to show the functioning of static members’ functions.
  13. What is the need of a friend function? Also, discuss the concept of a friend? Also, discuss the concept of friend class with syntax.
  14. Define a class to represent a bank account.
    • Its contain Data Members:
    • Name of the depositor
    • Account Number
    • Type of the account balance
    • Members Function
    • To assign initial values
    • To deposit an amount
    • To withdraw an account, the amount available
    • Display the name and balance.
  15. Write a program that demonstrates hierarchical inheritance to get square and cube of a number in c++ programming language.

C++ Interview Questions for Freshers & College Students for free. Mostly appeared questions in exam and interview.

Leave a Comment