CS FundamentalsVery hardGATE CS (PYQ pattern)
A 3-level feedback queue scheduler uses strict priority between levels. Level 0 has quantum 2 ms, level 1 has quantum 4 ms, level 2 is FCFS (run to completion). New jobs enter level 0; a job that uses its entire quantum drops one level; a job preempted by a newly arrived higher-level job goes to the tail of its own level and gets a fresh quantum later. Jobs (arrival, burst) in ms: A (0, 9), B (1, 3), C (3, 6), D (9, 2). At what time does job A complete?
- A. 20 ms
- B. 18 ms
- C. 23 ms
- D. 15 ms
Correct answer: A. 20 ms
Unit-step simulation of the rules gives completion times {'D': 11, 'B': 12, 'C': 16, 'A': 20}. A is demoted to level 1 and later to level 2, where it waits for every other job, so it finishes last.
More Operating Systems questions
- Two processes i and j (j is the other one) use shared flag[2] (initially false) and turn to guard a critical section. Entry code of four…
- Arrays A and B are 128 x 128 int matrices stored row-major, 4-byte ints, 512-byte pages (each row occupies exactly one page, A and B…
- A Unix-like file system has 1 KB blocks, 4-byte pointers, and inodes with 10 direct pointers and one single-indirect pointer. Every…
- Banker's algorithm with 3 resource types. Allocation: P0 (1,0,0), P1 (1,2,0), P2 (0,0,0), P3 (1,4,3), P4 (3,1,1). Maximum: P0 (5,3,2), P1…
- Every fork() succeeds, wait() blocks until some child has terminated (it returns at once if the caller has no un-waited children), and…
- A buddy allocator manages 1024 KB (minimum block 16 KB, requests rounded up to powers of two; the lowest-addressed free block of the…