CS FundamentalsVery hardAmazon · Microsoft MCQ pattern
Processes (arrival, burst) in ms: P1 (arrival 0, burst 3), P2 (arrival 1, burst 7), P3 (arrival 2, burst 1), P4 (arrival 4, burst 5), P5 (arrival 6, burst 2). They are scheduled by preemptive Shortest Remaining Time First (SRTF); ties go to the process that arrived earlier. What are the average waiting time and the average turnaround time?
- A. 2.6 ms and 6.2 ms
- B. 5.4 ms and 9 ms
- C. 3.6 ms and 6.2 ms
- D. 2.6 ms and 5.2 ms
Correct answer: A. 2.6 ms and 6.2 ms
Simulating SRTF tick by tick gives completion times P1 3, P3 4, P5 8, P4 11, P2 18; waiting = turnaround − burst, averaging to 2.6 ms waiting and 6.2 ms turnaround. Running the same processes strictly in arrival order (FCFS) instead gives 5.4 ms waiting, the result of ignoring preemption.
More Operating Systems questions
- Processes (arrival, burst) in ms: P1 (arrival 0, burst 3), P2 (arrival 1, burst 7), P3 (arrival 2, burst 1), P4 (arrival 4, burst 5), P5…
- Processes (arrival, burst, priority — a smaller number means higher priority): P1 (arrival 0, burst 3, priority 2), P2 (arrival 1, burst…
- Processes (arrival, burst) in ms: P1 (arrival 0, burst 3), P2 (arrival 1, burst 7), P3 (arrival 2, burst 1), P4 (arrival 4, burst 5), P5…
- Processes (arrival, burst) in ms: P1 (arrival 0, burst 2), P2 (arrival 1, burst 9), P3 (arrival 3, burst 4), P4 (arrival 5, burst 5). They…
- Processes (arrival, burst) in ms: P1 (arrival 0, burst 2), P2 (arrival 1, burst 9), P3 (arrival 3, burst 4), P4 (arrival 5, burst 5)…
- Processes (arrival, burst, priority — a smaller number means higher priority): P1 (arrival 0, burst 2, priority 4), P2 (arrival 1, burst…