91 C++ Interview Questions

While different interviewers may ask distinctive questions, it always helps to be prepared for severe grilling. So we have to drawn up a list of frequently asked 91 C++ interview questions. Read all the questions and prepare answers dotted with examples for success in the job interview.

  1. What is C++?
  2. What are the differences between C and C++?
  3. What is the difference between realloc() and free()?
  4. How do you find out if a linked-list has an end?
  5. What is function overloading and operator overloading?
  6. What are the advantages of inheritance?
  7. What is the difference between declaration and definition?
  8. How do you write a function that can reverse a linked-list?
  9. What do you mean by inline function?
  10. Write a short code using C++ to print out all odd number from 1 to 100 using a for loop
  11. Write a program that ask for user input from 5 to 9 then calculate the average
  12. What is public, protected, private?
  13. Tell how to check whether a linked list is circular.
  14. What is virtual constructors/destructors?
  15. What is the difference between declaration and definition?
  16. What is the difference between an ARRAY and a LIST?
  17. Does c++ support multilevel and multiple inheritance?
  18. Define a constructor?
  19. What is a template?
  20. What is the difference between class and structure?
  21. What is RTTI?
  22. What is encapsulation?
  23. What is an object?
  24. How can you tell what shell you are running on UNIX system?
  25. What do you mean by inheritance?
  26. Describe PRIVATE, PROTECTED and PUBLIC
  27. What is namespace?
  28. What is a COPY CONSTRUCTOR and when is it called?
  29. What is Boyce Codd Normal form?
  30. What is virtual class and friend class?
  31. What do you mean by binding of data and functions?
  32. What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?
  33. What do you mean by binding of data and functions?
  34. What is the difference between an object and a class?
  35. What are 2 ways of exporting a function from a DLL?
  36. What is the difference between an object and a class?
  37. What is a class?
  38. What is friend function?
  39. What is abstraction?
  40. Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?
  41. What are virtual functions?
  42. What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator?
  43. What do you mean by pure virtual functions?
  44. What is a scope resolution operator?
  45. What is polymorphism? Explain with an example?
  46. What’s the output of the following program? Why?
  47. Why are arrays usually processed with for loop?
  48. Explain which of the following declarations will compile and what will be constant - a pointer or the value pointed at: * const char * * char const * * char * const
  49. What problems might the following macro bring to the application?
  50. Anything wrong with this code? T *p = 0; delete p;
  51. How do you decide which integer type to use?
  52. What’s the auto keyword good for?
  53. What is the difference between char a[] = “string”; and char *p = “string”;?
  54. What can I safely assume about the initial values of variables which are not explicitly initialized?
  55. What does extern mean in a function declaration?
  56. How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
  57. How do I initialize a pointer to a function?
  58. How do you link a C++ program to C functions?
  59. How many ways are there to initialize an int with a constant?
  60. What are the differences between a C++ struct and C++ class?
  61. What is a default constructor?
  62. How does throwing and catching exceptions differ from using setjmp and longjmp?
  63. What is a conversion constructor?
  64. What is the difference between a copy constructor and an overloaded assignment operator?
  65. When should you use multiple inheritance?
  66. Explain the ISA and HASA class relationships. How would you implement each in a class design?
  67. When is a template a better solution than a base class?
  68. What is an explicit constructor?
  69. What is a mutable member?
  70. What is the Standard Template Library (STL)?
  71. What problem does the namespace feature solve?
  72. Describe run-time type identification
  73. Are there any new intrinsic (built-in) data types?
  74. What is the difference between Mutex and Binary semaphore?
  75. What methods can be overridden in Java?
  76. What are the defining traits of an object-oriented language?
  77. Write a program that ask for user input from 5 to 9 then calculate the average.
  78. What is the diffrence between a "assignment operator" and a "copy constructor"?
  79. What is RTTI?
  80. What are the types of STL containers?
  81. What is the need for a Virtual Destructor?
  82. What is "mutable"?
  83. What is a modifier?
  84. What is an accessor?
  85. Define namespace.
  86. When does a name clash occur?
  87. Differentiate between a template class and class template.
  88. What is an Iterator class?
  89. What is the use of ‘using’ declaration?
  90. What is a dangling pointer?
  91. What is an incomplete type?