WorksheetsOperating Systems Quiz
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 of the following mechanisms is essential to allow cooperating processes to avoid conflicting access to shared resources?
Memory paging
Context switching
Synchronization primitives (e.g., mutex, semaphore)
Swapping
Number of swaps if 8 processes use 1 swap-in and 1 swap-out
8
16
12
10
A database server frequently updates large files. You are considering ZFS with CoW. What is a potential downside of using ZFS here?
It compresses files too aggressively
CoW increases I/O for frequent overwrites
It deletes data without confirmation
It does not support large files
Orchestration platform widely used for managing Docker-based microservices is:
Kubernetes
OpenStack
VMware ESXi
Hyper-V
Which OS type offers immediate feedback to the user?
Batch
Time-sharing
Real-time
Interactive
A system uses semaphores to coordinate access between two cooperating processes. If both wait on the same semaphore before signaling, what will likely happen?
Increased CPU utilization
Starvation
Deadlock
Better memory sharing
Interpret swap performance if swap time = 30 ms, I/O latency = 10 ms
40 ms
20 ms
30 ms
50 ms
You run a ZFS pool with snapshots. You delete many large files but see no disk space increase. What action will truly free the space?
Defragment the disk
Compress all remaining data
Delete the snapshots referencing those files
Update the pool configuration
Operational approach of Podman that eliminates daemon dependency is achieved by:
Remote API calls
Direct container execution
Use of Vagrant
Kernel modules
A batch system executes 20 jobs in 100 minutes. What is the average turnaround time?
4 min
5 min
10 min
20 min
What must be shared between cooperating processes for inter-process communication (IPC) via shared memory?
Physical memory
File descriptors
A designated region of logical memory
The CPU registers
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
You use Btrfs for your home directory. You enable automatic snapshots every hour. What must you monitor closely to avoid disk exhaustion?
Inode table
Number of open file handles
Available disk space due to snapshot retention
RAM usage
Functional responsibility of a hypervisor in a virtualized environment is to:
Configure BIOS
Manage virtual machine operations
Maintain user accounts
Monitor network bandwidth
Spooling overlaps:
I/O and computation
CPU and memory
Cache and RAM
Processes and threads
In a pipeline of cooperating processes (e.g., Unix shell pipeline), what ensures that the output of one process is correctly fed into the input of the next?
Process priority
I/O redirection and pipe mechanisms
Semaphores
Shared memory
Devise a method to reduce swap-in time in modern systems
SSDs
HDDs
Optical disks
Tape drives
You're building a secure file server with rollback and integrity features. You must choose between Btrfs, ext4, and XFS. Which is the best option and why?
XFS, due to its scalability
Btrfs, because it supports CoW, checksumming, and snapshots
ext4, due to high compatibility
XFS, because it supports journaling
Linux feature responsible for isolating network stack of individual containers is:
SELinux
Namespace
Cron job
System call interface
What is the key benefit of multiprogramming?
Maximizing I/O usage
Reducing memory
Increasing CPU utilization
Avoiding deadlocks
Two processes on the same system need to exchange large amounts of data with low latency. Which IPC method is most efficient for this use case?
Signals
Message Passing
Shared Memory
Pipes
Evaluate swapping as a solution to memory overcommitment
Effective
Inefficient
Obsolete
Slower
On ZFS, after deleting a snapshot, disk usage suddenly drops by 5 GB. What likely happened?
ZFS rewrote the data
5 GB of previously held CoW data became unreferenced
ZFS moved data to another disk
Metadata was corrupted
In containerized systems, the term namespace refers to:
OS bootloader
Kernel-level isolation unit
A Docker command
Memory mapping technique
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
Process A sends a message to Process B through a message queue, but Process B is not yet running. What happens to the message?
It is lost
It is stored in the queue until B reads it
It is sent to another process
It raises a system error
Which strategy will cause the least external fragmentation?
First Fit
Best Fit
Paging
Worst Fit
A CoW file system writes small changes to large files. What strategy can help mitigate performance issues?
Avoid journaling
Use compression
Use recordsize tuning to match file block sizes
Increase checkpoint interval
Portability evaluation favors containers due to their:
Lightweight build
Easy packaging
Platform independence
All of the above
A mainframe handles 1000 transactions/sec and supports 50 users. What is the average transactions per user per sec?
20
25
15
30
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
Estimate number of 128 KB processes that fit in 2 MB RAM
16
12
10
18
You enable deduplication in ZFS on a dataset with many duplicate files. After enabling it, the system becomes slow. What could be the cause of the performance degradation?
Fragmentation of the boot loader
High memory and CPU usage for deduplication tables
File permissions mismatch
CoW disabled for new files
Linux tool used to manage services like Docker or Podman on systemd-based systems is:
init
systemctl
rc.local
launchd
A system with 10 servers processes 1000 requests/sec total. If load is equally balanced, how many requests per server?
100
1000
10
50
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
Size of external fragmentation if free memory is 1000 KB and largest block 700 KB
300 KB
1000 KB
700 KB
0 KB
Evaluating indexed allocation, what is a major disadvantage compared to contiguous allocation?
Complex bookkeeping
External fragmentation
Slow sequential access
High latency
Recommend a reliable method to recover a forgotten root password. It should preserve system integrity and allow access.
Reinstall system
Boot into single-user mode
Reset BIOS
Remove /etc/shadow
A distributed system uses vector clocks with 8 processes. What is minimum size of vector clock?
8
1
4
16
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
Time complexity to search free block in Best Fit (unsorted list)
O(1)
O(n)
O(log n)
O(n^2)
Which allocation method would you recommend for a multimedia streaming service requiring fast sequential access?
Indexed
Contiguous
Linked
Sequential
Select the command to monitor CPU and memory usage interactively. It helps identify system load and resource bottlenecks.
df
ls
top
touch
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
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
Address binding technique with max flexibility in relocation
Compile-time
Load-time
Execution-time
Static-time
HDFS follows a master-slave architecture. Which component acts as the master managing metadata?
DataNode
NameNode
Client
JobTracker
Identify the default shell assigned if not otherwise specified during user creation. It determines how commands are interpreted.
/bin/zsh
/bin/ksh
/bin/bash
/bin/dash
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
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
Physical address for segment starting at 4000 with offset 100
4100
4000
6000
4600
Which characteristic makes Ceph a suitable choice for cloud storage solutions?
Centralized control
Distributed and scalable
Limited to local networks
High latency
Highlight the location where login failures are typically logged in Linux. This is essential for security auditing.
/var/log/messages
/etc/passwd
/var/log/auth.log
/home/logs
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
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
Operation not happening during dynamic linking
Runtime loading
Resolving function addresses
Compile-time linking
Memory sharing
Which file allocation method leads to the simplest access calculation when reading a file?
Contiguous
Sequential
Indexed
Linked
Determine the result of using kill -9 on a process. It bypasses cleanup steps and forces termination.
Graceful exit
Blocked signal
Immediate kill
Delayed stop
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
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
Memory allocation splitting 2048 KB into four 512 KB blocks
First Fit
Best Fit
Buddy System
Paging
Which distributed file system supports strong consistency and POSIX compliance?
HDFS
Ceph
GlusterFS
S3
Choose the best file for adding a static hostname permanently. This name identifies the machine on the network.
/etc/hostname
/etc/profile
/etc/bashrc
/etc/services
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 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
Component responsible for address translation
Linker
Loader
MMU
Scheduler
Sequential allocation stores data blocks in order. What happens if a file grows beyond its allocated space?
File truncated
File relocated
External fragmentation
File extended contiguously
Recommend a security step to restrict SSH login to specific users. This improves controlled access.
Use netstat
Add firewall rule
Modify sshd_config AllowUsers
Change user shell
In a multi-layered OS, communication between layers is performed through:
Registers
Stack
Interface protocols
Shared memory
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
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
Unix must locate files using their paths. A mechanism is used to convert these paths into actual file references using inodes. Select this path translation tool.
name
alloc
stat
free
Given: a <- 5; b <- 3; a^b in R, what is the result?
8
125
15
5
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 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
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
Storing images, videos, logs, and other unstructured data at scale is a cloud challenge. One Azure service is optimized for such use. Identify the appropriate storage solution.
Block-level storage
Object storage
File system emulation
Database backups only
What file must be edited to add a user on a cloud Linux server manually?
/etc/user
/etc/passwd
/user/pass
/add/user
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
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
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
In Unix, users can share files over a network using a file-sharing protocol. This protocol allows access with minimal client-side state. Identify the protocol.
NTFS
ext4
NFS
FAT32
What is the default configuration file for Ansible?
ansible.yaml
ansible.ini
ansible.cfg
config.ansible
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
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
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
NVMe achieves fast response times by minimizing specific types of delays. It is particularly optimized for improving responsiveness in storage operations. Identify the latency type.
Seek time
Rotational delay
Interface latency
Memory swapping
In Puppet, which file contains node definitions?
manifests/site.pp
modules/init.pp
nodes.pp
default.pp
Which of the following is NOT typically considered part of the kernel in OS design?
Scheduler
Memory manager
File manager
Web browser
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
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
Applications running on Google Cloud sometimes need high-performance file sharing via NFS. A managed service supports this requirement. Choose the suitable service.
Block storage
File sharing over NFS
Archival storage
Object storage
Which Ansible loop will execute a task 4 times?
loop: [1,2,3]
with_items: [1,2,3,4]
until: 4
loop: range(1,4)
Which memory management technique can lead to external fragmentation?
Paging
Segmentation
Fixed partitioning
Stack allocation
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
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
File operations like open, close, and read are provided to users by a specific OS layer. This layer interfaces with underlying file systems. Identify the responsible layer.
File control block
File system interface
VFS
Buffer cache
You want to monitor server memory usage. Which tool is best for CLI cloud server?
vi
ps
top
cat
