/**/ Unsolved Questions on CPU Scheduling Algorithms - Dextutor

# Unsolved Questions on CPU Scheduling Algorithms

Solve these Unsolved Questions on CPU Scheduling Algorithms to check out your understanding on the same

Q1. Find the av. waiting time and av. turnaround time using:
a) FCFS
b) SJF(NP)
c) SJF(P)
d) RR (TQ=3)

Q2. Find the av. waiting time and av. turnaround time using:
a) SJF(NP)
b) SJF(P)

Q3. Find the av. waiting time and av. turnaround time using:
a) Priority(NP)
b) Priority(P)

Q4. [GATE-2006] Consider three CPU-intensive processes, which require 10, 20 and 30 time units and arrive at times 0, 2 and 6, respectively. How many context switches are needed if the operating system implements a shortest remaining time first scheduling algorithm? Do not count the context switches at time zero and at the end.
(a) 1 (b) 2 (c) 3 (d) 4

Q5. [GATE-2006] Consider three processes (process id 0, 1, 2 respectively) with compute time bursts 2, 4 and 8 time units. All processes arrive at time zero. Consider the longest remaining time first (LRTF) scheduling algorithm. In LRTF ties are broken by giving priority to the process with the lowest process id. The average turn around time is:
(a) 13 units (b) 14 units (c) 15 units (d) 16 units

Q6. [GATE-2007] An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:

```Process   Execution time    Arrival time
P1               20                         0
P2               25                         15
P3               10                         30
P4               15                         45```

What is the total waiting time for process P2?
(a) 5 (b) 15 (c) 40 (d) 55

### 25 thoughts on “Unsolved Questions on CPU Scheduling Algorithms”

1. Saketh

Q1) a) FCFS: Avg WT- 6.6
b)SJF(NP): Avg WT- 4.8

Q2) a) SJF(NP):Avg WT- 3.75

1. A

Wow thank you for your generous contribution

2. Baljit Singh Saini

Well Done. Share answers for other questions also

2. Himanshu

Q1) a) SJF(NP): AVG W.T-4.8

1. Baljit Singh Saini

correct..solve others also

3. Harman

Q2) B
AWT = 3.25

4. K M RIDOY HASAN

a) SJF(NP)
AWT=3.75
b)SJF(P)
AWT=3.25

1. Baljit Singh Saini

Great

5. K M RIDOY HASAN

a) FCFS AWT=6.6
b)SJF(NP) AWT =4.8
c)SJF(P) AWT=5.2

1. Baljit Singh Saini

(a) and (b) are correct. For (c) it should be 4.6. Check again

1. K M RIDOY HASAN

for c …..i am not getting.Can you please explain

6. Saketh

Q2. b) SJF(P): Avg WT: 3.25

7. Himanshu Khanduri

Q2
a) SJF(NP)
AWT=3.75
b)SJF(P)
AWT=3.25

8. Harman

Q3) 1
AWT = 4.25

1. Baljit Singh Saini

wrong.

9. Pranit Patil

Q3
A — AWT = 4
B — AWt = 4.2

1. Baljit Singh Saini

B:4.25

10. K M RIDOY HASAN

Q3:
A)(NP) AWT=4;
ATAT=7.75
B)(P) AWT=3.5
ATAT=7.25

1. Baljit Singh Saini

A is correct. for B it should be 4.25(AV. Waiting) and 8 (TAT)

11. Saketh

Q3. a) Priority(NP) : Avg WT: 4

1. Baljit Singh Saini

correct..calculate for other also

12. Sourabh

3 que avg waiting 4.7 and avg turnaround time is 8.5

1. Baljit Singh Saini

A) Av. Wait: 4 and TAT: 7.75
B) Av. Wait: 4.25 and TAT: 8

13. Himanshu Khanduri

Q3:-
A)AWT(Np)=4;
ATAT=7.75
B) AWT(P)=3.5
ATAT=7.25

1. Baljit Singh Saini

A) Av. Wait: 4 and TAT: 7.75
B) Av. Wait: 4.25 and TAT: 8