50 C++ Interview Questions

Interview Questions

Interview Questions

I have compiled a list of repeatedly asking C++ interview questions here. Some of them are very important C++ questions asked by employers like Microsoft, Adobe and IBM. This list has been updated to include few more questions.

    1. How do you check whether a linked list is circular?
    2. How do you decide which integer type to use?
    3. How do you differentiate between a constructor and destructor?
    4. How do you differentiate between aggregation and association?
    5. How do you find out the size of a class?
    6. How do you implement an itoa function?
    7. How do you initialize a pointer to a function?
    8. How do you link a C++ program to C functions?
    9. How do you return a structure from functions?
    10. How do you write a function that can reverse a linked-list?
    11. What are the benefits of using exceptions in C++?
    12. What are the differences between a struct and a class in C++?
    13. What are the different types of Storage classes?
    14. What do you mean by inline function?
    15. What does extern mean in a function declaration?
    16. What does it mean to declare a function or variable as static?
    17. What is a conversion constructor?
    18. What is a copy constructor?
    19. What is a namespace?
    20. What is a pure virtual function?
    21. What is a scope resolution operator?
    22. What is abstraction?
    23. What is difference between #define and const?
    24. What is difference between function overloading and overriding?
    25. What is encapsulation?
    26. What is function overloading?
    27. What is multiple inheritance?
    28. What is operator overloading?
    29. What is partial specialization or template specialization?
    30. What is polymorphism?
    31. What is the difference between “passing by value” and “passing by reference”?
    32. What is the difference between an object and a class?
    33. What is the difference between declaration and definition?
    34. What is the difference between delete and delete[]?
    35. What is the difference between inner class and abstract class?
    36. What is the difference between persistent & non-persistent objects?
    37. What is the difference between structure and union?
    38. What is the difference between the deep copy and shallow copy?
    39. What is the difference between the private public and protected members?
    40. What is the maximum size that an array can hold?
    41. What is the most efficient way to reverse a linked-list?
    42. What is the size of an empty class?
    43. What is the use of virtual destructor?
    44. What is virtual class and friend class?
    45. What’s the best way to declare and define global variables?
    46. Where is memory for class-object allocated?
    47. Where is memory for struct allocated?
    48. Why an array always starts with index zero in C++?
    49. What is the block scope variable in C++?
    50. What is a class template?
    51. Does an abstract class in C++ need to hold all pure virtual functions?
    52. What is the order of objects destroyed in the memory?

 

Categories: Blog
M. Saqib: Saqib is Master-level Senior Software Engineer with over 14 years of experience in designing and developing large-scale software and web applications. He has more than eight years experience of leading software development teams. Saqib provides consultancy to develop software systems and web services for Fortune 500 companies. He has hands-on experience in C/C++ Java, JavaScript, PHP and .NET Technologies. Saqib owns and write contents on mycplus.com since 2004.
Related Post