Operating System Questions and Answers Part-2

1. What is the ready state of a process?
a) when process is scheduled to run after some execution
b) when process is using the CPU
c) when process is unable to run until some task has been completed
d) none of the above

Answer: a
Explanation: Ready state of the process means process has all necessary resources which are required for execution of that process when CPU is allocated. Process is ready for execution but waiting for the CPU to be allocated.

2. The address of the next instruction to be executed by the current process is provided by the __________
a) CPU registers
b) Process stack
c) Program counter
d) Pipe

Answer: c
Explanation: The address of the next instruction to be executed by the current process is provided by the Program Counter. After every instruction is executed, the Program Counter is incremented by 1 i.e. address of the next instruction to be executed. CPU fetches instruction from the address denoted by Program Counter and execute it.

3. In Unix, Which system call creates the new process?
a) create
b) fork
c) new
d) none of the above

Answer: b
Explanation: In UNIX, a new process is created by fork() system call. fork() system call returns a process ID which is generally the process id of the child process created.

4. In Operating Systems, which of the following is/are CPU scheduling algorithms?
a) Round Robin
b) Priority
c) Shortest Job First
d) All of the above

Answer: d
Explanation: In Operating Systems, CPU scheduling algorithms are:
1) First Come First Served scheduling
2) Shortest Job First scheduling
3) Priority scheduling
4) Round Robin scheduling
5) Multilevel Queue scheduling
6) Multilevel Feedback Queue scheduling

5. The systems which allow only one process execution at a time, are called __________
a) unitasking systems
b) uniprocessing systems
c) uniprogramming systems
d) none of the above

Answer: b
Explanation: Those systems which allows more than one process execution at a time, are called multiprogramming systems. Uniprocessing means only one processor.

6. A set of processes is deadlock if __________
a) each process is blocked and will remain so forever
b) all processes are trying to kill each other
c) each process is terminated
d) none of the above

Answer: a
Explanation: Deadlock is a situation which occurs because process A is waiting for one resource and holds another resource (blocking resource). At the same time another process B demands blocking a resource as it is already held by a process A, process B is waiting state unless and until process A releases occupied resource.

7. In operating system, each process has its own __________
a) address space and global variables
b) pending alarms, signals and signal handlers
c) open files
d) all of the above

Answer: d
Explanation: In Operating Systems, each process has its own address space which contains code, data, stack and heap segments or sections. Each process also has a list of files which is opened by the process as well as all pending alarms, signals and various signal handlers.

8. What is interprocess communication?
a) communication within the process
b) communication between two threads of same process
c) communication between two process
d) none of the above

Answer: c
Explanation: Interprocess Communication (IPC) is a communication mechanism that allows processes to communicate with each other and synchronise their actions without using the same address space. IPC can be achieved using shared memory and message passing.

9. A process can be terminated due to __________
a) killed by another process
b) normal exit
c) fatal error
d) all of the above

Answer: d
Explanation: A process can be terminated normally by completing its task or because of fatal error or killed by another process or forcefully killed by a user. When the process completes its task without any error then it exits normally. The process may exit abnormally because of the occurrence of fatal error while it is running. The process can be killed or terminated forcefully by another process.

10. A process stack does not contain __________
a) Local variables
b) Function parameters
c) PID of child process
d) Return addresses

Answer: c
Explanation: Process stack contains Function parameters, Local variables and Return address. It does not contain the PID of child process.