Easy
Child state before wait()
During the parent's 5-second sleep below, after the child has already called _exit(7), what state is the child process in?
main.cpp
#include <unistd.h>
#include <sys/wait.h>
#include <cstdio>
int main() {
pid_t pid = fork();
if (pid == 0) {
_exit(7);
}
sleep(5); // parent does not call wait() yet
return 0;
}16 of 53 in Operating Systems