This document lists 35 C/C++ interview questions covering a variety of topics:
1. Output formats, data types, and memory allocation.
2. Differences between structures, assignment operators, copy constructors, overloading, overriding, and polymorphism.
3. Concepts like virtual destructors, virtual functions, storage classes, namespaces, STL containers, vectors versus arrays.
4. Self-deleting programs, code generation from binaries, inline functions, profiling, multithreading, passing parameters, mutable keywords, RTTI, and differences between C and C++ capabilities.
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
83 views
C/C++ Interview Questions
This document lists 35 C/C++ interview questions covering a variety of topics:
1. Output formats, data types, and memory allocation.
2. Differences between structures, assignment operators, copy constructors, overloading, overriding, and polymorphism.
3. Concepts like virtual destructors, virtual functions, storage classes, namespaces, STL containers, vectors versus arrays.
4. Self-deleting programs, code generation from binaries, inline functions, profiling, multithreading, passing parameters, mutable keywords, RTTI, and differences between C and C++ capabilities.
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1
C/C++ Interview Questions
1. What is the output of printf("%d")
2. Difference between "C structure" and "C++ structure". 3. Difference between a "assignment operator" and a "copy constructor" 4. What is the difference between "overloading" and "overriding"? 5. Explain the need for "Virtual Destructor". 6. Can we have "Virtual Constructors"? 7. What are the different types of polymorphism? 8. What are Virtual Functions? How to implement virtual functions in "C" 9. What are the different types of Storage classes? 10. What is Namespace? 11. What are the types of STL containers?. 12. Difference between "vector" and "array"? 13. How to write a program such that it will delete itself after execution? 14. Can we generate a C++ source code from the binary file? 15. What are inline functions? 16. Talk something a out profiling? 17. How many lines of code you have written for a single program? 18. What is "strstream" ? 19. How to write Multithreaded applications using C++? 20. Explain "passing by value", "passing by pointer" and "passing by reference" 21. Write any small program that will compile in "C" but not in "C++" 22. Have you heard of "mutable" keyword? 23. What is a "RTTI"? 24. Is there something that I can do in C and not in C++? 25. Why preincrement operator is faster than postincrement? 26. What is the difference between "calloc" and "malloc"? 27. What will happen if I allocate memory using "new" and free it using "free" or allocate using "calloc" and free it using "delete"? 28. What is Memory Alignment? 29. Explain working of printf. 30. Difference between "printf" and "sprintf". 31. What is "map" in STL? 32. When shall I use Multiple Inheritance? 33. What are the techniques you use for debugging? 34. How to reduce a final size of executable? 35. Give 2 examples of a code optimization.