Process Model and IPC Interview questions

Total available count: 17
Subject - Operating System
Subsubject - Process Model and IPC

What happens when you execute a program?

When you execute a program on your UNIX system, the system creates a special environment for that program. This environment contains everything needed for the system to run the program as if no other program were running on the system. Each process has process context, which is everything that is unique about the state of the program you are currently running. Every time you execute a program the UNIX system does a fork, which performs a series of operations to create a process context and then executes your program in that context. The steps include the following:

  1. Allocate a slot in the process table, a list of currently running programs kept by UNIX
  2. Assign a unique process identifier (PID) to the process
  3. iCopy the context of the parent, the process that requested the spawning of the new process
  4. Return the new PID to the parent process. This enables the parent process to examine or control the process directly

After the fork is complete, UNIX runs your program.

Next 5 interview question(s)

What are the process states in Unix?
What is a zombie?
How can a parent and child process communicate?
How can you get/set an environment variable from a program?
List the system calls used for process management?