This section contains carefully selected MCQs and Previous Year Questions with explanations to help students understand concepts and prepare effectively for examinations, interviews, and competitive tests.
Q: 1A process executes the following code
for(i=0;i<p;i++)
{
fork();
}
Total number of child process created.
Option C
The fork() System Call creates a new child process. After each fork(), both the parent and the newly created child continue executing the next iterations of the loop.
for(i=0; i<p; i++)
{
fork();
}
In the above given loop, at each iteration, the number of processes doubles.
| Iteration | Total Processes | Child Processes |
|---|---|---|
| Initially | 1 (Only Parent) | 0 |
| After 1st fork() | 2 | 2-1=1 |
| After 2nd fork() | 4 | 4-1=3 |
| After 3rd fork() | 8 | 8-1=7 |
| After 4th fork() | 16 | 16-1=15 |
| After p iterations | 2p | 2p-1 |
Q: 2There are three processes in the ready queue. When the currently running process requests for I/O how many process switches take place?
Option A
A Process Switch (Context Switch) occurs when the CPU changes from one process to another. When the currently running process requests an I/O operation, it cannot continue execution, so it moves to the blocked state.
At this point, the CPU selects one process from the ready queue and starts executing it. This results in only one context switch, from the running process to the next ready process.
Even though there are three processes in the ready queue, only one process is selected at a time, so only one switch occurs.
Q: 3In operating system, response time is:
Option B
In operating systems, different time metrics are used to evaluate process performance.
Response Time refers to the time interval between when a process is submitted and when it first starts responding i.e., produces the first output or gets CPU for the first time. It does not consider the completion of the process.
Q: 4__________ is a process of lifting the process from memory and placing it on disk.
Option B
Swapping is a memory-management technique in which a process is temporarily moved between main memory (RAM) and secondary storage (Disk) to manage limited memory resources.
When a process is removed from main memory and placed on disk, the operation is called Swapping Out. The operating system does this to free space in RAM so that another process can be loaded and executed.
The reverse operation is called Swapping In, where a process is brought from disk back into main memory.
Q: 5Cascading termination refers to termination of all child processes, if the parent process terminates –
Option A
Cascading termination refers to the situation where the termination of a parent process leads to the automatic termination of all its child processes. This mechanism is implemented by the operating system to avoid the creation of orphan processes, which are child processes left without a parent to manage them.
Importantly, cascading termination occurs regardless of whether the parent process terminates normally after completing its execution or abnormally due to an error or external interruption. This policy helps maintain system stability by cleaning up all associated child processes when the parent ends.
Q: 6The state of a process after it encounters an I/O instruction is ______________?
Option B
In an Operating System, a process changes its state based on its activity. When a process is executing and encounters an I/O instruction like reading from a file or waiting for input, it cannot continue execution until the I/O operation is completed.
At this point, the process moves from the running state to the Blocked or Waiting state because it is waiting for the I/O operation to finish. Once the I/O is completed, the process moves back to the Ready State.
Q: 7Suppose that a process is in ‘BLOCKED’ state waiting for some I/O service. When the service is completed, it goes to the _________ state.
Option B
A process passes through different states during its execution. The operating system uses these states to manage CPU allocation and process execution. The most common process states are New, Ready, Running, Blocked (Waiting), and Terminated.
When a process requests an I/O operation (such as reading a file or receiving input from a keyboard), it cannot continue execution until the I/O operation is completed. Therefore, the process enters the Blocked (Waiting) state.
Once the I/O operation is completed, the process does not immediately get the CPU. Instead, it moves to the Ready state, where it waits for the CPU scheduler to assign the CPU.
Process State:
New
↓
Ready
↓
Running
↓
Blocked (Waiting for I/O)
↓
Ready
↓
Running
↓
Terminated
Q: 8Operating system must provide a mechanism for parent processes to create new child processes. Which of the following statements is true when a parent process creates new process?
Option D
When a parent process creates a child process, two situations are possible depending on the program design.
Q: 9Information about each process in operating system is maintained by ___________.
Option B
An operating system manages multiple processes simultaneously. To keep track of each process, the operating system stores all important information related to the process in a special data structure called the Process Control Block (PCB).
PCB contains information such as:
Whenever the CPU switches from one process to another, the operating system uses the PCB to save and restore process information.
Q: 10A process is a(n) ___________ entity, whereas a program is a(n) __________ entity.
Option C
In an operating system, a program and a process are closely related concepts, but they are not the same.
A program is a set of instructions stored on a storage device, whereas a process is the actual execution of those instructions.
A program is a passive entity because it is simply a collection of instructions stored in a file. It does not perform any action by itself.
A process is an active entity because it is a program that is currently being executed by the CPU. A process has its own state, program counter, registers, memory allocation, and other resources.
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.