Memory Management Concepts MCQs

Topic-wise practice questions for Programming (C++ / Java / Python). Test your knowledge, check solutions on demand, and pace your preparation.

Zero-leak answer engine • Rate-limited explanations
Practice in Timed Mode
Q1easy
What is Memory Fragmentation?
Q2easy
What is the primary functional difference between malloc() in C and new in C++?
Q3hard
Which Garbage Collection algorithm works by keeping a count of how many pointers refer to an object, and deleting the object when the count reaches zero?
Q4hard
A C++ developer uses std::unique_ptr instead of raw pointers. This is an application of which memory management philosophy?
Q5medium
In the standard memory layout of a C/C++ program, which segment grows downward (towards lower addresses) during function calls?
Q6easy
What typically causes a Segmentation Fault (SIGSEGV)?
Q7medium
If a 32-bit system has a maximum of 4GB of addressable memory, how many bits are used for each memory address?
Q8medium
(Code-Tracing / C++) What is the danger in the following code snippet?

int* ptr = new int(10);
ptr = new int(20);
Q9easy
In modern Garbage Collectors, what is the "Generational Hypothesis"?
Q10medium
A Java application is running, and the RAM usage is steadily increasing. Suddenly, the usage drops by 500MB without any user action. What most likely occurred?