Interview Questions in Opbject Oriented Concepts (OOPS)

  1. How do you write a program which produces its own source code as its output?
  2. How can I find the day of the week given the date?
  3. Why doesn't C have nested functions?
  4. What is the most efficient way to count the number of bits which are set in a value?
  5. How can I convert integers to binary or hexadecimal?
  6. How can I call a function, given its name as a string?
  7. How do I access command-line arguments?
  8. How can I return multiple values from a function?
  9. How can I invoke another program from within a C program?
  10. How can I access memory located at a certain address?
  11. How can I allocate arrays or structures bigger than 64K?
  12. How can I find out how much memory is available?
  13. How can I read a directory in a C program?
  14. How can I increase the allowable number of simultaneously open files?
  15. What's wrong with the call "fopen("c:\newdir\file.dat", "r")"?
  16. What is the output of printf("%d")
  17. What will happen if I say delete this
  18. Difference between "C structure" and "C++ structure".
  19. Diffrence between a "assignment operator" and a "copy constructor"
  20. What is the difference between "overloading" and "overridding"?
  21. Explain the need for "Virtual Destructor".
  22. Can we have "Virtual Constructors"?
  23. What are the different types of polymorphism?
  24. What are Virtual Functions? How to implement virtual functions in "C"
  25. What are the different types of Storage classes?
  26. What is Namespace?
  27. What are the types of STL containers?.
  28. Difference between "vector" and "array"?
  29. How to write a program such that it will delete itself after exectution?
  30. Can we generate a C++ source code from the binary file?
  31. What are inline functions?
  32. Talk sometiming about profiling?
  33. How many lines of code you have written for a single program?
  34. What is "strstream" ?
  35. How to write Multithreaded applications using C++?
  36. Explain "passing by value", "passing by pointer" and "passing by reference"
  37. Write any small program that will compile in "C" but not in "C++"
  38. Have you heard of "mutable" keyword?
  39. What is a "RTTI"?
  40. Is there something that I can do in C and not in C++?
  41. Why preincrement operator is faster than postincrement?
  42. What is the difference between "calloc" and "malloc"?
  43. What will happen if I allocate memory using "new" and free it using "free" or allocate sing "calloc" and free it using "delete"?
  44. What is Memory Alignment?
  45. Explain working of printf.
  46. Difference between "printf" and "sprintf".
  47. What is "map" in STL?
  48. When shall I use Multiple Inheritance?
  49. What are the techniques you use for debugging?
  50. How to reduce a final size of executable?
  51. Give 2 examples of a code optimization.
  52. What is inheritance?
  53. Difference between Composition and Aggregation.
  54. Difference: Sequence Diagrams, Collaboration Diagrams.
  55. Difference: 'uses', 'extends', 'includes'
  56. What shall I go for Package Diagram?
  57. What is Polymorphism?
  58. Is class an Object? Is object a class?
  59. Comment: C++ "includes" behavior and java "imports"
  60. What do you mean by "Realization"?
  61. What is a Presistent, Transient Object?
  62. What is the use of Operator Overloading?
  63. Does UML guarantee project success?
  64. Difference: Activity Diagram and Sequence Diagram.
  65. What is association?
  66. How to resolve many to many relationship?
  67. How do you represent static members and abstract classes in Class Diagram?
  68. What does static variable mean?
  69. What is a pointer?
  70. What is a structure?
  71. What are the differences between structures and arrays?
  72. In header files whether functions are declared or defined?
  73. What are the differences between malloc() and calloc()?
  74. What are macros? what are its advantages and disadvantages?
  75. Difference between pass by reference and pass by value?
  76. What is static identifier?
  77. Where are the auto variables stored?
  78. Where does global, static, local, register variables, free memory and C Program instructions get stored?
  79. Difference between arrays and linked list?
  80. What are enumerations?
  81. Describe about storage allocation and scope of global, extern, static, local and register variables?
  82. What are register variables? What are the advantage of using register variables?
  83. What is the use of typedef?
  84. Can we specify variable field width in a scanf() format string? If possible how?
  85. Out of fgets() and gets() which function is safe to use and why?
  86. Difference between strdup and strcpy?
  87. What is recursion?
  88. Differentiate between a for loop and a while loop? What are it uses?
  89. What are the different storage classes in C?
  90. Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?
  91. What is difference between Structure and Unions?
  92. What the advantages of using Unions?
  93. What are the advantages of using pointers in a program?
  94. What is the difference between Strings and Arrays?
  95. In a header file whether functions are declared or defined?
  96. What is a far pointer? where we use it?
  97. How will you declare an array of three function pointers where each function receives two ints and returns a float?
  98. What is a NULL Pointer? Whether it is same as an uninitialized pointer?
  99. What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?
  100. What does the error 'Null Pointer Assignment' mean and what causes this error?
  101. What is near, far and huge pointers? How many bytes are occupied by them?
  102. How would you obtain segment and offset addresses from a far address of a memory location?
  103. Are the expressions arr and &arr same for an array of integers?
  104. Does mentioning the array name gives the base address in all the contexts?
  105. Explain one method to process an entire string as one unit?
  106. What is the similarity between a Structure, Union and enumeration?
  107. Can a Structure contain a Pointer to itself?
  108. How can we check whether the contents of two structure variables are same or not?
  109. How are Structure passing and returning implemented by the complier?
  110. How can we read/write Structures from/to data files?
  111. What is the difference between an enumeration and a set of pre-processor # defines?
  112. What do the 'c' and 'v' in argc and argv stand for?
  113. Are the variables argc and argv are local to main?
  114. What is the maximum combined length of command line arguments including the space between adjacent arguments?
  115. If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?
  116. Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?
  117. What are bit fields? What is the use of bit fields in a Structure declaration?
  118. To which numbering system can the binary number 1101100100111100 be easily converted to?
  119. Which bit wise operator is suitable for checking whether a particular bit is on or off?
  120. Which bit wise operator is suitable for turning off a particular bit in a number?
  121. Which bit wise operator is suitable for putting on a particular bit in a number?
  122. Which bit wise operator is suitable for checking whether a particular bit is on or off?
  123. Which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?
  124. Write a program to compare two strings without using the strcmp() function.
  125. Write a program to concatenate two strings.
  126. Write a program to interchange 2 variables without using the third one.
  127. Write programs for String Reversal & Palindrome check
  128. Write a program to find the Factorial of a number
  129. Write a program to generate the Fibinocci Series
  130. Write a program which employs Recursion
  131. Write a program which uses Command Line Arguments
  132. Write a program which uses functions like strcmp(), strcpy()? etc
  133. What are the advantages of using typedef in a program?
  134. How would you dynamically allocate a one-dimensional and two-dimensional array of integers?
  135. How can you increase the size of a dynamically allocated array?
  136. How can you increase the size of a statically allocated array?
  137. When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
  138. Which function should be used to free the memory allocated by calloc()?
  139. How much maximum can you allocate in a single call to malloc()?
  140. Can you dynamically allocate arrays in expanded memory?
  141. What is object file? How can you access object file?
  142. Which header file should you include if you are to develop a function which can accept variable number of arguments?
  143. Can you write a function similar to printf()?
  144. How can a called function determine the number of arguments that have been passed to it?
  145. Can there be at least some solution to determine the number of arguments passed to a variable argument list function?
  146. How do you declare the following:
    . An array of three pointers to chars
    · An array of three char pointers
    · A pointer to array of three chars
    · A pointer to function which receives an int pointer and returns a float pointer
    · A pointer to a function which receives nothing and returns nothing
    · What do the functions atoi(), itoa() and gcvt() do?
  147. Does there exist any other function which can be used to convert an integer or a float to a string?
  148. How would you use qsort() function to sort an array of structures?
  149. How would you use qsort() function to sort the name stored in an array of pointers to string?
  150. How would you use bsearch() function to search a name stored in array of pointers to string?
  151. How would you use the functions sin(), pow(), sqrt()?
  152. How would you use the functions memcpy(), memset(), memmove()?
  153. How would you use the functions fseek(), freed(), fwrite() and ftell()?
  154. How would you obtain the current time and difference between two times?
  155. How would you use the functions randomize() and random()?
  156. How would you implement a substr() function that extracts a sub string from a given string?
  157. What is the difference between the functions rand(), random(), srand() and randomize()?
  158. What is the difference between the functions memmove() and memcpy()?
  159. How do you print a string on the printer?
  160. Can you use the function fprintf() to display the output on the screen?
  161. What is an object?
  162. What is the difference between an object and a class?
  163. What is the difference between class and structure?
  164. What is public, protected, private?
  165. What are virtual functions?
  166. What is friend function?
  167. What is a scope resolution operator?
  168. What do you mean by inheritance?
  169. What is abstraction?
  170. What is polymorphism? Explain with an example.
  171. What is encapsulation?
  172. What do you mean by binding of data and functions?
  173. What is function overloading and operator overloading?
  174. What is virtual class and friend class?
  175. What do you mean by inline function?
  176. What do you mean by public, private, protected and friendly?
  177. When is an object created and what is its lifetime?
  178. What do you mean by multiple inheritance and multilevel inheritance? Differentiate between them.
  179. Difference between realloc() and free?
  180. What is a template?
  181. What are the main differences between procedure oriented languages and object oriented languages?
  182. What is R T T I ?
  183. What are generic functions and generic classes?
  184. What is namespace?
  185. What is the difference between pass by reference and pass by value?
  186. Why do we use virtual functions?
  187. What do you mean by pure virtual functions?
  188. What are virtual classes?
  189. Does c++ support multilevel and multiple inheritance?
  190. What are the advantages of inheritance?
  191. When is a memory allocated to a class?
  192. What is the difference between declaration and definition?
  193. What is virtual constructors/destructors?
  194. In c++ there is only virtual destructors, no constructors. Why?
  195. What is late bound function call and early bound function call? Differentiate.
  196. How is exception handling carried out in c++?
  197. When will a constructor executed?
  198. What is Dynamic Polymorphism?
  199. Write a macro for swapping integers.

Comments (5)

Said this on 3-31-2010 At 01:46 pm

send me the interview questions of c,c++ and java please...thanku vrey much

Said this on 4-5-2010 At 08:10 pm


Said this on 11-12-2010 At 02:51 pm

answers evaru icharu ra puka

saurabh gupta
Said this on 1-30-2011 At 12:54 pm

sent m new questions....thnku

Said this on 3-19-2011 At 06:21 pm

send the answer of these questions on my ID.

Post a Comment
* Your Name:
* Your Email:
(not publicly displayed)
Reply Notification:
Approval Notification:
* Security Image:
Security Image Generate new
Copy the numbers and letters from the security image:
* Message:

Email to Friend

Fill in the form below to send this article to a friend:

Email to Friend
* Your Name:
* Your Email:
* Friend's Name:
* Friend's Email:
* Security Image:
Security Image Generate new
Copy the numbers and letters from the security image
* Message: