Latest Memory Allocation Interview Questions and Answers for freshers and experienced pdf free download

Top Memory Allocation most frequently asked C++ Questions and Answers

Memory Allocation interview Questions and Answers List

  1. How new/delete differs from malloc()/free?
  2. How the delete operator differs from the delete[]operator?
  3. How a new operator differs from the operator new?
  4. Explain the term memory alignment.
  5. Explain the concept of dynamic allocation of memory.
  6. In the expression, char *c = (char *)malloc(20); followed by free(r); explain the role of mallocQ operator in allocating the number of bytes?
  7. Is it possible to use the free operator with the new allocated pointers and the delete operatorQ with the
    malloc allocated pointers?
  8. Can a new be used in place of old mallocQ? If yes, why?
  9. Is it possible to use a new for the reallocation of pointers ?
  10. Is there any need for checking of NULL after executing p = new Animal ()?
  11. Can a NULL be checked before deleting the p variable froi the expression, Delete p; and not if (p != NULL) ?
  12. Enlist the processes involved in deleting a variable.
  13. On throwing an exception by the Animal constructor in p = new AnimalQ, can memory leak occur?
  14. What is the use of [] in the delete statement of the following expression:
  15. What would happen on forgetting [], while deallocating an array through new?
  16. Can [] be dropped on deletion of some built-in type array (char, int etc)?
  17. Write about the retrieval of n number of objects during the process of delete[]p?
  18. Is it possible for a member function to use delete this?
  19. Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification.
  20. What is the role of copy constructor in copying of thrown objects?
  21. How can an improvement in the quality of software be done by try/catch/throw?
  22. Explain the process of catching a variable.

Leave a Reply

Your email address will not be published. Required fields are marked *