Tuesday, May 09, 2006

C /C++ interview questions..

  1. What is the output of printf("%d")
  2. What will happen if I say delete this
  3. What is Dangling pointer?
  4. Difference between "C structure" and "C++ structure".
  5. Diffrence between a "assignment operator" and a "copy constructor"
  6. What is the difference between "overloading" and "overridding"?
  7. Explain the need for "Virtual Destructor".
  8. Can we have "Virtual Constructors"?
  9. What are the different types of polymorphism?
  10. What are Virtual Functions? How to implement virtual functions in "C"
  11. What are the different types of Storage classes?
  12. What is Namespace?
  13. What are the types of STL containers?.
  14. Is there any difference between a messageand method?
  15. If I ask you to write 'VI' editor in C++ - How you'll proceed?
  16. Difference between char name[] = “prashant n mhatre”; and char *name = “prashant n mhatre”;
  17. Should we use global variables?
  18. Parsing HTML or XML document with C++
  19. What is 'self assignment'?
  20. Difference between how virtual and non-virtual member functions are called
  21. Finding shortest path aka Dijkstra's algorithm and backtracking
  22. Doing permutations and combinations in C++

  23. Difference between "vector" and "array"?
  24. How to write a program such that it will delete itself after exectution?
  25. Can we generate a C++ source code from the binary file?
  26. What are inline functions?
  27. Talk sometiming about profiling?
  28. How many lines of code you have written for a single program?
  29. What is "strstream" ?
  30. How to write Multithreaded applications using C++?
  31. Explain "passing by value", "passing by pointer" and "passing by reference"
  32. Write any small program that will compile in "C" but not in "C++"
  33. Have you heard of "mutable" keyword?
  34. What is a "RTTI"?
  35. Is there something that I can do in C and not in C++?
  36. Why preincrement operator is faster than postincrement?
  37. What is the difference between "calloc" and "malloc"?
  38. What will happen if I allocate memory using "new" and free it using "free" or allocate sing "calloc" and free it using "delete"?
  39. What is Memory Alignment?
  40. Explain working of printf.
  41. Difference between "printf" and "sprintf".
  42. What is "map" in STL?
  43. When shall I use Multiple Inheritance?
  44. What are the techniques you use for debugging?
  45. How to reduce a final size of executable?
  46. Give 2 examples of a code optimization.

No comments: