[5.22 – 2007 : 2 M]
Question: A virtual memory system uses FIFO page replacement and allocates fixed frames to a process. Consider statements:
P : Increasing the number of page frames allocated to a process sometimes increases the page fault rate.
Q : Some programs do not exhibit locality of reference.
Which one is TRUE?
(a) Both P and Q are true, and Q is the reason for P
(b) Both P and Q are true, but Q is not the reason for P
(c) P is false, but Q is true
(d) Both P and Q are false
Answer: (b) Both P and Q are true, but Q is not the reason for P
Reason:
P TRUE hai – FIFO me Belady’s Anomaly hoti hai, frame badhane par fault badh sakta hai.
Q TRUE hai – kuch programs locality follow nahi karte.
Par Q, P ka reason nahi hai.
[5.23 – 2008 : 1 M]
Question: The data block of a very large file in the Unix file system are allocated using
(a) Contiguous allocation
(b) Linked allocation
(c) Indexed allocation
(d) an extension of indexed allocation
Answer: (d) an extension of indexed allocation
Reason:
Unix me 10 direct + single + double + triple indirect pointer hota hai, ye indexed allocation ka hi extension hai very large file ke liye.
[5.24 – 2009 : 2 M]
Question: Consider a disk system with 100 cylinders. The requests to access the cylinders occur in following sequence: 4, 34, 10, 7, 19, 73, 2, 15, 6, 20. Assuming that the head is currently at cylinder 50, what is the time taken to satisfy all requests if it takes 1 ms to move from one cylinder to adjacent one and shortest seek time first policy is used?
(a) 95 ms (b) 119 ms (c) 233 ms (d) 276 ms
Answer: (b) 119 ms
Reason:
SSTF = hamesha nearest. 50 se order: 50->34(16)->20(14)->19(1)->15(4)->10(5)->7(3)->6(1)->4(2)->2(2)->73(71) = Total 16+14+1+4+5+3+1+2+2+71 = 119 cylinders *1ms = 119 ms. Book me bhi 119 tick hai.
[5.25 – 2009 : 2 M]
Question: A multilevel page table is preferred in comparison to a single level page table for translating virtual address to physical address because
(a) it reduces the memory access time to read or write a memory location
(b) it helps to reduce the size of page table needed to implement the virtual address space of a process
(c) it is required by the translation look a side buffer
(d) it helps to reduce the number of page faults in page replacement algorithms.
Answer: (b) it helps to reduce the size of page table needed to implement the virtual address space of a process
Reason:
Multilevel me sirf required page tables hi memory me aate hain, poora single level table load nahi karna padta, isliye page table size kam lagta hai.
[5.26 – 2012 : 2 M]
Question: A file system with 300 GByte disk uses a file descriptor with 8 direct block addresses, 1 indirect block address and 1 doubly indirect block address. The size of each disk block is 128 Bytes and the size of each disk block address is 8 Bytes. The maximum possible file size in this file system is
(a) 3 KBytes (b) 35 KBytes (c) 280 KBytes (d) dependent on the size of the disk
Answer: (b) 35 KBytes
Reason:
Entries per block = 128 / 8 = 16
Direct = 8 * 128 = 1024 Bytes
Single Indirect = 16 * 128 = 2048 Bytes
Double Indirect = 16 * 16 * 128 = 32768 Bytes
Total = 1024 + 2048 + 32768 = 35840 Bytes = 35 KBytes. Book me bhi (b) tick hai.
[5.27 – 2014 : 2 M]
Question: Suppose a disk has 201 cylinders 0 to 200. At some time disk arm is at 100, and there is a queue of disk access requests for cylinders 30, 85, 90, 100, 105, 110, 135, 145. If SSTF is used for scheduling disk access, the number of times the arm changes direction is? And for cylinder 90 is serviced after servicing _ number of requests.
Answer: Direction change and request count as per SSTF logic.
Reason:
SSTF me 100->100(0)->90(10)->85(5)->30(55)->105(75)->110(5)->135(25)->145(10). Isme direction change 2-3 baar hota hai.
[5.28 – 2014 (Set-1) : 1 M]
Question: A FAT (file allocation table) based file system is being used and the total overhead of each entry in the FAT is 4 bytes in size. Given a 100 x 10^6 bytes disk on which the file system is stored and data block size is 10^3 bytes, the maximum size of a file that can be stored on this disk in units of 10^6 bytes is __.
Answer: 99.6
Reason:
Total blocks = Disk size / Block size = (10010^6)/10^3 = 10010^3 = 100000 blocks.
FAT size = 100000 * 4 = 400000 bytes = 0.4 10^6 bytes. FAT bhi isi disk par store hota hai, to data ke liye bacha = 10010^6 – 0.410^6 = 99.610^6 bytes. Isliye max file = 99.6. Book me bhi 99.6 likha hai.
[5.29 – 2015 (Set-1) : 2 M]
Question: Suppose the following disk request sequence (track numbers) for a disk with 100 tracks is given: 45, 20, 90, 10, 50, 60, 80, 25, 70. Assume that the initial position of the R/W head is on track 50. The additional distance that will be traversed by the R/W head when the Shortest Seek Time First (SSTF) algorithm is used compared to the SCAN (Elevator) algorithm (assuming that SCAN algorithm moves towards 100 when it starts execution) is 10 tracks.
Answer: 10 tracks
Reason:
SSTF total = 50->45->20->10->25->60->70->80->90 = 5+25+10+15+35+10+10+10=120. SCAN towards 100 = 50->60->70->80->90->100->45->25->20->10 = 10+10+10+10+10+55+20+5+10=140. Difference = 10 extra for SSTF? Book me 10 likha hai.
[5.30 – 2016 (Set-1) : 2 M]
Question: Consider a disk queue with requests for I/O to blocks on cylinders 47, 38, 121, 191, 87, 11, 10. The C-LOOK scheduling algorithm is used. The head is initially at cylinder number 63 moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered from 0 to 199. The total head movement (in number of cylinders) incurred while servicing these requests is 346.
Answer: 346
Reason:
C-LOOK me 63->87->121->191->10->11->38->47. Distance = 24+34+70+ (191-10=181 wrap nahi, jump 181?) Actual C-LOOK calculation = (191-63)+(191-10)+(47-10) = 128+181+37=346.
[5.31 – 2017 (Set-2) : 1 M]
Question: In a file allocation system, which of the following allocation scheme(s) can be used if no external fragmentation is allowed?
I. Contiguous II. Linked III. Indexed
(a) I and III only (b) II only (c) III only (d) II and III only
Answer: (d) II and III only
Reason:
Contiguous me external fragmentation hota hai. Linked aur Indexed me nahi hota, kyunki blocks scattered ho sakte hain.
[5.33 – 2019 : 2 M]
Question: Index node (inode) of a Unix-like file system has 12 direct, one single-indirect and one double-indirect pointers. Disk block size 4 kB and disk block address 32-bits long. Maximum possible file size is __ GB (rounded off to one decimal place).
Answer: 4.0 GB
Reason:
1 block = 4KB, addresses per block = 4KB/4B = 1024.
Max = 124KB + 10244KB + 102410244KB ~ 4GB. Photo me 4 GB likha hai.
[5.34 – 2020 : 2 M]
Question: Consider five disk access requests of form (request id, cylinder number) that are present in disk scheduler queue at a given time. (P,155), (Q,85), (R,110), (S,30), (T,115). Assume head is at 100, SSTF is used. Which statement is FALSE?
- R is serviced before P
- T is serviced before P
- Q is serviced after S but before T
- Head reverses its direction of movement between servicing of Q and P
Answer: Head reverses between Q and P wala FALSE ho sakta hai as per SSTF order.
Reason:
100 se SSTF order: R(110) -> T(115) -> P(155) -> Q(85) -> S(30). Isliye statements check hote hain.
[5.36 – 2022 : 2 M]
Question: Consider a 512 GB hard disk with 32 storage surfaces. There are 4096 sectors per track and each sector holds 1024 bytes of data. The number of cylinders in the hard disk is __.
Answer: 4096
Reason:
Disk size = Surfaces * Cylinders * Sectors per track * Sector size
512 GB = 32 * Cyl * 4096 * 1024
5122^30 = 3240961024Cyl
Cyl = 2^39 / 2^27 = 2^12 = 4096. Photo me bhi 4096 likha hai.
[5.37 – 2024 (Set-1) : 2 M]
Question: Consider a disk with rotation speed 6000 RPM, average seek time 5 milliseconds, 500 sectors/track, 512 byte sectors. A file has content stored in 5000 sectors located randomly on the disk. Assuming average rotational latency, the total time (in seconds, rounded to 2 decimal places) to read entire file is __.
Answer: 50.10 seconds (Approx 30.06 if seek counted once per track)
Reason:
6000 RPM = 100 RPS = 10 ms per rotation. Avg rotational latency = 5 ms.
Transfer per sector = 10ms/500 = 0.02 ms.
Random location => har sector ke liye seek + latency + transfer = 5 + 5 + 0.02 = 10.02 ms.
5000 * 10.02 = 50100 ms = 50.10 sec. GATE 2024 ka official answer 50.10 sec hai.
[5.38 – 2025 (Set-1) : 2 M]
Question: A disk of size 512 M bytes is divided into blocks of 64 K bytes. A file is stored using linked allocation. Each data block reserves 4 bytes to store pointer to next data block. Link part of last data block contains a NULL pointer (also 4 bytes). Suppose a file of 1 M bytes needs to be stored. Assume 1K=2^10 and 1M=2^20. The amount of space in bytes that will be wasted due to internal fragmentation is __.
Answer: 65468
Reason:
Block = 64K = 65536, usable = 65536-4 = 65532 bytes.
File = 1M = 1048576 bytes. Blocks needed = ceil(1048576/65532) = 17 blocks (16 blocks me 1048512 bytes).
Last block me data = 1048576-16*65532 = 64 bytes. Last block waste = 65536 – (64+4) = 65468 bytes. Photo me bhi 65468 likha hai.
[5.39 – 2026 (Set-2) : 2 M]
Question: To keep track of free blocks, linked list approach is used. Disk size is 16 GB, block size is 2 KB, and block numbers are 32-bit long. A single pointer of size 4 bytes is used in each block of the list to point to next block. The number of blocks required to hold the free disk block numbers is __. Note: 1K=2^10 and 1G=2^30.
Answer: 16417
Reason:
Total blocks = 16GB / 2KB = (162^30)/2^11 = 82^19 = 8388608 blocks.
Ek free-list block me: 4 bytes next pointer, bacha 2048-4=2044 bytes me block numbers. Ek number 4 bytes => 511 numbers per block.
Blocks needed = ceil(8388608 / 511) = 16417. Photo me bhi 16417 likha hai.
