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: 1In the following table Group—I contains properties and attributes of scheduling algorithm and Group—II contains scheduling algorithms.
| Group—I | Group—II |
|---|---|
| (P) Processes has categories like foreground and background. | (a) Gand scheduling. |
| (Q) Processes announce its deadline and processes are not periodic. | (b) Multi level queue scheduling. |
| (R) Processes have producer consumer relationship. | (c) Rate monotonic scheduling. |
| (S) Processes announce its deadline and processes are periodic. | (d) Earliest deadline first scheduling. |
The matches for (P), (Q), (R), (S) respectively are
Option B
For statement (P), where processes are divided into categories like foreground and background, the correct match is Multilevel Queue Scheduling. This algorithm classifies processes into separate queues such as interactive and batch, each with its own scheduling policy, making it suitable for such categorization.
For statement (Q), processes announce their deadlines and are not periodic, which corresponds to Earliest Deadline First Scheduling. This is a dynamic real-time scheduling technique where priorities are assigned based on the nearest deadline, and it works effectively for aperiodic tasks.
In (R), processes have a producer–consumer relationship, indicating interdependent or communicating processes. This matches Gang Scheduling, where related processes are scheduled simultaneously on multiple processors to ensure proper synchronization and efficient execution.
Finally, (S) describes processes that announce deadlines and are periodic, which fits Rate Monotonic Scheduling. This is a fixed-priority scheduling algorithm designed specifically for periodic tasks, where priority is assigned based on the rate.
Q: 2Consider the following processes for round-robin scheduling
| Process | Arrival Time | Burst Time |
|---|---|---|
| P1 | 0 | 4 |
| P2 | 0 | 6 |
| P3 | 0 | 8 |
| P4 | 0 | 2 |
Which process completes first, if time slice is 2.
Option D
In Round Robin Scheduling, each process is given a fixed time slice (time quantum) in a cyclic order. If a process does not finish within its time slice, it goes to the end of the Ready Queue.
Here, all processes arrive at time 0 and the time quantum = 2.
| Time | Process | Remaining Burst Time |
|---|---|---|
| 0–2 | P1 | 2 Left (4-2=2) |
| 2–4 | P2 | 4 Left (6-2=4) |
| 4–6 | P3 | 6 Left (8-2=6) |
| 6–8 | P4 | 0 (Completed) (2-2=0) |
Since P4 has burst time equal to time quantum, it completes in its first execution cycle, before others finish.
Q: 3What is Throughput in process scheduling?
Option B
Different types of operating systems are designed for different purposes such as improving CPU utilization, providing quick response, or meeting time limits.
| Operating System Type | Description |
|---|---|
| Batch Processing System | Jobs are collected and executed in batches without user interaction to reduce CPU idle time. |
| Multiprogramming Operating System | Multiple programs are kept in memory simultaneously to improve CPU and resource utilization. |
| Time Sharing Operating System | Multiple users can use the computer system at the same time with quick response. |
| Real-Time Operating System | Processes data and provides output within a fixed time limit. |
Q: 4CPU scheduling is the basis of –
Option A
CPU Scheduling is the foundation of a Multiprogramming Operating System. In multiprogramming, several processes are kept in memory at the same time, and CPU scheduling decides which process will be given the CPU when it becomes available. This ensures efficient CPU utilization by keeping the processor busy as much as possible. CPU scheduling ensures that the CPU is never idle when there are processes ready to execute, improving throughput.
Q: 5Which of the following is a solution for starvation in priority based scheduling in operating system?
Option B
In priority-based scheduling, processes with lower priority may never get CPU time if higher priority processes keep arriving. This problem is called Starvation.
To solve this, the concept of Aging is used. In aging, the priority of a waiting process is gradually increased over time, so eventually it gets a chance to execute.
Q: 6Which of the following, best represents an event to invoke medium-term scheduler?
Option D
In an Operating System, the CPU scheduling process involves three levels of schedulers:
Q: 7A scenario in priority-based scheduling where higher priority task waits for a low priority task to complete, when both share the same resources is called _________.
Option D
In priority-based scheduling, normally a higher priority task should execute before a lower priority task. However, a problem occurs when:
This situation is called Priority Inversion, because the expected priority order gets inverted, the higher priority task is forced to wait for the lower priority task.
Q: 8A given number of tasks T1 to Tn whose duration is known, are queued in a single processor machine. Which of the following will be the best scheduling algorithm?
Option B
The key point in the question is, the duration (burst time) of all tasks is known. Remember, when burst times are known in advance, the Shortest Job First (SJF) scheduling algorithm is considered the best because it minimizes the average waiting time.
Shortest Job First selects the process with the smallest execution time first. This ensures that short tasks do not wait behind long tasks, reducing overall waiting time.
Q: 9Which of the following scheduling algorithm is always pre-emptive?
Option D
In CPU scheduling, pre-emptive algorithms are those where a running process can be interrupted and the CPU is given to another process.
Round Robin Scheduling is always pre-emptive because each process is given a fixed Time Slice or Time Quantum. After this time expires, the process is interrupted, and the CPU is assigned to the next process in the queue.
Q: 10What is the “Convoy effect” in CPU scheduling?
Option C
The Convoy Effect is a performance problem that occurs in CPU scheduling, especially in algorithms like First-Come, First-Served (FCFS). In this situation, a long CPU-Bound process gets the CPU first. Meanwhile, several I/O-Bound processes have to wait in the Ready Queue.
Since the CPU is busy executing the long process, the shorter I/O-bound processes are delayed. As a result, the CPU stays idle when those I/O-bound processes later perform I/O operations, and overall system utilization drops.
| TYPE OF PROCESS | EXPLANATION |
|---|---|
| CPU-Bound | Uses the CPU heavily with few I/O operations. When it runs first, it keeps the CPU busy for a long time, delaying other processes waiting in the queue. |
| I/O-Bound | Performs frequent I/O operations with short CPU bursts. These processes must wait for the long CPU-bound process to finish, leading to poor CPU and I/O utilization. |
Q: 11Which of the following is true?
Option C
In operating systems, processes are scheduled based on priority. Priority Inversion is a situation where a high-priority process is forced to wait because a low-priority process is holding a resource that it needs. This leads to an unexpected inversion of priorities.
Q: 12
Math the following:
| List—1 | List—2 |
|---|---|
| I. Long-Term Scheduler | A. Swapping |
| II. Medium-Term Scheduler | B. Job Scheduling |
| III. Short-Term Scheduler | C. CPU Scheduling |
Option C
The schedulers are responsible for selecting processes and allocating system resources. Different schedulers perform different tasks depending on the stage of process execution. There are three main types of schedulers:
The Long-Term Scheduler selects processes from the job pool (secondary storage) and loads them into main memory for execution. Therefore, it is also known as the Job Scheduler.
The Medium-Term Scheduler temporarily removes processes from main memory and stores them on secondary storage. This process is called Swapping. It helps control the degree of multiprogramming and frees memory when required.
The Short-Term Scheduler selects one process from the ready queue and allocates the CPU to it. Therefore, it is responsible for CPU Scheduling.
Q: 13Processes are assigned to the CPU in the order they requested is called
Option D
In operating systems, CPU scheduling determines the order in which processes are executed. When processes are assigned to the CPU in the exact order they arrive or request it, this scheduling technique is called First-In-First-Served (FIFS), also commonly known as First-Come-First-Served (FCFS).
For example, if processes arrive in order P1 → P2 → P3, then execution will also happen in the same order: P1 → P2 → P3.
Q: 14Which of the following statements are true?
I. Shortest Remaining Time First (SRTF) scheduling may cause starvation.
II. Preemptive scheduling may cause starvation.
III. Round robin is better than FCFS in terms of response time.
Option D
SRTF (Shortest Remaining Time First) is a Preemptive Scheduling algorithm where the process with the shortest remaining execution time is given the CPU. A long-running process might never get to execute if there is a continuous stream of new, short-burst processes arriving in the ready queue. The long-running process would always have a longer remaining time and would be repeatedly preempted, leading to starvation.
Preemptive scheduling may cause starvation, this is a general statement that is true. Starvation is a common problem in any Preemptive Scheduling algorithm that uses a priority or time-based approach, like SRTF or a Priority-Based Scheduler where low-priority processes might never get to run if there is a constant flow of high-priority processes.
Round Robin (RR) scheduling allocates CPU time in small time slices (quantum) to each process fairly, leading to better responsiveness compared to FCFS (First-Come, First-Serve), where a process waits (even short-burst ones) until the previous one completes because its Non-Preemptive Scheduling algorithm.
Q: 15
For the following list of processes, the average turnaround time and average waiting time using FCFS algorithm is:
| Process | Arrival Time (ms) | Execution Time (ms) |
|---|---|---|
| P1 | 6 | 24 |
| P2 | 0 | 3 |
| P3 | 3 | 3 |
Option C
In FCFS (First Come First Serve) scheduling, processes are executed in the order of their arrival time.
Step 1: Order of Execution :
| Process | Arrival Time | Execution Time |
|---|---|---|
| P2 | 0 | 3 |
| P3 | 3 | 3 |
| P1 | 6 | 24 |
So, execution order: P2 → P3 → P1
Step 2: Gantt Chart :
| Process | Start | Finish |
|---|---|---|
| P2 | 0 | 3 |
| P3 | 3 | 6 |
| P1 | 6 | 30 |
Step 3: Turnaround Time (TAT) :
TAT = Completion Time-Arrival Time
| Process | Completion | Arrival | TAT |
|---|---|---|---|
| P2 | 3 | 0 | 3 |
| P3 | 6 | 3 | 3 |
| P1 | 30 | 6 | 24 |
Average TAT: (3+3+24)/3 = 30/3 = 10 ms
Step 4: Waiting Time (WT) :
WT = TAT-Execution Time
| Process | TAT | Burst | WT |
|---|---|---|---|
| P2 | 3 | 3 | 0 |
| P3 | 3 | 3 | 0 |
| P1 | 24 | 24 | 0 |
Average WT: (0+0+0)/3 = 0 ms
Thus:
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.