WorksheetsOS Test 3
Total questions: 100
Worksheet time: 53mins
A desktop processor runs at 3.5 GHz. Each instruction takes 2 cycles. What is max instruction throughput?
1.75 billion/sec
2 billion/sec
3.5 billion/sec
7 billion/sec
In a system using First-Come, First-Served scheduling, which of the following situations is most likely to result in a high average waiting time?
All processes have the same burst time
Short processes arrive after long ones
Processes arrive in increasing order of burst time
All processes arrive at the same time
Devise a swapping schedule for 4 processes with varying priorities
Priority-based
FIFO
Round-robin
Random
Given a choice between LFS and ext4 for a write-heavy IoT system with flash storage, which is the better choice and why?
ext4, because it has journaling
FS, due to efficient sequential writes on flash
ext4, for better directory structures
LFS, because it reduces file read latency
Purpose of executing podman run on a Linux system is to:
Display running pods
Launch a new container
Remove container
Export logs
A desktop boots in 30 seconds. A mainframe takes 5 minutes. What's the % time difference?
9
10
11
7
A process completes its CPU burst and enters the waiting state for I/O. What happens to this process in terms of scheduling?
It is removed from the system
It returns to the Ready Queue immediately
It waits in the I/O Queue until it's ready
It preempts another process currently running
How many processes can be swapped in 1 GB memory if each process needs 256 MB?
4
2
3
5
You are using Btrfs and take a snapshot of a 1 GB subvolume. You then modify 100 MB of data. How much additional disk space is consumed after the modification?
100 MB
1 GB
900 MB
2 GB
Linux utility used to view real-time process and memory usage statistics:
netstat
top
chmod
df
A mainframe has 16 CPUs, each 4-core. How many logical processors?
64
32
48
16
If the time quantum in Round Robin scheduling is set too high, what scheduling behavior does it resemble?
Priority Scheduling
Shortest Job First
First-Come, First-Served
Multilevel Queue Scheduling
Choose best partition: Process size = 480 KB, Partitions = 512 KB x 3
All fit
Only first
None
Any one
A ZFS system uses CoW and is experiencing slow performance during large writes. What is a likely contributing factor?
High CPU usage
CoW causes additional metadata and block updates
Low inode count
Excessive reads
Component within Linux architecture handling resource isolation for containers is the:
Shell script
Kernel
Bootloader
Grub
Mainframe storage = 20 TB. Each user needs 5 GB. How many users can be supported?
4000
5000
6000
3000
Four processes arrive at time 0 with burst times: P1=8ms, P2=4ms, P3=2ms, P4=1ms. Using SJF (non-preemptive), what is the average waiting time?
4.5 ms
5 ms
6.25 ms
7 ms
Identify unused memory when 4 processes of 100 KB are loaded in 150 KB partitions
200 KB
180 KB
250 KB
150 KB
You must choose between ext4 and ZFS for a backup server with heavy snapshot usage and data deduplication requirements. Which is the better file system and why?
ext4, for lower CPU usage
ZFS, due to native deduplication and snapshot capabilities
ext4, for better compatibility
Neither, use FAT32
Resource efficiency comparison shows that containerization requires:
More RAM than VMs
Fewer resources than VMs
Equal resources as VMs
More disk than VMs
Desktop system's uptime is 99.5%, mainframe is 99.99%. What's the downtime difference per year?
45 hours
10 hours
52 hours
20 hours
In a system with high context switching overhead, which scheduling algorithm would be least efficient?
First-Come, First-Served
Shortest Job First
Round Robin
Priority Scheduling
Apply Worst Fit for 220 KB process: holes = 300 KB, 250 KB, 280 KB
300 KB
280 KB
250 KB
None
On Btrfs, you delete a file that was part of a snapshot. What happens to the disk space used by that file?
Space is immediately reclaimed
File is deleted from disk permanently
File remains until all referencing snapshots are deleted
File is renamed in snapshot
Container runtime most suited for multi-user, rootless operation scenarios is:
Docker
Podman
KVM
QEMU
Desktop power use = 400W, mainframe = 20,000W. For 10 hrs, energy used difference?
19.6 kWh
196 kWh
160 kWh
200 kWh
Two cooperating processes need to access a shared file. If both processes try to write to the file at the same time without synchronization, what issue is most likely to occur?
Starvation
Race condition
Deadlock
Context switch overhead
Calculate remaining memory after loading 3 processes: 200 KB, 300 KB, 150 KB in 1 MB
350 KB
400 KB
200 KB
250 KB
Your ZFS pool has multiple snapshots. You notice increasing disk usage despite few visible changes. What explains the high disk usage?
Swap files consuming space
Snapshots retaining changed blocks
Index fragmentation
Missing RAID configuration
Common security vulnerability in container ecosystems involves potential:
Kernel-level exploits
Hypervisor privilege escalation
BIOS modification
GPU misuse
A mainframe runs 100 VMs, desktop 1. What's the consolidation ratio?
4 days, 4:01:00
2 days, 2:01:00
10:01:00
20:01:00
Process A writes to a shared buffer and Process B reads from it. If Process B starts reading before A writes, what is a possible result without proper synchronization?
Increased throughput
Improved latency
Reading stale or garbage data
Deadlock
What is internal fragmentation if a process of 95 KB is placed in a 128 KB block?
33 KB
13 KB
28 KB
30 KB
You clone a Btrfs subvolume and make changes only in the clone. How does Btrfs manage these changes?
It writes changes to both original and clone
It stores differences in a separate log
It uses CoW to duplicate only modified blocks
It locks the original subvolume
File used for building Docker container images based on configuration is the:
Compose file
Dockerfile
Container log
Snapshot script
If a cluster workload is 75% parallelizable and 6 nodes are used, what is max speedup by Amdahl’s Law?
3.3
4
5
6
A programmer wants to implement a lock-free counter shared by multiple threads. Which hardware feature is essential to ensure atomic updates to the counter?
Shared memory
Page tables
CompareAndSwap instruction
Signal handler
Base address for segment 3 if segments loaded at 1000, 2000, 3000, 4000
2000
3000
4000
1000
HDFS is optimized for batch processing large files. Which layer handles the metadata about file blocks?
DataNode
NameNode
Client
SecondaryNameNode
Identify the result of assigning /sbin/nologin as a user's shell. It prevents the user from accessing the system interactively.
Enables GUI access
Denies remote login
Blocks console access
Disables file access
Cluster inter-node latency is 50 μs. For a job requiring 2000 messages exchanged, what is total latency overhead?
100 ms
50 ms
10 ms
150 ms
A developer chooses to use a FetchAndAdd instruction for synchronization. Over time, some threads wait much longer than others. What problem is likely to occur?
What is total latency overhead?
100 ms
50 ms
10 ms
150 ms
A developer chooses to use a FetchAndAdd instruction for synchronization. Over time, some threads wait much longer than others. What problem does this describe?
Busy waiting
Starvation
Race condition
Deadlock
Minimum relocation entries if module uses 3 external and defines 2 symbols
2
3
5
0
Which allocation method is prone to external fragmentation causing wasted disk space?
Contiguous
Sequential
Indexed
Linked
Select the file responsible for listing valid login shells in Linux. It defines which shells are accepted for users.
/etc/shells
/etc/passwd
/etc/hosts
/etc/profile
A cluster’s shared storage bandwidth is 1 GB/s. If each node needs 100 MB/s, what is max nodes supported without bandwidth bottleneck?
10
8
5
12
A real-time system implements a lock using TestAndSet, but tasks occasionally miss deadlines. What’s the likely reason?
Lack of timers
Busy waiting wastes CPU cycles
TestAndSet causes memory leaks
Stack overflow
Example of dynamic storage allocation problem
Paging
Segmentation
Buddy system
Swapping
In distributed file systems, data replication primarily improves what aspect?
Capacity
Security
Fault tolerance
Speed
Evaluate why SSH key-based authentication is preferred over password-based methods. It improves security for remote access.
Simpler login
Reduced command usage
Stronger cryptographic access
Requires less setup
Cluster node failure rate is 0.1% per hour. For 20 nodes, what is system failure probability in 1 hour?
0.02
0.002
0.01
0.005
In an embedded system, synchronization is required but space is highly limited. Which of the following would be the most efficient mechanism?
Using hardware atomic instructions like TestAndSet
Full semaphore implementation
Condition variables with dynamic memory
Multiprocessing environment
Smallest block size in buddy system if total memory 1024 KB
1 KB
2 KB
4 KB
System-defined
A file stored using indexed allocation has an index block of 4 KB. If each pointer is 4 bytes, how many blocks can the index point to?
1024
512
2048
4096
Identify the command that changes user group membership. This helps manage access to files and system resources.
groupadd
usermod
adduser
chgrp
A cluster job runs in 120 seconds on 1 node and 30 seconds on 8 nodes. What is efficiency?
0.5
0.6
0.4
0.3
A system uses a counting semaphore initialized to 3 to control access to a pool of printers. Four processes request a printer at the same time. What will happen to the fourth process?
It uses a virtual printer
It is denied access permanently
It is blocked until a printer is released
It accesses two printers simultaneously
Address binding requiring load time
Static Linking
Dynamic Linking
Compilation
Execution
Analyzing HDFS, what happens if a DataNode fails?
Data lost
Metadata lost
Data replicated elsewhere
Client disconnected
Distinguish the effect of a misconfigured sudoers file. It can lead to critical privilege issues in the system.
Kernel crash
Prevents user login
Blocks privilege escalation
Enables root for all
If network bandwidth in a cluster is 10 Gbps, how long to transfer 1 GB data ignoring overhead?
0.8 seconds
1 second
0.5 seconds
0.9 seconds
A programmer implements mutual exclusion using a binary semaphore. However, once a process enters the critical section, no other process ever proceeds. What is the likely issue?
The semaphore was initialized to 2
The process never performs a signal() after wait()
Too many processes are running
The CPU has failed
Number of symbols to resolve during linking if 5 modules define 1 and refer to 2 each
5
10
15
20
Compare contiguous and indexed allocation for large files. Which one better handles file growth?
Contiguous
Indexed
Both same
Neither
Point out the tool used for scheduling recurring jobs. System tasks like backups or monitoring often require automation.
nohup
cron
sleep
watch
A cluster scheduler distributes 500 tasks evenly across 10 nodes. How many tasks per node?
50
100
500
10
Two threads use a shared buffer and synchronize access using semaphores. The producer uses wait(empty) and signal(full), while the consumer uses wait(full) and signal(empty). What issue can occur if both threads forget to use a mutex around buffer access?
Deadlock
Buffer corruption due to race condition
Starvation of consumer
Buffer underflow
Best explanation of internal fragmentation
Wasted space between blocks
Space within allocated block not used
Memory outside addressable space
Space for page tables
In Ceph, how is data durability maintained despite disk failures?
Encryption
Replication
Compression
Backup
Choose the configuration file used for defining environmental variables system-wide. This ensures global variable settings.
~/.bashrc
/etc/bash.bashrc
/etc/environment
/etc/profile.d
Which component of an OS handles inter-process communication?
Scheduler
Dispatcher
Message-passing system
File System
To prevent circular wait, an OS imposes a global order on resource acquisition. What is a potential drawback?
Increased risk of starvation
More complex implementation in distributed systems
Deadlocks still occur
No effect on performance
A segmented-paged memory system has a segment table and per-segment page tables. How does this structure help in reducing external fragmentation while supporting logical program division?
By using one large page table
By using swapping instead of paging
By using pages inside segments for flexibility
By increasing segment size
Unix systems use memory to temporarily store disk blocks, speeding up read/write operations. This caching mechanism helps reduce physical disk I/O. Identify the component.
Cache DNS queries
Speed up file system access
Store executable binaries
Swap memory pages
What does become: true do in an Ansible playbook?
Switch user
Become root
Run as current user
Elevates permission
Which scheduling algorithm may cause starvation?
Round Robin
Priority Scheduling
FCFS
Multilevel Queue
In real-time OS with preemptive scheduling and some non-preemptible resources, deadlocks occur because
Priority scheduling eliminates deadlocks
Non-preemptible resources cause hold and wait
CPU starvation happens
Processes release all resources
In a paged memory system, if the page table is too large to fit into memory, it can cause inefficiencies during address translation. To overcome this, systems use multi-level page tables. How does this technique help in managing memory effectively?
It flattens all page tables into one
It reduces memory usage by loading only required page table parts
It merges page and frame concepts to avoid fragmentation
It caches entire page tables in hardware
Network File System (NFS) depends on a network transport protocol for communication between clients and servers. One lightweight, connectionless protocol is commonly used. Pick the protocol.
FTP
UDP
HTTP
SSH
Calculate the number of tasks executed in a play with 2 hosts and 3 tasks each.
3
6
2
1
In real-time scheduling, the Earliest Deadline First (EDF) algorithm is:
Non-preemptive and optimal
Preemptive and non-optimal
In real-time scheduling, the Earliest Deadline First (EDF) algorithm is:
Non-preemptive and optimal
Preemptive and non-optimal
Preemptive and optimal
Non-preemptive and non-optimal
Dynamic storage management can cause fragmentation, increasing deadlock risk because
Processes hold resources too long
Memory requests cause circular wait
Storage is always contiguously allocated
Requests are denied
Suppose a process has 5 segments with varying sizes. If each segment is allocated memory separately without paging, what memory issue is most likely to occur, and how does this affect system efficiency?
Internal fragmentation from unused space
External fragmentation due to gaps between segments
Paging overhead caused by variable sizes
No issue occurs in memory allocation
Non-volatile storage technologies vary in performance. NVMe relies on a fast interface and memory type to reduce latency. Identify the storage used by NVMe.
Magnetic disk
Flash memory
Optical disk
Tape
Identify the correct YAML syntax:
- name: task1 tasks: echo
tasks: [task1]
- name: task1 tasks: - shell: echo
task1 => echo
Which of the following is NOT a typical constraint for a hand-held operating system?
Low memory footprint
High power consumption
Efficient I/O management
Real-time performance
An educational simulation shows resource allocation graphs and process states. What is a key learning outcome?
Understand deadlock characterization and detection
Learn CPU scheduling algorithms
Understand memory paging
Learn disk scheduling
A paging system includes a page table that maps logical to physical addresses. When a page table becomes very large, how do operating systems typically manage the overhead of address translation?
Use of cache to hold frequent pages
Use of associative memory to map offsets
Use of Translation Lookaside Buffer (TLB) to cache page table entries
Increasing page size to reduce table entries
Unix must free up disk blocks when files are deleted to reclaim storage. A specific system call handles the block release. Identify this function.
free
ifree
alloc
namei
In Puppet, what is the function of 'ensure => present'?
Ensures resource removal
Checks if resource is active
Ensures resource is installed
Removes the resource
Which system structure separates policy from mechanism and is highly portable?
Monolithic kernel
Microkernel
Layered OS
Hybrid kernel
In database systems, a wait-for graph is used to
Detect deadlocks
Schedule queries
Increase throughput
Manage cache
In a segmented-paging system, what steps are involved in converting a logical address into a physical address? Detail the specific translations that take place and the role of the segment and page tables in this process.
Segment number → Offset → Frame
Segment number → Page number → Offset → Frame
Page number → Frame → Segment
Logical → Physical block translation
In AWS, a fully managed file storage service supports mounting shared file systems to EC2 with standard file access protocols. Select this storage option.
S3
Glacier
EFS
EBS
Ansible works over which protocol by default?
HTTP
Telnet
SSH
FTP
Which system call is used to terminate a process in Unix-like OS?
kill()
fork()
exit()
close()
A multi-user system suffers from random resource requests causing deadlocks. Which prevention strategy is best?
Resource ordering
Allow hold and wait
No preemption
Increase CPU speed
