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. |
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.