CS FundamentalsVery hardGATE CS (PYQ pattern)
LRU-2 replacement: on a fault the victim is the resident page whose SECOND most recent reference is oldest (a page referenced only once counts as infinitely old; ties are broken by the older most recent reference). With 3 frames (initially empty) and the string 2, 3, 2, 1, 5, 2, 1, 5, 6, 3, 6, 4, 1, 1, 1, 6, 5, 2, 1, 4, 4, 1, 6, 4, how many faults occur?
- A. 13
- B. 12
- C. 10
- D. 11
Correct answer: D. 11
Tracking the last two reference times of each page gives 11 faults; plain LRU on the same string gives 13.
More Operating Systems questions
- The aging algorithm keeps an 8-bit counter per page (initially 0). At every clock tick each counter is shifted right by one bit and the…
- A single resource has 9 units and three processes have maximum claims 6, 5 and 4. Consider every possible current allocation (a0, a1, a2)…
- An ext3-style file system appends one data block to a file; the update also modifies the inode and the block bitmap. In ORDERED journaling…
- A RAID 0 array has 5 disks and a chunk size of 4 blocks (chunk k is on disk k mod 5, as the (k div 5)-th chunk on that disk). On which…
- An inode has 12 direct pointers, one single-, one double- and one triple-indirect pointer; blocks are 2048 bytes and pointers are 4 bytes…
- A parent creates a pipe, forks, and the child loops on read(fd[0], buf, 1) until it returns 0. The parent writes 3 bytes into fd[1] and…