UGC NET · PAPER 2
UGC NET Paper 2 Computer Science – Operating Systems PYQ: Process Management & CPU Scheduling
Q1.
Match List – I with List – II.
List I: (A) LRU (B) Demand cleaning (C) Long term scheduling (D) Medium term scheduling
List II: (I) Page not referenced for the longest time is replaced (II) Page is written to secondary memory only when it has been selected for replacement (III) Decision to add a process to the pool of processes to be executed (IV) Decision to add a process, partially or fully, to main memory
List I: (A) LRU (B) Demand cleaning (C) Long term scheduling (D) Medium term scheduling
List II: (I) Page not referenced for the longest time is replaced (II) Page is written to secondary memory only when it has been selected for replacement (III) Decision to add a process to the pool of processes to be executed (IV) Decision to add a process, partially or fully, to main memory
- (A) (A)-(I), (B)-(III), (C)-(IV), (D)-(II)
- (B) (A)-(II), (B)-(I), (C)-(III), (D)-(IV)
- (C) (A)-(III), (B)-(II), (C)-(I), (D)-(IV)
- (D) (A)-(IV), (B)-(II), (C)-(III), (D)-(I)
Q2.
Three processes arrive as follows:
The preemptive shortest-job-first (SJF) scheduling algorithm is used, with scheduling decisions made only at a process arrival or completion. What is the average waiting time for the three processes?
| Process | Arrival Time | Burst Time |
|---|---|---|
| P0 | 0 ms | 7 ms |
| P1 | 1 ms | 3 ms |
| P2 | 2 ms | 7 ms |
- (A) 3 ms
- (B) 3.67 ms
- (C) 4.47 ms
- (D) 4 ms
Q3.
Three processes arrive as follows:
The preemptive shortest-job-first (SJF) scheduling algorithm is used, with scheduling decisions made only at a process arrival or completion. What is the average waiting time for the three processes?
| Process | Arrival Time | Burst Time |
|---|---|---|
| P0 | 0 ms | 7 ms |
| P1 | 1 ms | 3 ms |
| P2 | 2 ms | 7 ms |
- (A) 3 ms
- (B) 3.67 ms
- (C) 4.47 ms
- (D) 4 ms
Q4.
For the following set of processes scheduled using FCFS policy, determine the average waiting time. Assume that the processes arrived in the order P1, P2, P3, P4.
| Process | Burst Time (ms) |
|---|---|
| P1 | 8 |
| P2 | 15 |
| P3 | 10 |
| P4 | 7 |
- (A) 8
- (B) 16
- (C) 32
- (D) 48
Q5.
Which of the following statements are true?
(A) Shortest remaining time first scheduling may cause starvation.
(B) Preemptive scheduling may cause starvation.
(C) Round robin is better than FCFS in terms of response time.
(A) Shortest remaining time first scheduling may cause starvation.
(B) Preemptive scheduling may cause starvation.
(C) Round robin is better than FCFS in terms of response time.
- (A) A only
- (B) B, C only
- (C) A, B only
- (D) A, B, C
Q6.
An OS follows round robin scheduling with a time quantum of 4 ms. Assuming that the CPU is free now and there are 20 processes waiting in the ready queue, what is the maximum amount of time that a process waits before getting into the CPU?
- (A) 80 ms
- (B) 76 ms
- (C) 84 ms
- (D) None of the above
Q7.
If an operating system does not allow a child process to exist when the parent process has been terminated, this phenomenon is called:
- (A) Threading
- (B) Cascading termination
- (C) Zombie termination
- (D) Process killing
Q8.
Consider the following 3 processes, with the length of the CPU burst time given in milliseconds:
What is the average waiting time for these processes if they are scheduled using the preemptive shortest-job-first (shortest-remaining-time-first) scheduling algorithm?
| Process | Arrival Time | Burst Time |
|---|---|---|
| P1 | 0 | 8 |
| P2 | 1 | 4 |
| P3 | 2 | 9 |
- (A) 2.66
- (B) 4.66
- (C) 5.5
- (D) 6
Q9.
Assuming that the system call fork() never fails, consider the following C programs P1 and P2 executed on a UNIX/Linux system.
Statement I: P1 displays "Happy" 8 times.
Statement II: P2 displays "Happy" 12 times.
In light of the above statements, choose the most appropriate answer.
| P1 | P2 |
|---|---|
| int main() { fork(); fork(); fork(); printf("Happy\n"); } | int main() { fork(); printf("Happy\n"); fork(); printf("Happy\n"); fork(); printf("Happy\n"); } |
Statement II: P2 displays "Happy" 12 times.
In light of the above statements, choose the most appropriate answer.
- (A) Both Statement I and Statement II are true
- (B) Both Statement I and Statement II are false
- (C) Statement I is correct but Statement II is false
- (D) Statement I is incorrect but Statement II is true
Q10.
Consider the following four processes with the arrival time and length of CPU burst given in milliseconds:
Using the preemptive shortest job first (SJF / SRTF) scheduling algorithm, what is the average waiting time (in ms) for these processes?
| Process | Arrival Time | Burst Time |
|---|---|---|
| P1 | 0 | 8 |
| P2 | 1 | 4 |
| P3 | 2 | 9 |
| P4 | 3 | 5 |
- (A) 6.5
- (B) 7.5
- (C) 6.75
- (D) 7.75
Q11.
Which module gives control of the CPU to the process selected by the short-term scheduler?
- (A) Dispatcher
- (B) Interrupt
- (C) Scheduler
- (D) Threading
Q12.
A fair share scheduler computes the priority of a process based on which of the following?
(1) Processor utilization by the individual process.
(2) Weight assigned to the user/group.
(3) Processor utilization by the user/group.
(1) Processor utilization by the individual process.
(2) Weight assigned to the user/group.
(3) Processor utilization by the user/group.
- (A) Only (1) and (2)
- (B) Only (1) and (3)
- (C) (1), (2) and (3)
- (D) Only (2) and (3)
Q13.
Which of the following CPU scheduling algorithms may cause starvation of a process? (1) First-Come-First-Served (2) Round Robin (3) Priority scheduling (4) Shortest-Process-Next (5) Shortest-Remaining-Time-First
- (A) 1, 3 and 5
- (B) 3, 4 and 5
- (C) 2, 4 and 5
- (D) 2, 3 and 4
Q14.
A scheduling algorithm assigns a process's priority proportional to how long it has been waiting; every process starts at priority zero (the lowest), and the scheduler re-evaluates all priorities and picks the next process to run every T time units. If no process performs I/O and all arrive at time zero, which classical scheduling discipline does this scheme effectively implement?
- (A) Priority scheduling
- (B) Round Robin scheduling
- (C) Shortest Job First
- (D) FCFS