☑ MCQ PRACTICE

Operating Systems Unit 5

Practice objective questions for quick revision and examination preparation. Try answering each question before revealing the answer.

📚 Operating Systems
📖 Unit 5
🎯 MCQs

Operating Systems - Unit-5

1
The main purpose of a file system is to:
AOrganize and manage files on storage devices
BIncrease CPU speed
CManage only processes
DReplace virtual memory
Correct AnswerA. Organize and manage files on storage devices
2
Which file access method accesses records in sequence?
ASequential access
BDirect access
CIndexed access
DRandom-only access
Correct AnswerA. Sequential access
3
Direct access to a file allows:
AOnly sequential reading
BAccess to a particular block without reading all previous blocks
COnly writing at the end
DOnly directory access
Correct AnswerB. Access to a particular block without reading all previous blocks
4
A directory is primarily used to:
AOrganize and locate files
BSchedule processes
CManage page faults
DManage CPU registers
Correct AnswerA. Organize and locate files
5
In a single-level directory structure:
AThere is one directory for all files
BEvery file has multiple directories
CDirectories cannot contain files
DEach user must have a separate root directory
Correct AnswerA. There is one directory for all files
6
A tree-structured directory provides:
AHierarchical organization of files and directories
BOnly one directory
CNo subdirectories
DOnly sequential access
Correct AnswerA. Hierarchical organization of files and directories
7
The main purpose of file protection is to:
AControl access to files
BIncrease disk capacity
CIncrease CPU speed
DManage page replacement
Correct AnswerA. Control access to files
8
In UNIX-like systems, the permissions r, w and x represent:
ARead, write and execute
BRun, wait and exit
CRead, wait and execute
DRestore, write and expand
Correct AnswerA. Read, write and execute
9
Which of the following is a common file allocation method?
AContiguous allocation
BPriority allocation
CSemaphore allocation
DThread allocation
Correct AnswerA. Contiguous allocation
10
In contiguous file allocation, a file occupies:
AConsecutive disk blocks
BRandom CPU registers
COnly one byte
DOnly directory blocks
Correct AnswerA. Consecutive disk blocks
11
A major advantage of contiguous file allocation is:
AFast sequential and direct access
BNo need for file names
CNo fragmentation in all cases
DNo need for free-space management
Correct AnswerA. Fast sequential and direct access
12
Linked allocation stores a file as:
AA linked list of disk blocks
BOne contiguous memory segment
COnly one index block
DA page table
Correct AnswerA. A linked list of disk blocks
13
One disadvantage of linked allocation is:
APoor direct access
BIt cannot store large files
CIt cannot use disk blocks
DIt requires contiguous blocks
Correct AnswerA. Poor direct access
14
Indexed allocation uses:
AAn index block containing pointers to file blocks
BOnly contiguous blocks
COnly directory entries
DOnly page tables
Correct AnswerA. An index block containing pointers to file blocks
15
The purpose of free-space management is to:
ATrack unused disk blocks
BTrack CPU registers
CManage process priorities
DReplace page tables
Correct AnswerA. Track unused disk blocks
16
A bitmap for free-space management uses:
ABits to indicate free or allocated blocks
BFiles to represent processes
CPages to represent users
DSemaphores to represent blocks
Correct AnswerA. Bits to indicate free or allocated blocks
17
The open() system call is used to:
AOpen a file and obtain a file descriptor
BDelete a file
CCreate a process
DAllocate a page
Correct AnswerA. Open a file and obtain a file descriptor
18
The create() system call is used to:
ACreate a new file
BRead a process state
CClose a file
DReplace a page
Correct AnswerA. Create a new file
19
The read() system call is used to:
ARead data from an open file
BChange file permissions only
CCreate a directory only
DTerminate a process
Correct AnswerA. Read data from an open file
20
The write() system call is used to:
AWrite data to an open file
BLoad a page into memory
COpen a directory
DSchedule a process
Correct AnswerA. Write data to an open file
21
The close() system call is used to:
AClose an open file and release its file descriptor
BCreate a file
CRead file metadata
DAllocate disk blocks
Correct AnswerA. Close an open file and release its file descriptor
22
The lseek() system call is used to:
AChange the current file offset
BCreate a directory
CClose a process
DDelete page tables
Correct AnswerA. Change the current file offset
23
The stat() system call is used to obtain:
AFile metadata
BCPU priority
CPage frame number
DProcess stack
Correct AnswerA. File metadata
24
The ioctl() system call is commonly used for:
ADevice-specific control operations
BCreating page tables
CCPU scheduling
DProcess termination
Correct AnswerA. Device-specific control operations
25
A file descriptor is:
AAn integer used by a process to identify an open file
BA physical disk block
CA page number
DA directory name
Correct AnswerA. An integer used by a process to identify an open file
26
When open() succeeds, it normally returns:
AA file descriptor
BA process priority
CA page number
DA disk sector size
Correct AnswerA. A file descriptor
27
The current position within an open file is called the:
AFile offset
BPage table
CDirectory pointer
DProcess pointer
Correct AnswerA. File offset
28
Which system call can be used to move the file offset to a different position?
Alseek()
Bstat()
Cclose()
Dioctl()
Correct AnswerA. lseek()
29
Which of the following is NOT a file allocation method?
AContiguous allocation
BLinked allocation
CIndexed allocation
DPriority allocation
Correct AnswerD. Priority allocation
30
Which system call is mainly used for device-specific operations?
Aopen()
Bread()
Cioctl()
Dstat()
Correct AnswerC. ioctl()
← Back to All MCQs