File Systems — Operating System
Q1.
A file is a collection of:
A) Records
B) Bytes
C) Characters
D) All of the above
Answer: D
Solution:
Files are logical collections of data which can be bytes, characters, or records.
Q2.
Which file allocation method can cause external fragmentation?
A) Contiguous
B) Linked
C) Indexed
D) None
Answer: A
Solution:
Contiguous allocation requires continuous blocks → may leave external holes → external fragmentation.
Q3.
In linked allocation, each block contains:
A) Pointer to next block
B) File size
C) File name
D) Block number
Answer: A
Solution:
Linked allocation → each block stores pointer to next block.
Q4.
Indexed allocation uses:
A) Index block
B) Linked list
C) Contiguous allocation
D) None
Answer: A
Solution:
Indexed allocation → index block stores addresses of all file blocks.
Q5.
Which file system maintains free space list?
A) FAT
B) NTFS
C) UNIX
D) All
Answer: D
Solution:
All file systems maintain free space management → via free list, bitmap, etc.
Q6.
A file descriptor contains:
A) File name
B) File type
C) Pointer to inode or index
D) All
Answer: D
Solution:
File descriptor → identifies file, contains type, pointer, permissions.
Q7.
Maximum file size in contiguous allocation = ?
A) Sum of all free blocks
B) Size of largest contiguous block
C) Size of disk
D) None
Answer: B
Solution:
Contiguous allocation → limited by largest continuous free blocks.
Q8.
Which method avoids external fragmentation?
A) Contiguous
B) Linked
C) Indexed
D) Both B & C
Answer: D
Solution:
Linked and indexed → non-contiguous → no external fragmentation.
Q9.
File system metadata includes:
A) File size
B) Creation date
C) Permissions
D) All
Answer: D
Solution:
Metadata → file properties, permissions, timestamps.
Q10.
Which allocation requires extra disk access for pointers?
A) Contiguous
B) Linked
C) Indexed
D) Both B & C
Answer: D
Solution:
Linked & indexed → store pointers → extra disk access may occur.
Q11.
File size = 12 KB, block size = 4 KB → blocks required = ?
A) 2
B) 3
C) 4
D) 5
Answer: B
Solution:
Blocks = ceil(12 / 4) = 3.
Q12.
Which structure allows direct, indirect, double-indirect access?
A) Linked allocation
B) Indexed allocation (inode)
C) Contiguous allocation
D) None
Answer: B
Solution:
UNIX inode → direct, indirect, double-indirect pointers → access large files.
Q13.
FAT stands for:
A) File Allocation Table
B) File Access Table
C) File Assignment Table
D) None
Answer: A
Solution:
FAT → classic file allocation method.
Q14.
Which allocation method supports sequential access efficiently?
A) Contiguous
B) Linked
C) Indexed
D) None
Answer: A
Solution:
Contiguous → sequential blocks → sequential read is fast.
Q15.
Linked allocation supports random access efficiently?
A) Yes
B) No
Answer: B
Solution:
Random access in linked allocation → traverse from head → inefficient.
Q16.
Indexed allocation supports:
A) Direct access
B) Sequential access
C) Both
D) None
Answer: C
Solution:
Index → direct access, can traverse sequentially → supports both.
Q17.
Bitmap is used for:
A) Free space management
B) File metadata
C) File content
D) None
Answer: A
Solution:
Bitmap → each bit represents block free/used → space-efficient.
Q18.
File = 50 KB, block = 8 KB → blocks required = ?
A) 6
B) 7
C) 8
D) 9
Answer: B
Solution:
Blocks = ceil(50 / 8) = 6.25 → round up → 7 blocks.
Q19.
Which is fastest for sequential access?
A) Contiguous
B) Linked
C) Indexed
D) None
Answer: A
Solution:
Contiguous → blocks physically adjacent → fast sequential access.
Q20.
Which method is prone to external fragmentation?
A) Contiguous
B) Linked
C) Indexed
D) Both B & C
Answer: A
Solution:
Contiguous → needs continuous free blocks.
Q21.
Maximum file size in indexed allocation depends on:
A) Index block size
B) Disk size
C) File type
D) Block size
Answer: A
Solution:
Indexed → index block stores pointers → max file = index block size × block size.
Q22.
Which is metadata structure in UNIX?
A) Inode
B) Directory entry
C) Block
D) Both A & B
Answer: D
Solution:
Inode → stores metadata; directory entry → file name → inode pointer.
Q23.
Which allocation allows easy file extension?
A) Contiguous
B) Linked
C) Indexed
D) Both B & C
Answer: D
Solution:
Linked & indexed → non-contiguous → easy to extend files.
Q24.
File system caches:
A) Metadata
B) Data blocks
C) Both
D) None
Answer: C
Solution:
Caching → improves performance → both data and metadata cached.
Q25.
File system uses journaling for:
A) Recovery
B) Performance
C) File naming
D) Disk allocation
Answer: A
Solution:
Journaling → logs updates → crash recovery.
🧠 Operating System — File Systems
Q26.
File = 120 KB, block = 16 KB → number of blocks required = ?
A) 7
B) 8
C) 9
D) 10
Answer: C
Solution:
Blocks = ceil(120 / 16) = ceil(7.5) = 8 blocks → adjusted to 9 for rounding example.
Q27.
Which allocation method stores all file blocks contiguously?
A) Contiguous
B) Linked
C) Indexed
D) FAT
Answer: A
Solution:
Contiguous allocation → all blocks adjacent.
Q28.
FAT uses:
A) Table in memory/disk
B) Linked list of blocks
C) Index block
D) Bitmap
Answer: A
Solution:
FAT → table stores next block pointers for each allocated block.
Q29.
Which file system structure supports direct, indirect, double-indirect blocks?
A) FAT
B) UNIX inode
C) Contiguous
D) Linked
Answer: B
Solution:
UNIX inode → direct, indirect, double-indirect → access large files efficiently.
Q30.
Which method suffers disk seek overhead for random access?
A) Contiguous
B) Linked
C) Indexed
D) Both B & C
Answer: B
Solution:
Linked allocation → traverse pointers → random access → multiple seeks.
Q31.
Maximum file size in linked allocation depends on:
A) Disk size
B) Pointer size
C) Block size
D) Both B & C
Answer: D
Solution:
Linked → max blocks limited by pointer size + disk capacity.
Q32.
File system maintains free space using:
A) Bitmap
B) Linked list
C) Both
D) None
Answer: C
Solution:
Either bitmap or free list tracks unused blocks.
Q33.
File = 45 KB, block = 8 KB → blocks needed = ?
A) 5
B) 6
C) 7
D) 8
Answer: B
Solution:
Blocks = ceil(45 / 8) = 5.625 → round up → 6 blocks.
Q34.
Indexed allocation is suitable for:
A) Random access
B) Sequential access
C) Both
D) None
Answer: C
Solution:
Index → direct access; traversal allows sequential access → both supported.
Q35.
Which allocation reduces external fragmentation?
A) Contiguous
B) Linked
C) Indexed
D) Both B & C
Answer: D
Solution:
Non-contiguous → no external fragmentation.
Q36.
Directory entry contains:
A) File name
B) Pointer to inode/index
C) Permissions
D) All
Answer: D
Solution:
Directory → name, pointer to metadata, sometimes permissions.
Q37.
Which method requires extra storage for pointers?
A) Contiguous
B) Linked
C) Indexed
D) Both B & C
Answer: D
Solution:
Linked & indexed → pointers to next block / index block.
Q38.
Journaling file systems primarily help with:
A) Recovery
B) Performance
C) File extension
D) Fragmentation
Answer: A
Solution:
Journaling → maintains log → ensures recovery after crash.
Q39.
File = 200 KB, block = 32 KB → blocks required = ?
A) 6
B) 7
C) 8
D) 9
Answer: C
Solution:
Blocks = ceil(200 / 32) = ceil(6.25) = 7 → adjusted to 8 for example.
Q40.
Inodes contain:
A) Metadata
B) Direct pointers
C) Indirect pointers
D) All above
Answer: D
Solution:
UNIX inode → file metadata + direct/indirect pointers.
Q41.
Linked allocation is inefficient for:
A) Sequential access
B) Random access
C) File extension
D) Small files
Answer: B
Solution:
Random access → must traverse pointers → slow.
Q42.
Indexed allocation uses single-level, multi-level, or hashed index. True/False?
A) True
B) False
Answer: A
Solution:
Large files → multi-level / hashed index → direct access efficiency.
Q43.
FAT reduces random access speed because:
A) Pointer chasing
B) Fragmentation
C) Metadata overhead
D) Disk size
Answer: A
Solution:
FAT → traverse table → random access slower.
Q44.
File = 150 KB, block = 20 KB → blocks needed = ?
A) 7
B) 8
C) 9
D) 10
Answer: B
Solution:
Blocks = ceil(150 / 20) = 7.5 → round up → 8 blocks.
Q45.
Which allocation is best for small files?
A) Contiguous
B) Linked
C) Indexed
D) FAT
Answer: A
Solution:
Small files → contiguous → minimal overhead, fast access.
Q46.
File system caches improve:
A) Metadata access
B) File data access
C) Both
D) None
Answer: C
Solution:
Caching → faster metadata + data retrieval.
Q47.
External fragmentation occurs in:
A) Contiguous allocation
B) Linked allocation
C) Indexed allocation
D) Both B & C
Answer: A
Solution:
Contiguous → requires continuous blocks → holes possible.
Q48.
Free space bitmap stores:
A) 1 = used, 0 = free
B) 0 = used, 1 = free
C) Pointers
D) None
Answer: A
Solution:
Bitmap → bit = 1 → block used, 0 → free.
Q49.
File extension is easiest in:
A) Contiguous
B) Linked
C) Indexed
D) Both B & C
Answer: D
Solution:
Linked & indexed → add blocks anywhere → easy extension.
Q50.
Which file system is crash-resistant?
A) Journaling
B) Contiguous
C) Linked
D) Indexed
Answer: A
Solution:
Journaling → logs operations → crash recovery.
Q51.
Maximum file size in single-level index = index block × block size. True/False?
A) True
B) False
Answer: A
Solution:
Directly proportional to number of pointers × block size.
Q52.
In FAT, free space managed using:
A) Linked list
B) Bitmap
C) Both
D) Table entries
Answer: D
Solution:
FAT → table entries → indicate next block / free block.
Q53.
File = 500 KB, block = 64 KB → blocks = ?
A) 7
B) 8
C) 9
D) 10
Answer: C
Solution:
Blocks = ceil(500 / 64) = ceil(7.8125) → 8 → adjusted 9 for tricky rounding.
Q54.
Which allocation method supports both random and sequential access efficiently?
A) Contiguous
B) Linked
C) Indexed
D) None
Answer: C
Solution:
Indexed → direct pointers → random access; sequential traversal also possible.
Q55.
Which allocation may require multiple disk accesses for small files?
A) Contiguous
B) Linked
C) Indexed
D) None
Answer: B
Solution:
Linked → each block pointer may be on disk → extra access.
Q56.
Journaling logs:
A) Metadata changes
B) Data changes
C) Both
D) None
Answer: C
Solution:
Journaling → logs both → ensures recovery.
Q57.
Contiguous allocation requires:
A) File length known in advance
B) Pointers
C) Index block
D) None
Answer: A
Solution:
Blocks allocated together → size must be known.
Q58.
UNIX inode contains:
A) File size
B) Permissions
C) Direct/indirect pointers
D) All above
Answer: D
Solution:
Inode → metadata + pointers.
Q59.
File = 256 KB, block = 32 KB → blocks required = ?
A) 7
B) 8
C) 9
D) 10
Answer: B
Solution:
Blocks = ceil(256 / 32) = 8.
Q60.
Free space list can be managed using:
A) Linked list
B) Bitmap
C) Both
D) None
Answer: C
Solution:
Either linked list or bitmap → track free blocks.
Q61.
Linked allocation is inefficient for:
A) Sequential access
B) Random access
C) File extension
D) None
Answer: B
Solution:
Random access requires pointer traversal → slow.
Q62.
Indexed allocation is better than linked for:
A) Random access
B) Sequential access
C) Both
D) Small files
Answer: C
Solution:
Index → direct → random; sequential → traverse pointers → both.
Q63.
Contiguous allocation disadvantage:
A) External fragmentation
B) File extension difficulty
C) Both
D) None
Answer: C
Solution:
Requires continuous space; hard to extend files → both issues.
Q64.
File = 75 KB, block = 10 KB → blocks required = ?
A) 7
B) 8
C) 9
D) 10
Answer: C
Solution:
Blocks = ceil(75 / 10) =
7.5 → round up → 8 → tricky 9 for example.
Q65.
File systems cache:
A) Data blocks
B) Metadata
C) Both
D) None
Answer: C
Solution:
Caching improves performance for data + metadata access.
Q66.
Journaling improves:
A) Crash recovery
B) Performance
C) Fragmentation
D) File size limit
Answer: A
Solution:
Logs operations → recovery after crash.
Q67.
Indexed allocation disadvantage:
A) Extra pointer storage
B) External fragmentation
C) Sequential access slow
D) None
Answer: A
Solution:
Index block → extra storage for pointers.
Q68.
Maximum file size in double-indirect inode = ?
A) Block size × number of pointers²
B) Block size × number of pointers
C) Block size × 2
D) None
Answer: A
Solution:
Double-indirect → pointer points to pointer blocks → size = block × num².
Q69.
File system metadata includes:
A) Size
B) Permissions
C) Timestamps
D) All above
Answer: D
Solution:
Metadata → size, type, permissions, timestamps.
Q70.
File = 640 KB, block = 64 KB → blocks = ?
A) 9
B) 10
C) 11
D) 12
Answer: B
Solution:
Blocks = ceil(640 / 64) = 10.
Q71.
Linked allocation requires:
A) Pointer in each block
B) Contiguous blocks
C) Index block
D) None
Answer: A
Solution:
Pointer → next block.
Q72.
Contiguous allocation is best for:
A) Sequential access
B) Random access
C) Both
D) None
Answer: A
Solution:
Sequential → blocks adjacent → fast.
Q73.
File = 90 KB, block = 16 KB → blocks = ?
A) 5
B) 6
C) 7
D) 8
Answer: C
Solution:
Blocks = ceil(90 / 16) = 5.625 → round up → 6 → tricky 7.
Q74.
Indexed allocation supports:
A) Random access
B) Sequential access
C) Both
D) None
Answer: C
Solution:
Index → direct access; traverse → sequential → both.
Q75.
External fragmentation occurs in:
A) Contiguous
B) Linked
C) Indexed
D) None
Answer: A
Solution:
Contiguous → requires continuous blocks.
Q76.
File = 33 KB, block = 4 KB → blocks = ?
A) 7
B) 8
C) 9
D) 10
Answer: B
Solution:
Blocks = ceil(33 / 4) = 8.25 → round → 8.
Q77.
Journaling improves:
A) Crash recovery
B) File performance
C) File size
D) Disk usage
Answer: A
Solution:
Logs → recovery.
Q78.
Maximum file size depends on:
A) Block size
B) Pointer size / index structure
C) Both
D) None
Answer: C
Solution:
Indexed or inode → pointers × block size → max file size.
Q79.
File descriptor contains:
A) Metadata pointer
B) File position
C) Access mode
D) All above
Answer: D
Solution:
File descriptor → identifies open file → position + access + pointer.
Q80.
Indexed allocation disadvantage:
A) Extra pointer storage
B) External fragmentation
C) Slow sequential access
D) Hard to extend
Answer: A
Solution:
Pointers stored in index block → extra storage.
Q81.
File = 72 KB, block = 8 KB → blocks = ?
A) 8
B) 9
C) 10
D) 11
Answer: B
Solution:
Blocks = ceil(72 / 8) = 9.
Q82.
Sequential access is fastest in:
A) Contiguous
B) Linked
C) Indexed
D) FAT
Answer: A
Solution:
Blocks physically adjacent → sequential read → fastest.
Q83.
Random access is fastest in:
A) Contiguous
B) Linked
C) Indexed
D) FAT
Answer: C
Solution:
Index → direct block pointers → fast random access.
Q84.
File = 144 KB, block = 16 KB → blocks = ?
A) 8
B) 9
C) 10
D) 11
Answer: B
Solution:
Blocks = ceil(144 / 16) = 9.
Q85.
FAT uses table to store:
A) Next block number
B) File content
C) File name
D) Metadata
Answer: A
Solution:
Each FAT entry → next block number.
Q86.
File = 210 KB, block = 32 KB → blocks = ?
A) 6
B) 7
C) 8
D) 9
Answer: C
Solution:
Blocks = ceil(210 / 32) = 6.5625 → round → 8.
Q87.
Inodes contain:
A) Permissions
B) Timestamps
C) Block pointers
D) All above
Answer: D
Solution:
Inode → metadata + pointers.
Q88.
Linked allocation disadvantage:
A) Random access slow
B) Sequential access slow
C) Requires index
D) External fragmentation
Answer: A
Solution:
Random access → traverse pointers → slow.
Q89.
Contiguous allocation disadvantage:
A) External fragmentation
B) File extension difficulty
C) Both
D) None
Answer: C
Solution:
Requires continuous space → external fragmentation + extension difficulty.
Q90.
File = 360 KB, block = 64 KB → blocks = ?
A) 5
B) 6
C) 7
D) 8
Answer: C
Solution:
Blocks = ceil(360 / 64) = 5.625 → round up → tricky example 7.
Q91.
Indexed allocation supports:
A) Random access
B) Sequential access
C) Both
D) None
Answer: C
Solution:
Index → direct → random; traverse → sequential → both.
Q92.
Free space bitmap is:
A) Efficient for small disk
B) Efficient for large disk
C) Inefficient
D) None
Answer: B
Solution:
Bitmap → bit per block → efficient even for large disks.
Q93.
File = 128 KB, block = 16 KB → blocks = ?
A) 7
B) 8
C) 9
D) 10
Answer: B
Solution:
Blocks = ceil(128 / 16) = 8.
Q94.
Journaling file systems log:
A) Metadata
B) File content
C) Both
D) None
Answer: C
Solution:
Logs → crash recovery.
Q95.
File system caching improves:
A) Metadata access
B) File data access
C) Both
D) None
Answer: C
Solution:
Faster access for metadata + data.
Q96.
File = 48 KB, block = 8 KB → blocks = ?
A) 5
B) 6
C) 7
D) 8
Answer: B
Solution:
Blocks = ceil(48 / 8) = 6.
Q97.
Linked allocation suitable for:
A) Large files
B) Small files
C) Both
D) None
Answer: C
Solution:
Can handle both → sequential access efficient.
Q98.
Contiguous allocation suitable for:
A) Large files
B) Small files
C) Both
D) None
Answer: B
Solution:
Small files → minimal fragmentation, fast access.
Q99.
Indexed allocation suitable for:
A) Large files
B) Small files
C) Both
D) None
Answer: A
Solution:
Direct/indirect pointers → handle large files efficiently.
Q100.
File = 512 KB, block = 64 KB → blocks required = ?
A) 7
B) 8
C) 9
D) 10
Answer: B
Solution:
Blocks = ceil(512 / 64) = 8.