CS FundamentalsVery hardGATE CS (PYQ pattern)
Working-set window Δ = 5 references: WS(t) is the set of distinct pages among the 5 most recent references up to and including time t (fewer than 5 references exist at the start). Reference string (times 1 to 24): 3, 2, 4, 6, 1, 1, 7, 5, 1, 3, 5, 1, 5, 2, 1, 1, 4, 4, 1, 2, 1, 5, 4, 1. At how many of the 24 instants is the working-set size exactly 4?
- A. 13
- B. 9
- C. 11
- D. 20
Correct answer: C. 11
Sliding the 5-reference window gives sizes [1, 2, 3, 4, 5, 4, 4, 4, 3, 4, 4, 3, 3, 4, 3, 3, 4, 3, 2, 3, 3, 4, 4, 4]; exactly 11 of them equal 4.
More Operating Systems questions
- Semaphores x = 0, y = 0. P1: print a; signal(x); wait(y); print b. P2: wait(x); print c; signal(y); print d. P3: print e. All three start…
- A Unix file system uses 4 KB blocks, 4-byte pointers and inodes with 12 direct pointers, one single-, one double- and one triple-indirect…
- Eight disks can be arranged as RAID 1+0 (4 mirrored pairs, striped together) or as RAID 0+1 (two 4-disk stripe sets, the second mirroring…
- Assume every fork() succeeds (it returns a non-zero value in the parent and 0 in the child) and each process prints X once when it reaches…
- Assume every fork() succeeds and output is unbuffered. int main(void) { int i; for (i = 0; i < 3; i++) { if (fork() == 0 && fork() == 0)…
- Banker's algorithm with two resource types (R1, R2). Allocation: P0 (0,2), P1 (1,4), P2 (0,4), P3 (6,1), P4 (0,2). Maximum: P0 (1,4), P1…