Questions: Process Termination and Resource Cleanup

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A process calls exit(0). What state does it enter immediately afterward?

AIt is permanently removed from the process table and all resources are freed
BIt enters zombie state, preserving its exit status until the parent calls waitpid()
CIt is suspended and waits for the parent process to restart it
DIt is reparented to init and continues running in the background
Question 2 Multiple Choice

A long-running server forks hundreds of worker processes but never calls waitpid(). After several days, the server can no longer fork new processes. What is the most likely cause?

AThe server has run out of heap memory from accumulating child data
BZombie processes have accumulated and exhausted the process table
CThe worker processes became orphans and are consuming all CPU
DFile descriptor limits were reached because each child inherits the parent's descriptors
Question 3 True / False

When a process calls exit(), its memory pages and file descriptors are freed, and it is permanently removed from the process table.

TTrue
FFalse
Question 4 True / False

If a parent process terminates before its children, the OS reparents the orphaned children to the init process (PID 1) rather than terminating them.

TTrue
FFalse
Question 5 Short Answer

What is a zombie process, why does it exist, and what event finally removes it from the process table?

Think about your answer, then reveal below.