CS FundamentalsHardProduct-company interview pattern
Processes (arrival, burst): P1 (0, 6), P2 (2, 2), P3 (3, 4), P4 (5, 1). Round Robin with quantum 2 is used; a newly arrived process joins the ready queue before a process whose quantum just expired. What is the average waiting time?
- A. 4
- B. 3
- C. 3.5
- D. 6.75
Correct answer: C. 3.5
Gantt: P1 0–2, P2 2–4, P1 4–6, P3 6–8, P4 8–9, P1 9–11, P3 11–13. Completions: P1 11, P2 4, P3 13, P4 9. Waiting = TAT − burst: 5, 0, 6, 3 → 14/4 = 3.5. 6.75 is the average turnaround time.
More Operating Systems questions
- Processes (arrival, burst): P1 (0, 8), P2 (1, 4), P3 (2, 2), P4 (3, 5). What is the average waiting time under preemptive SJF (Shortest…
- Reference string: 5, 2, 5, 8, 2, 3, 5, 9, 8, 2, 3, 5. With 3 frames, initially empty, how many page faults does LRU replacement cause?
- Reference string: 1, 3, 0, 3, 5, 6, 3, 1, 0, 6, 5, 3. With 3 frames, initially empty, how many page faults does the Optimal (Belady’s MIN)…
- A disk has cylinders 0–199 and the head is at cylinder 100. Pending requests: 45, 130, 12, 180, 90, 150, 60. What is the total head…
- Three processes share a single resource type with identical instances. Their maximum needs are 3, 4 and 5 instances. What is the minimum…
- Which of the following is NOT a requirement for a correct solution to the critical-section problem?