CS FundamentalsHardGATE CS · Amazon/Microsoft SDE MCQ
Preemptive priority scheduling (smaller number = higher priority; a running process is not preempted by an equal priority). Processes (arrival, burst, priority): P1 (0, 5, 3), P2 (1, 3, 1), P3 (2, 4, 2), P4 (4, 2, 1), P5 (6, 3, 0). What is the average waiting time?
- A. 3.2
- B. 3.8
- C. 4.6
- D. 2.4
Correct answer: B. 3.8
P1 0-1, P2 1-4 (P4 arrives at 4 with equal priority but P2 is done), P4 4-6, P5 6-9, P3 9-13, P1 13-17. Waiting: P1 12, P2 0, P3 7, P4 0, P5 0, total 19, average 3.8.
More Operating Systems questions
- 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…
- For the reference string 3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9, 3, going from 3 frames to 4 frames changes the FIFO fault count from…
- A system has 40-bit virtual addresses, 8 KB pages and 4-byte page-table entries, and every page-table level must fit in one page. How many…