CS FundamentalsModerateWipro · Cognizant pattern
Reference string: 3, 1, 4, 3, 2, 1, 5, 3, 4, 1, 2, 5, 4. With 3 frames, initially empty, how many page faults does FIFO produce?
- A. 12
- B. 7
- C. 5
- D. 11
Correct answer: D. 11
Faults on 3, 1, 4 (cold), then 2 (evict 3), 1 is a hit, 5 (evict 1), 3 (evict 4), 4 (evict 2), 1 (evict 5), 2 (evict 3), 5 (evict 4), 4 (evict 1). Only references 3 (4th) and 1 (6th) hit, so 11 faults. LRU would give 12, OPT 7, and 5 counts only the cold misses.
More Operating Systems questions
- A paging system with a single-level page table has a TLB lookup time of 10 ns, a memory access time of 80 ns, and a TLB hit ratio of 85%…
- Memory access time is 100 ns and servicing a page fault takes 10 ms. If 1 access in 1,000 causes a page fault, the effective access time…
- Five processes P0–P4 and three resource types A, B, C. Allocation: P0 (1,0,1), P1 (2,1,1), P2 (0,1,2), P3 (1,1,0), P4 (0,0,2). Max: P0…
- Two processes must run statements S1 (in P1) and S2 (in P2) such that S2 never executes before S1. Using one semaphore sync, which is…
- A system has 32-bit virtual addresses, 4 KB pages and 4-byte page-table entries, and every page table must fit exactly in one page. How…
- A Unix-style inode has 12 direct pointers, 1 single-indirect and 1 double-indirect pointer. The block size is 1 KB and a block pointer is…