WorksheetsOperating Systems Model MCQ
Total questions: 100
Worksheet time: 50mins
In batch systems, turnaround time is:
Higher than interactive systems
Lower than real-time systems
Similar to multiprogramming
Not measurable
Which OS type offers immediate feedback to the user?
Batch
Time-sharing
Real-time
Interactive
A batch system executes 20 jobs in 100 minutes. What is the average turnaround time?
4 min
5 min
10 min
20 min
Spooling overlaps:
I/O and computation
CPU and memory
Cache and RAM
Processes and threads
What is the key benefit of multiprogramming?
Maximizing I/O usage
Reducing memory
Increasing CPU utilization
Avoiding deadlocks
In a batch system, if each job takes 2 minutes of CPU and 8 minutes of I/O, what is the CPU utilization for a single job?
0.2
0.25
0.8
0.4
A mainframe handles 1000 transactions/sec and supports 50 users. What is the average transactions per user per sec?
20
25
15
30
A system with 10 servers processes 1000 requests/sec total. If load is equally balanced, how many requests per server?
100
1000
10
50
A distributed system uses vector clocks with 8 processes. What is minimum size of vector clock?
8
1
4
16
If network bandwidth is 1 Gbps and file size to transfer is 100 MB, how long will transfer take ignoring overhead?
0.8 seconds
0.1 seconds
1.2 seconds
0.4 seconds
A distributed database replication lag is 200 ms. If writes per second are 500, what is max stale data duration?
0.4 seconds
0.2 seconds
1 second
2 seconds
For a quorum system with N=15 nodes, write quorum size is 10, read quorum size is 6. Is the system consistent?
Yes
No
Depends
Cannot tell
A distributed consensus protocol requires 2/3 of nodes to agree. For 30 nodes, what is minimum number of nodes required?
20
10
15
25
A cluster has 5 nodes, each with 8 cores running at 2.5 GHz. What is total processing capacity in GHz?
100 GHz
40 GHz
10 GHz
50 GHz
In a multi-layered OS, communication between layers is performed through:
Registers
Stack
Interface protocols
Shared memory
A system has 3 tasks with utilization 0.3, 0.25, and 0.2. Is it schedulable under RMS?
No
Yes, total utilization < 1
Yes, utilization < ln(2)
Yes, utilization < bound for 3 tasks
Which of the following is true about the microkernel design?
Kernel provides all services including device drivers
Services run in user space
File system is part of the kernel
All services run in kernel mode
Why is preemption important in real-time OS?
It saves battery
It ensures memory isolation
It allows meeting deadlines by suspending lower priority tasks
It enables system boot
Which of the following is NOT typically considered part of the kernel in OS design?
Scheduler
Memory manager
File manager
Web browser
Which memory management technique can lead to external fragmentation?
Paging
Segmentation
Fixed partitioning
Stack allocation
Which hand-held OS is based on a Linux kernel?
iOS
Windows CE
Android
Palm OS
A 1 GHz CPU executes 10n cycles. At 500 MHz, how long does it take?
1 ms
2 ms
3 ms
4 ms
Process requests 1 MB, only 512 KB available. What happens?
Success
Failure
Terminated
Swaps to disk
RMS: 3 tasks, utilization 0.75. RMS bound for n=3 is 0.78. Is task set schedulable?
Yes
No
Only with EDF
Only with priority inheritance
5 tasks each take 10 ms. Context switch time is 1 ms. Total overhead for one cycle?
1 ms
5 ms
10 ms
15 ms
Which component handles page faults?
Process Manager
Memory Manager
File System
Device Driver
EDF: Task set has total utilization 0.90. One task has period 100 ms and exec. 25 ms. Is it schedulable?
Yes
No
Only with RMS
Only with priority ceiling
Sensor generates data every 20 ms. Processing time/sample is 5 ms. Max samples/sec processed?
50
100
200
500
Choose the reason why secondary memory is used in computer systems.
Cost efficiency
Cache storage
Faster processing
Manages page faults
Infer the function of the program counter during instruction execution.
Stores current output
Counts CPU cycles
Points to next instruction
Controls DMA transfer
Identify a hardware feature that improves I/O efficiency.
Pipelining
Virtual memory
Interrupt-driven I/O
Disk fragmentation
Analyze the relationship between memory hierarchy and system performance.
Slower speed increases performance
Hierarchy adds redundancy
Balanced hierarchy reduces latency
Eliminates swapping
Choose the mode in which the CPU accesses system-level resources.
Kernel mode
User mode
Interrupt mode
Safe mode
Formulate a case where memory-mapped I/O is preferred.
Real-time systems
Simple output systems
Batch processing
Unbuffered input
Select the hardware interface allowing direct memory access without CPU load.
Cache controller
DMA controller
TLB
SSD
Differentiate between primary and secondary memory characteristics.
Primary is slower
Secondary is volatile
Primary is fast and volatile
Secondary is RAM-based
A developer needs to enable communication between processes on different machines over a network. Which IPC method should they choose?
Shared Memory
Named Pipes
Signals
Sockets
In a bounded buffer system, a producer increments the full semaphore before adding an item to the buffer. What problem can this lead to?
Increased buffer size
Deadlock
The consumer might read incomplete data
Starvation of the producer
A student implements a solution to the dining philosophers problem using semaphores. Occasionally, all philosophers pick up their left fork and wait for the right one, leading to no progress. What problem is this?
Starvation
Race condition
Deadlock
Mutual exclusion failure
In an operating system simulation, a binary semaphore is used to protect a shared variable. Two processes call wait() simultaneously, and one enters the critical section. What happens to the other?
It enters immediately
It overwrites the variable
It blocks until signal() is called
It crashes
A traffic intersection uses semaphores to allow only one car from each direction to pass at a time. What property of semaphores is being utilized here?
Starvation control
Deadlock detection
Mutual exclusion
Priority inversion
In a system with multiple consumers and a single producer, the producer forgets to signal() after producing. What is the result?
Consumers process stale data
Consumers remain blocked indefinitely
Producer gets blocked
Data is processed twice
In a student project, semaphores are used without mutexes in a producer-consumer system. Items are added and removed correctly, but occasionally the buffer gets corrupted. Why?
Semaphores automatically manage memory
Semaphore count was incorrect
No mutual exclusion during actual buffer access
Too many consumers are running
In the Producer-Consumer problem, if the producer adds data to the buffer without checking whether the buffer is full, what issue might occur?
Data gets duplicated
The buffer may overflow and corrupt memory
Consumer will read faster
Producer gets blocked
In a system using Banker's Algorithm, a process requests resources that make the system move from a safe state to an unsafe state. Which of the following best describes the action taken by the algorithm?
The request is granted immediately
The request is denied until safe state is guaranteed
The process is terminated
The system enters deadlock
Which of the following strategies involves ordering resource types numerically and requiring processes to request resources in increasing order to prevent deadlock?
Deadlock detection
Deadlock avoidance
Deadlock prevention by resource ordering
Deadlock recovery
A system runs multiple processes that share a printer and a scanner, both available in only one instance each. The OS uses a deadlock prevention approach that disallows hold and wait by requiring processes to request all required resources at once. What is a possible drawback of this approach?
It increases the likelihood of deadlock
It may lead to low resource utilization and process starvation
It makes deadlock detection easier
It requires complex resource ordering
Consider a resource allocation graph with a cycle. Which of the following statements is true?
If there is a cycle, deadlock must exist
If there is a cycle, deadlock may or may not exist depending on resource instances
Cycle indicates safe state
Cycle is unrelated to deadlock
In deadlock detection algorithms, which of the following data structures is typically used to represent resource allocation and requests?
Wait-for graph
Binary search tree
Stack
Queue
Which one of the following is NOT a method of handling deadlocks?
Deadlock avoidance
Deadlock detection and recovery
Deadlock prevention
Resource preemption without process rollback
Which deadlock prevention technique involves forcibly taking resources away from a process until it can proceed?
No preemption
Mutual exclusion
Circular wait
Hold and wait
You observe that processes in a live system are waiting on each other in a circular chain. What is the best handling method?
Deadlock detection
Starvation resolution
Avoidance
Segmentation
You are given total and allocated resource vectors. How would you determine if any process can execute?
Compare Need with Available
Allocate all
Increase total
Swap resources
What is the key idea of deadlock avoidance?
Pre-granting all resources
Ensuring a safe state
Disabling circular wait
Using round robin
A system with 3 processes has Available = [3, 2]. Is the system in a safe state?
Yes
No
May be
Need more info
Which condition must be known for Banker's Algorithm to work effectively?
Max resource demand
Current CPU burst
Priority
Arrival time
A complex resource allocation has shared printers and disks. What detection scheme minimizes performance loss?
Run detection periodically
Prevent new allocations
Lock all resources
Remove circular wait
You are given a Wait-For Graph. Determine if a cycle exists using DFS.
Yes
No
Can't say
Depends on process count
What happens in the recovery method of resource preemption?
Resources forcibly taken from processes
All processes restarted
System rebooted
Deadlock ignored
Which is a disadvantage of process termination recovery?
Data loss
Increased throughput
Less overhead
Fairness
In Banker's Algorithm, what is the condition for system to be safe?
Safe sequence exists
Available resources are zero
All processes finished
No waiting processes
Given Available = [2,3,1], Allocation = [[1,0,0],[0,2,1]], Max = [[3,2,2],[1,3,3]], what is Need?
[[2,2,2],[1,1,2]]
[[2,1,2],[1,1,2]]
[[3,2,2],[1,3,3]]
[[1,1,1],[1,1,1]]
If deadlock is detected, the OS should:
Abort one or more processes
Grant all requests
Increase resources
Ignore deadlock
Given Allocation=[[1,1,1],[0,0,2]], Max=[[3,2,2],[1,1,3]], Available=[2,2,0], system state is:
Safe
Unsafe
Deadlock
Unsafe but recoverable
What is the role of a checkpoint in deadlock recovery?
Save process state
Abort processes
Allocate resources
Detect deadlock
What is the first step in Banker's Algorithm?
Calculate Need matrix
Allocate resources
Release resources
Check for deadlock
Number of swaps if 8 processes use 1 swap-in and 1 swap-out
8
16
12
10
Interpret swap performance if swap time = 30 ms, I/O latency = 10 ms
40 ms
20 ms
30 ms
50 ms
A TTL of 3600 seconds implies caching for how long?
30 Mins
1 Hour
1.5 Hours
45 Mins
Plan allocation of 5 processes: 100 KB, 200 KB, 150 KB, 250 KB, 300 KB in 1.5 MB
All fit
One left
Two left
All don't fit
Devise a method to reduce swap-in time in modern systems
SSDs
HDDs
Optical disks
Tape drives
Evaluate swapping as a solution to memory overcommitment
Effective
Inefficient
Obsolete
Slower
Which strategy will cause the least external fragmentation?
First Fit
Best Fit
Paging
Worst Fit
Estimate number of 128 KB processes that fit in 2 MB RAM
16
12
10
18
Size of external fragmentation if free memory is 1000 KB and largest block 700 KB
300 KB
1000 KB
700 KB
0 KB
Time complexity to search free block in Best Fit (unsorted list)
O(1)
O(n)
O(log n)
O(n^2)
Address binding technique with max flexibility in relocation
Compile-time
Load-time
Execution-time
Static-time
Physical address for segment starting at 4000 with offset 100
4100
4000
6000
4600
Operation not happening during dynamic linking
Runtime loading
Resolving function addresses
Compile-time linking
Memory sharing
Memory allocation splitting 2048 KB into four 512 KB blocks
First Fit
Best Fit
Buddy System
Paging
Component responsible for address translation
Linker
Loader
MMU
Scheduler
A paged memory system has a page size of 4KB. If a program requires 18.5KB of memory, how much internal fragmentation occurs, and why does it happen? Consider how the memory is divided into pages and how the leftover space is managed.
1.5KB of internal fragmentation
2.0KB of external fragmentation
3.5KB of internal fragmentation
No fragmentation occurs
In segmentation, consider a system where each segment has a maximum size of 4MB, and a process attempts to access an address beyond this limit in segment 2. What will the system do in response, and what type of error or exception is typically raised?
Triggers a page fault
Wraps the address around in the segment
Raises a segmentation fault
Allows access to overflow address
A system uses segmentation with paging where each segment has 4 pages, and each page is 2KB in size. What is the maximum size of each segment, and how does this architecture impact logical address division?
4KB per segment, simple address translation
6KB per segment, complex structure
8KB per segment, efficient logical mapping
16KB per segment, improved memory flexibility
Consider the scenario of using a single-level page table in a 32-bit system with 4KB pages. If the virtual address space is large, what is a major limitation of this scheme and how do multi-level page tables address this limitation?
It increases internal fragmentation
It reduces TLB hit ratio
It consumes a lot of memory and multi-level paging reduces this
It increases external fragmentation
Assume a system uses segmentation, and a program has five segments: text, data, BSS, heap, and stack. How does segmentation improve memory access control in this case, and which segment characteristics allow protection enforcement?
Only BSS is protected
Text is read-only; others vary in access
Stack has no boundaries; heap is read-only
Heap is executable; text is writable
In paging, each process has its own page table. What are the implications of this for context switching, and how does it affect memory access efficiency when switching between processes?
Context switching becomes slower due to large tables
It simplifies memory access across processes
It reduces the size of physical memory needed
All processes share a single page table
In a paged system with a TLB, how does the use of the TLB improve address translation performance, and what happens when a TLB miss occurs? Provide an example if necessary.
TLB miss leads to segmentation fault
Address translation becomes unnecessary
TLB improves speed; on miss, page table is accessed
Address wraps around memory
You are debugging a system that uses a two-level paging mechanism. You notice that address translation takes longer than expected. What is the primary reason for this overhead in a two-level paging system?
Less memory usage
Extra lookups in page tables
More TLB hits
Improved caching
A developer optimizes their application by enhancing spatial and temporal locality. As a result, performance improves significantly. What is the relationship between locality and virtual memory efficiency?
Locality has no effect
Better locality increases page faults
Better locality reduces page faults
Locality reduces TLB hits
In a segmented-paging system, each segment has its own page table. If a segment has many pages, what overhead does this create in terms of address translation, and how can it be managed efficiently?
Fewer TLB hits
Increased fragmentation
Increased memory accesses
Reduced context switches
During runtime, an OS needs to decide which page to remove when memory is full. One technique is LRU, which uses history of access. How does LRU compare with FIFO in terms of performance and overhead?
FIFO is more accurate
LRU always faults more
LRU is more effective but complex
FIFO is based on future use
A user configures their system to use a very small page size in virtual memory settings. They notice that more pages are being loaded than before. What could be the trade-offs involved in using smaller pages?
More TLB hits
Lower fragmentation and more overhead
Better CPU utilization
Fewer page faults
In a virtual memory setup, the system allows shared memory pages between processes. How does this feature enhance system efficiency and what precautions must be taken to ensure consistency?
It increases isolation
Pages are never duplicated
Shared pages save memory but need synchronization
Every process has its own copy
A virtual address is passed to the OS during execution. The system uses paging with a TLB. If the required entry is not found in the TLB, the system checks the page table. What is this process known as, and what's the performance implication?
Cache hit
TLB miss and page walk
Segment fault
Stack overflow
What is the main difference between QEMU and KVM?
QEMU uses host virtualization, KVM uses software
QEMU is a container tool
QEMU is a hypervisor, KVM enables hardware acceleration
KVM runs on Windows only
A user creates a Docker container that includes an application and its libraries. When shared, the container runs identically on other systems. What cloud computing characteristic does this demonstrate?
Resource pooling
Measured service
Portability and consistency
Broad network access
In Xen architecture, what is Dom0?
A guest OS
An emulator
A privileged control domain
A disk partition
Which component manages guest VMs in Xen?
XenStore
DomU
Dom0
XenCloud
Which file is typically modified to configure a Xen VM?
/etc/xen.cfg
/etc/xen/.cfg
/var/xen.conf
/boot/xenfile.conf
