Font size
WorksheetsMockTestOperatingSystem
Total questions: 81
Worksheet time: 27mins
Which layer of a computer system directly interacts with the hardware components?
Application Programs
System Programs
Hardware
Operating System
Which of the following is considered the primary purpose of an Operating System?
To increase hardware cost
To act as an intermediary between a computer user and the computer hardware
To serve as a Control Program
To generate data visualization graphics
A Batch Operating System is characterized by processing jobs in:
A prioritized, first-come-first-served manner
Real-time, instantaneous order
Groups, without direct interaction between the user and the jobs
Time slices, allowing multiple users to share resources simultaneously
Which feature of an Operating System is responsible for continually ensuring that the system is operating correctly by monitoring hardware and software for possible errors?
Resource Allocation
I/O Operations
Memory Management
Error Detection and Handling
The operating system's ability to run multiple processes seemingly simultaneously, managed by rapid context switching, is the primary characteristic of which classification of OS?
Concurrent Operating Systems
Real-time Operating Systems
Distributed Operating Systems
Single-tasking Operating Systems
Which type of User Interface is characterized by commands or codes being entered at a command prompt to perform operations?
Graphical User Interface (GUI)
Command Line Interface (CLI)
Batch Interface
Voice User Interface (VUI)
A primary advantage of implementing OS Virtualization is:
Direct access to the host's physical hardware for guest operating systems
Isolation, allowing separate environments to run on a single physical machine
Elimination of all operating system-level overhead
Increased hardware cost and reduced resource utilization
The term for the time it takes to stop one process and start running another, saving the state of the old process and loading the saved state for the new process, is known as:
Trap
Context Switch
Mode Switch
System Call
In the Deadlock model, what type of resource is shareable and typically does not require mutual exclusion?
Non-preemptable resource
Read-only file
Serially reusable resource
Preemptable resource
Which of the four conditions necessary for a Deadlock to occur is violated when all resources are either shareable or, if exclusive, a process can be forced to temporarily relinquish a resource it holds?
Circular Wait
No Preemption
Hold and Wait
Mutual Exclusion
The process of swapping pages between main memory and secondary storage on demand, where a page is only moved to main memory when it is actually referenced, is called:
Internal Fragmentation
Demand Paging
Thrashing
Virtual Segmentation
Which memory management technique is defined by fixed-size divisions of memory that may result in internal fragmentation?
Variable-Partitioning Scheme
Fixed-Partitioning Scheme
Segmentation
Paging
Consider four processes P1, P2, P3, and P4 with Arrival Times (AT) 0, 1, 2, 3 ms and Burst Times (BT) 10, 5, 2, 4 ms, respectively. What is the Completion Time (CT) for process P3 using the First-Come, First-Served (FCFS) scheduling algorithm?
15ms
10ms
21ms
17ms
Using the same processes from Q13 (P1 (10, 0), P2 (5, 1), P3 (2, 2), P4 (4, 3) ), what is the Waiting Time (WT) for process P4 using FCFS?
17ms
10ms
14ms
13ms
Consider four processes P1, P2, P3, and P4 with Arrival Times (AT) 0, 1, 2, 3 ms and Burst Times (BT) 10, 5, 2, 4 ms, respectively.
Using the processes from the above, what is the Average Waiting Time (Avg WT) using the FCFS algorithm?
11.25ms
9ms
10.5ms
13.25ms
Consider four processes P1, P2, P3, and P4 with Arrival Times (AT) 0, 1, 2, 3 ms and Burst Times (BT) 10, 5, 2, 4 ms, respectively.
Using the processes from the above, what is the Completion Time (CT) for process P2 using the Non-Preemptive Shortest Job First (SJF) scheduling algorithm?
10ms
21ms
16ms
12ms
Consider four processes P1, P2, P3, and P4 with Arrival Times (AT) 0, 1, 2, 3 ms and Burst Times (BT) 10, 5, 2, 4 ms, respectively.
Using the processes from the above, and the Non-Preemptive SJF algorithm, what is the Waiting Time (WT) for process P3?
15ms
10ms
21ms
17ms
Consider four processes P1, P2, P3, and P4 with Arrival Times (AT) 0, 1, 2, 3 ms and Burst Times (BT) 10, 5, 2, 4 ms, respectively.
Using the processes from the above and the Non-Preemptive SJF algorithm, what is the Waiting Time (WT) for process P3?
0ms
10ms
13ms
8ms
Consider four processes P1, P2, P3, and P4 with Arrival Times (AT) 0, 1, 2, 3 ms and Burst Times (BT) 10, 5, 2, 4 ms, respectively.
Using the processes from Q13 and the Non-Preemptive SJF algorithm, what is the Average Turnaround Time (Avg TAT)?
9ms
13.25ms
10ms
14.5ms
Consider four processes P1, P2, P3, and P4 with Arrival Times (AT) 0, 1, 2, 3 ms and Burst Times (BT) 10, 5, 2, 4 ms, respectively.
Using the processes from Q13 and the Round Robin (RR) algorithm with a time slice q = 2ms, what is the Completion Time (CT) for process P4?
12ms
16ms
14ms
21ms
Consider four processes P1, P2, P3, and P4 with Arrival Times (AT) 0, 1, 2, 3 ms and Burst Times (BT) 10, 5, 2, 4 ms, respectively.
Using the processes from Q13 and the Round Robin (RR) algorithm with a time slice q = 2ms, what is the Waiting Time (WT) for process P2?
15ms
11ms
9ms
16ms
Consider four processes P1, P2, P3, and P4 with Arrival Times (AT) 0, 1, 2, 3 ms and Burst Times (BT) 8, 4, 9, 5 ms, respectively. What is the Completion Time (CT) for process P1 using the Shortest Remaining Time First (SRTF) scheduling algorithm (preemptive)?
10ms
17ms
5ms
20ms
Consider four processes P1, P2, P3, and P4 with Arrival Times (AT) 0, 1, 2, 3 ms and Burst Times (BT) 8, 4, 9, 5 ms, respectively.
Using the SRTF processes from Q21, what is the Waiting Time (WT) for process P3?
24ms
9ms
15ms
2ms
Consider four processes P1, P2, P3, and P4 with Arrival Times (AT) 0, 1, 2, 3 ms and Burst Times (BT) 8, 4, 9, 5 ms, respectively.
Using the SRTF processes from Q21, what is the Average Waiting Time (Avg WT) for all processes?
6.5ms
9ms
14ms
13ms
Consider four processes P1, P2, P3, and P4 with Arrival Times (AT) 0, 1, 2, 3 ms and Burst Times (BT) 8, 4, 9, 5 ms, respectively.
What is the Average Turnaround Time (Avg TAT) for all processes using the SRTF algorithm with the processes from the above information.
11.25ms
14ms
13ms
26ms
Three processes P1, P2, and P3 have Arrival Times (AT) of 0, 0, 0 ms and Burst Times (BT) of 24, 3, 3 ms. Assuming FCFS scheduling order P1, P2, P3, what is the Average Waiting Time (Avg WT)?
9ms
10ms
17ms
30ms
Three processes P1, P2, and P3 have Arrival Times (AT) of 0, 0, 0 ms and Burst Times (BT) of 24, 3, 3 ms.
Using the processes from the above, what is the Average Waiting Time (Avg WT) if the Non-Preemptive Shortest Job First (SJF) algorithm is used (assuming order P2, P3, P1 for tie-breaking)?
9ms
17ms
6ms
3ms
The Non-Preemptive SJF scheduling algorithm is provably optimal in terms of minimizing which performance metric?
Maximum Waiting Time
Average Waiting Time (Avg WT)
CPU Utilization
Context Switch Overhead
A scheduling algorithm where a high-priority process can interrupt and halt a currently running low-priority process is an example of:
Non-preemptive scheduling
Preemptive scheduling
Multi-level Feedback Queue scheduling
Starvation
Which of the following is a key advantage of the Round Robin (RR) scheduling algorithm?
Freedom from starvation for all processes
Guaranteed shortest turnaround time for all processes
Simple implementation using priority queues
Minimal Context Switch Overhead
In the process lifecycle, a Context Switch primarily occurs when a process transitions from the running state to which other state?
Terminated
Ready (due to preemption)
Waiting (due to I/O completion)
New
Which of the following is NOT one of the four necessary conditions for a Deadlock to exist in a system?
Resource Preemption
Mutual Exclusion
Hold and Wait
Circular Wait
In the Deadlock Avoidance strategy using the Banker's Algorithm, a process Pi can be safely granted a requested resource Rj if and only if:
The Max required resources are greater than the currently Available resources
The system remains in an Unsafe state after the request is granted.
The new state that results after granting the request is determined to be a Safe state.
The Allocation matrix is entirely composed of zero values for all resources.
In the Banker's Algorithm, the Need matrix for a process Pi is calculated by subtracting the Allocation from the Max matrix. Given Max P1 =(3, 2, 2) and Allocation P1 = (2, 0, 0), what is Need P1 ?
(1, 2, 0)
(5, 2, 2)
(3, 2, 2)
(1, 2, 2)
Consider a system with Total Resources = (10, 5, 7) of types A, B, and C, and a set of processes P0, P1, P2. The total current Allocation is (5, 1, 2). What is the Available resource vector?
(7, 5, 3)
(10, 5, 7)
(5, 1, 2)
(5, 4, 5)
The Resource Allocation Graph (RAG) is a visual model used primarily to detect deadlock conditions. Which statement correctly describes the nature of cycles in the RAG?
A cycle always indicates that the system is in a deadlock state.
A cycle is only relevant if it involves two or more processes of the same resource type.
A system is deadlocked if and only if the RAG contains no cycles.
A cycle only indicates potential deadlock if all resource types have a single instance.
A system state is considered Safe if and only if:
No process currently holds any resources.
The Available resources vector is equal to the Max needs vector.
Every process can complete its execution without requiring any additional resources.
A Safe Sequence of processes exists, where each process can acquire its maximum resources and eventually finish.
Deadlock prevention often requires violating one of the four necessary conditions. Which prevention method leads to low resource utilization due to resources being allocated unnecessarily long?
Violating Circular Wait
Violating No Preemption
Violating Hold and Wait
Violating Mutual Exclusion
In Memory Management, the wasted space left within an allocated memory partition or page when the process size is smaller than the allocated size is called:
Internal Fragmentation
Compaction
Swapping
External Fragmentation
A memory partitioning scheme uses fixed partitions of size 100KB, 200KB, 300KB, and 400KB. If a process P4 requiring 100KB is placed in the 300KB partition, what is the resulting Internal Fragmentation?
0KB
400KB
200KB
100KB
Consider a system where four processes P1 (90KB), P2 (150KB), P3 (350KB), and P4 (100KB) are allocated to fixed partitions of 100KB, 200KB, 400KB, and 300KB respectively. What is the total Internal Fragmentation for all allocated partitions?
400KB
310KB
210KB
250KB
If a memory system uses a 32-bit logical address space and a Page Size of 4 KB, how many bits are required for the Page Offset?
20 bits
12 bits
16 bits
32 bits
Using the same logical address space and page size from Q41 (32bit address, 4KB page size), how many bits are required for the Page Number?
12 bits
40 bits
32 bits
20 bits
Which dynamic memory allocation strategy searches for the smallest hole that is large enough to satisfy the process request?
Worst-Fit
Compaction
Best-Fit
First-Fit
The primary goal of Virtual Memory is to:
Allow a process's logical address space to be larger than physical memory.
Force all programs to be stored in contiguous memory blocks.
Increase the time required for a context switch between processes.
Completely eliminate both internal and external fragmentation.
Which of the following is a key advantage of Demand Segmentation over simple Paging?
It allows the user to view memory in logical units that relate to the program's structure
It simplifies memory allocation to a fixed-size problem.
It eliminates the need for an Address Translation Mechanism (ATM).
It completely eliminates external fragmentation.
A key disadvantage of Command Line Interfaces (CLI) compared to Graphical User Interfaces (GUI) is the requirement for the user to:
Have administrative privileges to execute commands.
Utilize a mouse and pointer for navigation.
Memorize and accurately type in command names and syntax.
Perform only simple batch processing operations.
The operating system in an embedded system that must guarantee a response within a fixed, very tight time constraint, such as in industrial control or medical devices, is an example of a:
Timesharing OS
Hard Real-Time OS
Distributed OS
Soft Real-Time OS
Which software component in a Demand Paging system decides which page should be swapped out of physical memory when a new page fault occurs?
Swapper
Process Control Block (PCB)
Page Fault Handler
Paging Daemon
A system implements a 1-level paging structure. The Page Table Entry (PTE) size is 4 Bytes. If a process has a 256MB logical address space and the page size is 4KB, what is the total memory space required for the Page Table itself?
1 MB
256 KB
1024 KB
4 KB
Which memory allocation scheme is most vulnerable to External Fragmentation ?
Variable-Partitioning Scheme
Virtual Memory
Fixed-Partitioning Scheme
Paging
In a demand paging system, what is the term for the event that occurs when a process attempts to access a page that is not currently in main memory?
Thrashing
Page Fault
Page Hit
Segmentation Fault
Which field in the Page Table Entry (PTE) is used by the operating system to indicate whether a page is currently located in physical memory or on secondary storage?
Valid/Invalid Bit (Presence Bit)
Reference Bit
Dirty Bit
Frame Number
If the Memory Access Time is 200 ns and the Page Fault Service Time is 8 ms (including swapping), what is the Effective Access Time for a Page Fault Rate of p = 0.001 ?
8200 ns
8.2 ms
8200 ns
200 ns
What is the primary consequence of a Page Fault Rate being too high in a demand paging system?
Optimal Performance
Thrashing
Reduced I/O Activity
Increased CPU Utilization
Which strategy for handling a page fault requires the system to check the 'Dirty Bit' of the victim page before writing it back to the disk?
Page Replacement
Page Allocation
Page Segmentation
Address Translation
Consider the page reference string: 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1. If the system has 3 free frames, how many Page Faults occur using the First-In, First-Out (FIFO) page replacement algorithm?
11
9
14
16
Using the same reference string and 3 frames, what is the number of Page Faults using the Least Recently Used (LRU) page replacement algorithm?
17
11
9
14
Using the same reference string and 3 frames, what is the number of Page Faults using the Optimal (OPT) / MIN page replacement algorithm?
15
11
14
9
The Least Frequently Used (LFU) page replacement algorithm suffers from the potential problem of:
The inability to be implemented in a practical system.
Poor performance when page usage frequency changes rapidly over time.
Belady's Anomaly (Page faults increase with more frames)
Excessive hardware overhead due to the use of a stack for page access times.
Excessive hardware overhead due to the use of a stack for page access times.
Optimal (OPT) / MIN
Second Chance (Clock)
FIFO
LRU
A key characteristic of all Disk Scheduling Algorithms is that they aim to minimize the total amount of:
Request Queue Length
Seek Time
Transfer Time
Rotational Latency
Which disk scheduling algorithm is most likely to cause starvation for requests near the inner or outer edge of the disk, if a steady stream of new requests continually arrives near the current head position?
C-LOOK
SCAN
FCFS
SSTF
Consider the request queue 98, 183, 37, 122, 14, 124, 65, 67. If the current head position is 53, and cylinders range from 0 to 199, what is the total $\text{Head Movement}$ (in cylinders) using the First-Come, First-Served (FCFS) algorithm?
236 cylinders
640 cylinders
331 cylinders
130 cylinders
Consider the request queue 98, 183, 37, 122, 14, 124, 65, 67. If the current head position is 53.
Using the same request queue and current head position from the above, what is the total Head Movement (in cylinders) using the Shortest Seek Time First (SSTF) algorithm?
146 cylinders
382 cylinders
236 cylinders
640 cylinders
Which disk scheduling algorithm ensures fairness and prevents starvation by sweeping the disk head in one direction, serving all requests encountered, and then reversing direction?
FCFS
SCAN
SSTF
C-SCAN
Using the request queue 98, 183, 37, 122, 14, 124, 65, 67, a current head position of 53, and cylinders 0 to 199. What is the total Head Movement (in cylinders) using the SCAN algorithm, assuming the head is initially moving towards 199 (the largest cylinder)?
248 cylinders
382 cylinders
331 cylinders
236 cylinders
The C-SCAN (Circular SCAN) algorithm improves upon SCAN primarily by:
Only servicing requests while sweeping in one direction (e.g., from 0 to 199).
Allowing the head to stop and reverse immediately at the request closest to the current position.
Prioritizing the shortest seek time regardless of direction.
Service requests strictly in the order of arrival.
Consider the request queue 98, 183, 37, 122, 14, 124, 65, 67. If the current head position is 53.
Using the same request queue and current head position from the above, what is the total Head Movement (in cylinders) using the C-SCAN algorithm, assuming the head is initially moving towards 199 and cylinders 0 to 199?
248 cylinders
255 cylinders
331 cylinders
382 cylinders
What is the primary difference between the LOOK and SCAN disk scheduling algorithms?
LOOK only services requests in the direction of the largest request, while SCAN alternates.
SCAN prioritizes the closest request, while LOOK uses the FIFO queue.
SCAN can cause starvation, whereas LOOK is starvation-free.
LOOK only sweeps as far as the furthest request in the current direction, while SCAN always sweeps to the absolute end of the disk
Consider the request queue 98, 183, 37, 122, 14, 124, 65, 67. If the current head position is 53.
Using the request queue and current head position from the above, what is the total Head Movement (in cylinders) using the LOOK algorithm, assuming the head is initially moving towards 199 (the largest cylinder)?
331 cylinders
299 cylinders
382 cylinders
248 cylinders
What is the primary difference between the C-LOOK and C-SCAN disk scheduling algorithms?
C-LOOK stops at the furthest request before jumping back, while C-SCAN always goes to the absolute end (199) before jumping to the beginning (0).
C-LOOK uses the concept of an 'Aging' scheme, while C-SCAN does not.
C-LOOK services requests in both directions, C-SCAN only one.
C-SCAN is prone to starvation, while C-LOOK is not.
Consider the request queue 98, 183, 37, 122, 14, 124, 65, 67. If the current head position is 53.
Using the request queue and current head position from Q13, what is the total Head Movement (in cylinders) using the C-LOOK algorithm, assuming the head is initially moving towards 199 (the largest cylinder)?
273 cylinders
299 cylinders
382 cylinders
322 cylinders
In a demand paging system, what is the role of the Paging Daemon process?
To periodically inspect pages and write 'dirty' pages back to disk to maintain a pool of clean, free frames.
To manage the scheduling of processes in the Ready queue.
To handle the actual I/O operation of swapping pages to and from the disk after a page fault.
To perform address translation from logical to physical addresses
Which page replacement algorithm is impractical to implement because it requires foreknowledge of future page references?
Second Chance
LRU
FIFO
Optimal (OPT)
What is the primary function of the Dirty Bit (or Modified Bit) in a Page Table Entry?
To indicate if the page is currently in physical memory.
To identify the physical memory frame number.
To indicate if the page has been referenced recently.
To signal the Page Replacement Algorithm that the page must be written back to disk before replacement.
Which of the following is considered a major drawback of the FIFO page replacement algorithm?
High implementation complexity and overhead.
It can remove a frequently used page simply because it was loaded a long time ago.
It is susceptible to external fragmentation.
It requires special hardware support to track page usage time.
In the LOOK disk scheduling algorithm, the worst-case seek time for a request occurs for a request that is:
Already being served by another disk controller.
At the cylinder immediately next to the current head position.
Just behind the current head position, at the very beginning of the disk, when the head is already sweeping towards the end.
At the furthest cylinder (199) from the current head position.
If a memory system uses 1 - level paging, a 64-bit logical address, and a Page Size of 16 KB, how many bits are used for the Page Offset?
14 bits
12 bits
50 bits
64 bits
In the Second Chance (Clock) page replacement algorithm, what is the action taken when a victim page is found to have its Reference Bit set to '1'?
The page is written to disk because it is a 'dirty' page.
The entire process is swapped out of main memory.
The Reference Bit is reset to '0', and the page is given a second chance (the pointer advances to the next page).
The page is immediately replaced with the new incoming page.
Which of the following disk scheduling algorithms typically results in the highest average response time and highest total head movement?
SSTF (Shortest Seek Time First)
FCFS (First-Come, First-Served)
C-LOOK (Circular LOOK)
SCAN (Elevator Algorithm)
