What this operating systems question tests
This is a foundational question about program lifecycle and operating-system semantics. It asks you to distinguish between what the runtime or OS actually does when a C/C++ program exits versus common misconceptions about cleanup and resource management.
To answer well, you need to understand the sequence of events that occurs after main() returns: which destructors fire, which static objects are cleaned up, which resources the OS reclaims automatically, and which operations the runtime performs versus which it skips. This tests your mental model of the boundary between application code and system-level responsibility.
- Program exit sequences and return codes
- Static object destruction and atexit handlers
- Automatic resource reclamation by the kernel
- Difference between logical cleanup and OS-level resource release