Computer Science Fundamentals
Memory Management
6 practice questions. Free questions open a full answer guide; the rest unlock with Pro.
- What decides whether a piece of data lives on the stack or the heap, and why does it matter for performance?
- A long-running service shows resident memory climbing steadily over days even though your in-process heap profiler says live allocations are flat. How would you reason about what's happening and what you'd try?Go Pro
- What is a memory leak in a garbage-collected language like Java or Python, and how do you detect one?Go Pro
- Explain the difference between stack and heap memory, and what decides whether a variable lives on one versus the other.Go Pro
- A long-running C++ service intermittently crashes with corrupted data, and the stack trace points at an object that was already freed. Walk me through how you'd reason about the use-after-free and how you'd prevent the whole class of bug.Go Pro
- What causes a memory leak, and how does that differ between a garbage-collected language like Java or Python and a manual one like C or C++?Go Pro
Want questions matched to your role? Paste a job title, job description, or CV for a personalized set, or go Pro to unlock the full bank.