CS FundamentalsVery hardProduct company interview · GATE level
Processes (times in ms): A (arrival 0, burst 9), B (arrival 1, burst 4), C (arrival 3, burst 6), D (arrival 5, burst 2), E (arrival 8, burst 5). Round Robin with time quantum 3 is used. A newly arrived process joins the tail of the ready queue before a process whose quantum expires at that same instant. When does E complete, and what is the average waiting time?
- A. E completes at 24; average waiting time 11.4 ms
- B. E completes at 26; average waiting time 11.4 ms
- C. E completes at 26; average waiting time 10.2 ms
- D. E completes at 21; average waiting time 9.8 ms
Correct answer: B. E completes at 26; average waiting time 11.4 ms
Queue trace: A 0-3 (B and C arrive; queue B, C, A). B 3-6 (D arrives at 5; queue C, A, D, B). C 6-9 (E arrives at 8; queue A, D, B, E, C). A 9-12, D 12-14 (done), B 14-15 (done), E 15-18, C 18-21 (done), A 21-24 (done), E 24-26 (done). Completion times A 24, B 15, C 21, D 14, E 26; waits 15, 10, 12, 7, 13, sum 57, average 11.4 ms. The placement rule matters at t = 3, where C's arrival and A's preemption coincide: putting A ahead of C reorders the whole chart.
More Operating Systems questions
- Processes (arrival, burst, priority; a smaller number means higher priority): A (0, 9, 3), B (1, 4, 1), C (3, 6, 4), D (5, 2, 2), E (8, 5…
- Processes (arrival, burst) in ms: P1 (0, 6), P2 (2, 5), P3 (4, 2), P4 (5, 8), P5 (7, 3). They are scheduled by non-preemptive Highest…
- A multilevel feedback queue has Q0 (Round Robin, quantum 2), Q1 (Round Robin, quantum 4) and Q2 (FCFS). New processes enter Q0. A process…
- Three processes each run CPU burst, I/O burst, CPU burst (in ms): P1 arrives at 0 with 5, 4, 3; P2 arrives at 2 with 3, 6, 2; P3 arrives…
- Reference string: 2, 7, 2, 4, 1, 7, 3, 2, 4, 5, 1, 2, 7, 3, 5, 2. With 4 frames, initially empty, how many page faults do FIFO, LRU and…
- Reference string: 2, 7, 2, 4, 1, 7, 3, 2, 4, 5, 1, 2, 7, 3, 5, 2. Three frames, initially empty, are managed by the clock (second-chance)…