CS FundamentalsHardGATE CS · Amazon/Microsoft SDE MCQ
Processes (arrival, burst): P1 (0, 8), P2 (1, 4), P3 (2, 9), P4 (3, 5), P5 (6, 2). Under SRTF (preemptive SJF; a running process keeps the CPU on a tie), what is the average waiting time?
- A. 6.4
- B. 7.8
- C. 11.0
- D. 12.0
Correct answer: A. 6.4
Gantt: P1 0-1, P2 1-5, P4 5-6, P5 6-8 (preempts P4, which has 4 left), P4 8-12, P1 12-19, P3 19-28. Waiting times 11, 0, 17, 4, 0 sum to 32: average 6.4. Non-preemptive SJF gives 7.8, FCFS 11.0, and 12.0 is the average turnaround.
More Operating Systems questions
- Round Robin with quantum 3; processes (arrival, burst): A (0, 7), B (2, 4), C (4, 6), D (5, 3). A process arriving at the same moment…
- Preemptive priority scheduling (smaller number = higher priority; a running process is not preempted by an equal priority). Processes…
- Non-preemptive SJF; processes (arrival, burst): P1 (0, 3), P2 (5, 6), P3 (6, 2), P4 (7, 1), P5 (8, 4). The CPU idles when nothing is…
- Highest Response Ratio Next (non-preemptive; ratio = (waiting + burst) / burst). Processes (arrival, burst): A (0, 8), B (1, 4), C (2, 2)…
- A multilevel feedback queue has Q0 (RR, quantum 2), Q1 (RR, quantum 4) and Q2 (FCFS); a job that uses its full quantum drops one level…
- Reference string: 3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9, 3 with 3 frames, initially empty. How many page faults occur under FIFO…