WorksheetsOperating Systems Quiz
Total questions: 100
Worksheet time: 53mins
If a diskless system downloads the OS at 5 MB/s and the OS image is 250 MB, how long will it take?
30 sec
45 sec
50 sec
60 sec
Time to load OS = 90 seconds. If OS is compressed to 60% and decompression takes 15 seconds, what's the new boot time?
54 sec
69 sec
60 sec
72 sec
An OS supports 3 types of users: admin (10%), power users (30%), and regular users (60%). If 500 users are logged in, how many are regular users?
300
250
200
100
Which of the following best describes multiprogramming?
Executing multiple parts of one program
Executing programs with multiple users
Keeping multiple programs in memory simultaneously
Executing programs without I/O support
In a multiprogramming system with 4 programs in memory, if each waits for I/O 20% of the time, what is the CPU utilization?
0.2
0.41
0.8
0.99
Which of the following is an example of spooling?
Using RAM to print documents
Storing print jobs in a queue
Executing CPU-bound processes
Managing swap memory
Spooling is primarily used to:
Improve CPU throughput
Manage printer I/O
Optimize cache hits
Avoid segmentation faults
The latency to synchronize between processors is 100 ns. For a program requiring 1000 synchronizations, what is total overhead?
100 μs
10 μs
1 ms
0.1 ms
In a multiprocessor system, communication overhead reduces performance by 15%. If ideal speedup is 20, what is actual speedup?
17
15
18
12
A parallel job on 32 processors takes 4 seconds, while on 1 processor it takes 120 seconds. What is efficiency?
0.9375
0.85
0.75
0.8
In a distributed system, if message latency is 10 ms and average processing time per node is 5 ms, what is total response time for 4 nodes sequentially communicating?
60 ms
50 ms
40 ms
45 ms
A distributed system has 5 nodes with 99.9% availability each. What is overall system availability assuming all nodes must be up?
0.995
0.9999
0.995
0.9999
For a distributed transaction, prepare phase takes 100 ms, commit phase takes 150 ms, and network delay per message is 10 ms. Total 6 messages exchanged. What is total transaction time?
310 ms
360 ms
370 ms
300 ms
A distributed hash table (DHT) has 256 nodes. What is max number of hops to locate an item?
8
16
256
4
Which scheduling algorithm is ideal for hard real-time systems?
First Come First Serve
Round Robin
Rate Monotonic Scheduling
Shortest Job Next
A hand-held system uses a display with a refresh rate of 60 Hz. If each refresh requires 5 ms of CPU time, what percentage of CPU time is consumed by the display?
0.3
0.2
0.15
0.1
Why is memory management important in operating systems?
To store large files
To track processor usage
To allocate memory space efficiently to processes
To connect with the printer
Which of the following statements is TRUE regarding Rate Monotonic Scheduling (RMS)?
RMS assigns higher priority to tasks with longer periods.
RMS ensures 100% CPU utilization.
RMS is optimal for preemptive, fixed-priority scheduling.
RMS does not work for periodic tasks.
A real-time system requires 4 periodic tasks. The utilization is 0.60. Will the tasks be schedulable under RMS?
No, because utilization exceeds 0.55
Yes, because 0.60 < 0.7568
No, RMS only supports 3 tasks
Yes, all tasks are schedulable regardless of utilization
Which of the following OS structures allows maximum modularity and security but has performance overhead due to communication?
Monolithic kernel
Microkernel
Layered OS
Virtual Machine OS
In an embedded real-time system, what kind of memory allocation is preferred?
Dynamic memory allocation
Stack-based memory
Garbage-collected memory
Static memory allocation
Interrupt occurs every 10 ms; handler takes 2 ms. What is max interrupt frequency without overlap?
100 Hz
500 Hz
333 Hz
1000 Hz
A real-time task's WCET is 15 ms, period is 60 ms. What is CPU utilization?
0.15
0.25
0.33
0.5
A display refreshes at 60 Hz, each refresh needs 5 ms CPU time. CPU time % used by display?
0.3
0.2
0.15
0.1
Which OS service ensures a process can securely access a file?
Process Mgmt
File Mgmt
Memory Mgmt
Device Mgmt
In RMS, T1: 40 ms period, 10 ms exec; T2: 60 ms, 15 ms exec. Is the set schedulable (RMS bound for n=2 is 0.828)?
Yes
No
Only if T1 priority
Only if T2 priority
A handheld memory manager allocates 512 KB. App needs 600 KB. What happens?
Runs normally
Allocation fails
Switches to VM
Uses secondary storage
Which OS component interacts with hardware to manage I/O?
Process Scheduler
Device Driver
Memory Allocator
File System
Illustrate how interrupts improve CPU efficiency in device communication.
Polls devices regularly
Stops programs frequently
Triggers OS routines
Resets device state
Clarify the use of status registers in CPU processing.
Stores ALU results
Tracks interrupt queue
Indicates CPU mode and flags
Controls memory mapping
Point out the reason for using multi-core CPUs in OS architecture.
Reduces RAM usage
Parallel task execution
Enables BIOS access
Improves user interface
Predict the impact of disabling interrupts on OS responsiveness.
Faster context switching
Device buffering improves
OS cannot respond to hardware
No change
Identify the benefit of using I/O channels in system architecture.
Lowers CPU cycle count
Enhances memory paging
Controls scheduling policy
Uses user-mode interrupts
Demonstrate how microprogrammed control units simplify CPU design.
Uses variable latency
Implements OS processes
Encodes control signals
Replaces all hardware
Examine why context switching requires CPU state preservation.
To recompile programs
To reload disk sectors
To resume execution correctly
To clean buffer cache
Choose the suitable memory type for BIOS storage.
DRAM
SRAM
ROM
Cache
In a multilevel feedback queue scheduling system, what is the main purpose of allowing processes to move between queues?
To reduce memory fragmentation
To avoid CPU overload
To dynamically adjust process priorities for fairness
To eliminate context switching
If a First-Come, First-Served (FCFS) scheduler is used and the first process in the queue has a very long burst time, what is the expected result?
High CPU utilization
Reduced response time
Convoy effect
Reduced turnaround time
In a Round Robin scheduling algorithm with a time quantum of 4 ms, how many time slices will a process with a CPU burst
In a Round Robin scheduling algorithm with a time quantum of 4 ms, how many time slices will a process with a CPU burst time of 10 ms require to complete?
2
3
4
5
A process arrives at time 0 with a burst time of 20 ms. It is scheduled using a time quantum of 5 ms in a Round Robin scheduler. What is the total CPU time consumed before the process finishes (including all time slices)?
15 ms
20 ms
25 ms
30 ms
Three processes arrive at time 0: P1 (burst = 5 ms), P2 (burst = 10 ms), P3 (burst = 3 ms). Using Shortest Job First (non-preemptive), in what order will the processes execute?
P1, P2, P3
P3, P1, P2
P2, P3, P1
P3, P2, P1
A CPU scheduling algorithm uses priority values where a lower number indicates higher priority. Given P1 (priority 3), P2 (priority 1), and P3 (priority 2), in what order will they be scheduled (non-preemptive)?
P1, P2, P3
P2, P3, P1
P3, P2, P1
P1, P3, P2
Which scheduling algorithm is most likely to produce the lowest turnaround time when process burst times vary significantly and are known in advance?
Round Robin
Priority Scheduling
Shortest Job First
First-Come, First-Served
You are testing an application with 5 threads sharing a database connection. You notice high CPU usage and response delay even when only one thread is active. What's a likely cause?
Context switching
Thread pooling
Busy waiting in critical section control
Lack of database indexing
A banking system allows users to transfer funds. Occasionally, both sender and receiver accounts get the same updated balance after a transfer. What could fix this?
Add more threads for transactions
Use a distributed system
Protect transfer logic with mutual exclusion
Use floating-point variables instead of integers
A developer is implementing mutual exclusion on a multi-core processor without using OS-level locks. They use a hardware-supported TestAndSet instruction. Occasionally, one thread monopolizes access. What issue might be occurring?
Deadlock
Starvation
Page fault
Race condition
Two threads running on different cores attempt to acquire a lock simultaneously using the CompareAndSwap instruction. Only one succeeds. What ensures mutual exclusion in this case?
Non-deterministic scheduling
Atomicity of CompareAndSwap
Thread affinity
Priority scheduling
A system uses a spinlock implemented with the TestAndSet instruction. With high contention, CPU usage spikes even when no progress is made. What is the main drawback of this implementation?
Deadlock
Starvation
Busy waiting
Slow memory access
You are debugging a concurrent system where threads access shared memory using Swap instructions. Occasionally, values in shared memory are corrupted. What's the most probable issue?
The swap instruction is not atomic
Threads are too slow
Paging is not enabled
The cache size is too small
In a multi-core environment, a shared flag is used to implement locking without hardware support. Two threads still enter the critical section simultaneously. What is lacking?
Thread synchronization
Atomic operations
Inter-process communication
Thread priorities
If system is in an unsafe state, is it deadlocked?
No
Yes
Always
Cannot say
4 processes, 2 instances of a resource. All request 1 instance. Deadlock?
No
Yes
Maybe
Always
Total R = 12, allocated = 8. Max = [7,5,3], Allocation = [2,2,2]. Available?
4
3
2
1
A multi-threaded system shows a cycle in its resource allocation graph, causing processes to wait indefinitely. What should the OS do next?
Abort one process involved in the cycle
Ignore and continue
Restart the system
Increase CPU allocation
The Banker's Algorithm detects a resource request that leads the system to an unsafe state. What should it do?
Grant the request immediately
Make the process wait
Kill the requesting process
Allocate partial resources
A system eliminates hold and wait by forcing processes to request all resources at once. What is a disadvantage of this approach?
Increased deadlock risk
Lower resource utilization
Easier scheduling
No effect on deadlock
Deadlock detection involves
Searching for cycles in the resource allocation graph
Applying Banker's Algorithm
Preempting resources forcibly
Running processes sequentially
A resource is allocated to multiple processes dynamically. What strategy will ensure deadlock is avoided?
Check safe state before grant
Grant all requests
Use round robin
Lock preemption
What is the drawback of using Banker's Algorithm?
Requires prior knowledge
Causes starvation
Increases memory
Cannot detect deadlock
Calculate whether a system is in deadlock using a resource allocation table with 4 processes.
Deadlock exists
No deadlock
Safe state
Starvation only
A system grants requests as long as it leads to a safe state. What method is being followed?
Deadlock avoidance
Detection
Prevention
Starvation control
Given a system with 3 processes and 3 resources, calculate the Need matrix using Banker's algorithm.
Max - Allocation
Max + Allocation
Allocation - Max
Max × Allocation
Which of the following algorithms detects deadlock?
Wait-For Graph
FIFO
SJF
Time sharing
The resource allocation graph shows a cycle. What does this imply?
Deadlock may exist
System is safe
All processes terminated
Starvation
Deadlock recovery can be done by:
Preempting resources and rolling back processes
Increasing resource allocation
Ignoring deadlock
Restarting OS only
If Available resources are [3,3,2], and Process P1 requests [2,2,1], can this request be granted safely?
Yes, safe
No, unsafe
Only partial resources
Request ignored
A process in deadlock recovery is terminated. Which of the following happens?
Resources are released
System crashes
Deadlock remains
New deadlock created
Given Allocation=[[2,1,0],[3,0,2],[2,1,1]], Max=[[3,3,2],[4,2,3],[3,2,2]], Available=[1,2,1], calculate Need matrix.
[[1,2,2],[1,2,1],[1,1,1]]
[[1,2,2],[2,2,1],[1,1,1]]
[[1,1,2],[1,2,2],[1,1,2]]
[[1,2,1],[1,1,1],[1,2,1]]
For Allocation=[[1,0,1],[0,1,0],[2,1,1]], Max=[[3,2,2],[1,3,3],[3,1,2]], Available=[2,1,1], is system in safe state?
Yes, safe
No, deadlock
Unsafe but no deadlock
Cannot determine
Process P3 needs [2,1,0] but only [1,1,0] are available. What happens?
Request denied
Partial grant
Deadlock
Request accepted
What happens?
Request denied
Partial grant
Deadlock
Request accepted
Total resources = [9,3,6], Allocation=[[3,0,2],[1,2,1],[1,1,1]], find Available.
[4,0,2]
[4,1,2]
[3,1,2]
[4,0,3]
If a process's Max claim is [4,3,2] and Allocation is [1,2,0], what is its Need?
[3,1,2]
[3,2,2]
[4,1,2]
[3,1,1]
Calculate total memory wasted by internal fragmentation for 4 partitions of 512 KB
120 KB
64 KB
128 KB
96 KB
Analyze the difference in allocation success rate between First Fit and Worst Fit (200 KB process)
Same
First Fit better
Worst Fit better
None
Compare swap time of 3 processes at 40 ms each with and without parallel swapping
120 ms vs 40 ms
60 ms vs 120 ms
Same
30 ms vs 90 ms
Design an efficient memory allocation sequence for processes: 180 KB, 300 KB, 400 KB using Best Fit
180, 300, 400
400, 300, 180
300, 400, 180
180, 400, 300
Recommend an allocation strategy for minimizing fragmentation
First Fit
Worst Fit
Best Fit
Paging
Estimate total fragmentation when process sizes: 480 KB, 500 KB, 490 KB use 512 KB partitions
48 KB
64 KB
54 KB
60 KB
Propose a method to optimize memory utilization in contiguous allocation
Compaction
Paging
Segmentation
None
Number of 512-byte blocks allocated by malloc call of 4096 bytes
4
8
6
12
Operation not performed by a linker
Symbol resolution
Code relocation
Memory deallocation
Address binding
Description of relocation in linking
Moving processes between memory
Changing relative to absolute addresses
Mapping virtual to physical memory
Resolving system calls
Number of physical memory copies of shared library used by 5 processes
1
2
5
Depends on OS
Allocation strategy resulting in largest leftover hole
First Fit
Best Fit
Worst Fit
Next Fit
Allocation method failing if 700 KB requested but only 600 KB contiguous
Segmentation
Paging
Demand Paging
Contiguous Allocation
Main advantage of dynamic linking over static linking
Faster execution
Smaller executable size
Reduced compile time
Increased memory use
A system with segmentation and paging uses a segment table and a page table for memory management. If a process accesses a logical address, how many memory accesses are required to translate it assuming no TLB is used?
One
Two
Three
Four
Consider a process with three segments: code, stack, and data. Each segment is divided into pages in a segmented-paging system. Which table structures are required for correct address translation?
Only one global page table
A single segment table for all processes
A segment table with individual page tables for each segment
No tables required
A 32-bit system using segmentation with paging has 4 segments per process and each segment has its own page table. If each page size is 4KB and each segment supports up to 1MB, what is the maximum number of pages per segment?
128
256
512
1024
In paging, all frames in physical memory are of the same size, which matches the page size of processes. Suppose a process requires 10 pages, but physical memory has only 6 free frames. What is the result if demand paging is enabled?
Process runs immediately using all frames
OS swaps all pages before execution
Process partially loads into memory and executes with page faults
Execution is denied
When paging is used, address translation becomes crucial. Suppose a virtual address needs to be translated into a physical address. What components are needed and what is the process involved in this translation?
Base register and segment offset
Page number and offset using page table
Frame number and segment number using TLB
Logical block number and physical block
Segmentation can simplify memory protection. Suppose a segment is marked as read-only in a program. What happens if a write operation is attempted on this segment, and why?
Operation proceeds with a warning
Operation is ignored silently
Segmentation fault occurs
System restarts
A program is loaded into a segmented memory. Segment 0 holds code, segment 1 holds data, and segment 2 holds stack. Which feature of segmentation allows this type of structured memory allocation?
Fixed block division
Logical division of memory by purpose
Contiguous physical memory allocation
Unified memory model
Consider a virtual memory system that uses demand paging. The system only loads pages when they are required. Suppose a program accesses a sequence of instructions located across different pages. How does demand paging impact the initial performance of the program?
Enhances performance by preloading pages
Reduces CPU speed permanently
Causes initial delays due to page faults
Allows faster memory mapping
The working set model is used in memory management to predict which pages a process will need in the near future. It considers a window of recent page references. Which of the following best defines the working set?
All pages in the disk
Set of recently used pages in a fixed time
All pages in RAM
Random pages accessed previously
Suppose a system is experiencing frequent page faults, causing excessive disk I/O and degraded performance. The system administrator decides to increase the size of the main memory. How does this change affect the virtual memory behavior?
Increases page faults
Reduces page faults
Increases context switching
Reduces hit ratio
In a virtual memory system, each process has its own page table, which maps virtual pages to physical frames. If the page table becomes too large, it can slow down the system. What structure can the OS use to handle this problem efficiently?
Inverted page table
Hash table
Direct table
Circular queue
Consider a system that supports memory-mapped files. A file is mapped into virtual memory and accessed as if it were part of the process memory. What advantage does this provide?
Requires more disk access
Reduces RAM usage
Simplifies file I/O and improves performance
Avoids file locking
