Skip to main content

Operating System MCQs with Answers

Practice important Operating System MCQs with answers and explanations.

Chapter: 37
Q1021:
The valid-invalid bit in a page table entry is used to indicate:
A. Whether the page is in memory
B. Whether the page is locked
C. Whether the page has been accessed recently
D. Whether the page is valid for execution
Correct Answer: A
Chapter: 37
Q1022:
The primary benefit of virtual memory is that it allows:
A. Efficient use of available physical memory
B. Faster CPU performance
C. Direct access to physical memory
D. None of the above
Correct Answer: A
Chapter: 37
Q1023:
In demand paging, when a page fault occurs, the operating system must do which of the following?
A. Swap the entire process into memory
B. Read the page from disk and load it into memory
C. Terminate the process
D. Allocate more CPU cycles
Correct Answer: B
Chapter: 38
Q1024:
What is the primary goal of page replacement algorithms?
A. Minimize disk space
B. Minimize number of page faults
C. Increase memory usage
D. Minimize process execution time
Correct Answer: B
Chapter: 38
Q1025:
What is the formula for calculating Effective Access Time (EAT)?
A. 100 * (1-p) + (105 + 2 * 104 + 0.5 * 107 + 0.5 * 2 * 107) * p
B. 100 * (1-p) + (105 + 2 * 104 + 0.5 * 107 + 0.5 * 2 * 107) * p
C. 100 * p + (105 + 2 * 104 + 0.5 * 107 + 0.5 * 2 * 107) * p
D. None of the above
Correct Answer: B
Chapter: 38
Q1026:
What is the page fault rate for a good performance?
A. Above 50%
B. Below 1%
C. Above 5%
D. None of the above
Correct Answer: B
Chapter: 38
Q1027:
What system call is used to create a child process as a duplicate of its parent?
A. fork()
B. exec()
C. clone()
D. vfork()
Correct Answer: A
Chapter: 38
Q1028:
Which memory management technique is used to minimize the number of new pages allocated to child processes?
A. Copy on Write
B. Demand Paging
C. Memory Mapped Files
D. Page Replacement
Correct Answer: A
Chapter: 38
Q1029:
What is the main difference between fork() and vfork()?
A. vfork() creates a new process with its own address space
B. fork() uses copy-on-write to create a child process
C. vfork() creates a child process using the parent's address space
D. fork() operates slower than vfork()
Correct Answer: C
Chapter: 38
Q1030:
In which system call are shared pages marked as read-only after the fork() system call?
A. mmap()
B. fork()
C. vfork()
D. clone()
Correct Answer: B
Chapter: 38
Q1031:
Which system call is used to memory-map a file in a UNIX system?
A. mmap()
B. open()
C. read()
D. write()
Correct Answer: A
Chapter: 38
Q1032:
What is the key advantage of memory-mapped files over traditional file I/O?
A. Improved CPU performance
B. Reduced disk access
C. Increased file security
D. Easy debugging
Correct Answer: B
Chapter: 38
Q1033:
What happens when the page to be replaced is "dirty" in the example of effective access time calculation?
A. It requires more time for swap
B. It reduces page swap time
C. It doesn't affect swap time
D. None of the above
Correct Answer: A
Chapter: 38
Q1034:
What operating systems commonly use the copy-on-write technique?
A. Linux, Solaris 2, Windows 2000
B. Windows XP, Windows 10
C. Linux, macOS
D. Windows 98, Linux
Correct Answer: A
Chapter: 38
Q1035:
Which of the following operations is NOT a part of memory-mapped file usage?
A. Initial access via demand paging
B. Page fault handling
C. Using mmap() to map file into memory
D. Immediate file writes to disk
Correct Answer: D
Chapter: 38
Q1036:
What happens when you close a memory-mapped file?
A. Memory is freed immediately
B. Memory-mapped data is written back to disk
C. All pages are cleared
D. Changes are not saved
Correct Answer: B
Chapter: 38
Q1037:
Which system call is used to request the operating system to memory-map an opened file in UNIX?
A. mmap()
B. open()
C. read()
D. write()
Correct Answer: A
Chapter: 38
Q1038:
When is vfork() particularly useful?
A. When a child process must share its address space with the parent
B. When the child process calls exec() immediately after creation
C. When memory efficiency is less important
D. None of the above
Correct Answer: B
Chapter: 38
Q1039:
What is the result of using mmap() for file I/O?
A. File I/O operations will always be faster than normal I/O
B. Memory and file I/O become equivalent operations
C. Files cannot be modified after being mapped
D. None of the above
Correct Answer: B
Chapter: 38
Q1040:
Which of the following is the correct system call for handling traditional file I/O in UNIX?
A. mmap()
B. open()
C. read()
D. write()
Correct Answer: B

Test Your Knowledge

Take a timed quiz on Operating System

🚀 Start Quiz Now