wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

OS Test 4

Total questions: 100

Worksheet time: 50mins

Name
Class
Date
1.
A batch operating system processes 30 jobs in 60 minutes. What is the average turnaround time per job?
a)
1 min
b)
2 min
c)
30 min
d)
60 min
2.
In a Round Robin scheduling algorithm with time quantum = 4ms, consider 4 processes arriving at time 0 with burst times: P1=5ms, P2=12ms, P3=3ms, P4=7ms. Which process completes execution first?
a)
P1
b)
P2
c)
P3
d)
P4
3.
A process of 120 KB is loaded into a 150 KB partition. How much internal fragmentation occurs?
a)
20 KB
b)
30 KB
c)
10 KB
d)
None
4.
A file is updated 5 times in 5 minutes, and each update causes the entire segment (1 MB) to be rewritten.What total disk space is used after 5 updates?
a)
1 MB
b)
5 MB
c)
500 KB
d)
2 MB
5.
Primary function of the Linux kernel in modern computing systems involves:
a)
File operations
b)
Managing hardware resources
c)
UI rendering
d)
Driver compilation
6.
If context switch takes 5 ms and the time quantum in a round robin system is 20 ms, how much CPU time is lost in context switching for 100 processes?
a)
500 ms
b)
5,000 ms
c)
100 ms
d)
200 ms
7.
Which of the following scenarios best illustrates starvation in process scheduling?
a)
A low-priority process is repeatedly passed over by high-priority processes and never gets CPU time.
b)
A process is blocked waiting for I/O completion.
c)
A process completes its execution but remains in the Ready Queue.
d)
A process enters an infinite loop while running.
8.
Convert 512 KB to bytes.
a)
512000
b)
524288
c)
500000
d)
102400
9.
You design a system using LFS but experience high memory usage. What is a practical solution?
a)
Increase inode size
b)
Cache only recent parts of the inode map
c)
Remove the log structure
d)
Use swap space
10.
Command responsible for displaying currently active processes in Linux is:
a)
ls
b)
ps
c)
mkdir
d)
rm
11.
An OS has a boot time of 2 minutes. If it boots 12 times/day, what is the boot overhead per day?
a)
24 min
b)
12 min
c)
22 min
d)
18 min
12.
Which of the following scheduling algorithms can lead to the convoy effect, where short processes get stuck behind long processes?
a)
Round Robin
b)
Shortest Job First
c)
First-Come, First-Served
d)
Priority Scheduling
13.
Identify the external fragmentation if holes are: 100 KB, 300 KB, 150 KB and process = 200 KB
a)
150 KB
b)
100 KB
c)
50 KB
d)
450 KB
14.
To optimize performance, which of the following should be scheduled during low system load in LFS?
a)
Checkpoint writing
b)
Segment cleaning
c)
Inode table compression
d)
Log truncation
15.
Definition of a container within Linux-based environments refers to:
a)
A virtual machine
b)
An isolated lightweight process
c)
A shared memory buffer
d)
A backup mechanism
16.
A single-user OS supports 8 apps, each needing 100 MB. If the user has only 512 MB RAM, how many apps can be active simultaneously?
a)
5
b)
6
c)
4
d)
8
17.
In Shortest Job First (SJF) scheduling, which condition can lead to incorrect CPU burst predictions, thereby affecting efficiency?
a)
High process arrival rate
b)
Variable I/O device speeds
c)
Inaccurate estimation of next CPU burst time
d)
Low memory allocation
18.
Explain why Best Fit leads to more fragmentation than First Fit with example: 200 KB process
a)
Fits smaller holes
b)
Uses biggest hole
c)
No fragmentation
d)
Always optimal
19.
You observe that your LFS file system is using disk space inefficiently. What is the likely cause?
a)
Infrequent checkpointing
b)
Overwritten inodes
c)
High number of partially full segments
d)
File read bottlenecks
20.
Linux features enabling Docker’s container isolation capabilities are:
a)
Hypervisor & threads
b)
Namespaces & cgroups
c)
Disk quotas
d)
Bash shell isolation
21.
In a time-sharing OS, the context switch time is 2 ms. If each process runs 48 ms, what is CPU efficiency?
a)
0.9
b)
0.96
c)
0.92
d)
0.98
22.
A system uses Round Robin scheduling with a time quantum of 5 ms. If a process requires 18 ms of CPU time, how many context switches will occur (excluding the first dispatch)?
a)
2
b)
3
c)
4
d)
5
23.
Choose the most suitable hole for 125 KB process among 130 KB, 140 KB, 200 KB using Best Fit
a)
130 KB
b)
140 KB
c)
200 KB
d)
None
24.
You need to reduce the garbage collection overhead in an LFS-based file system. Which approach would be most effective?
a)
Decrease the segment size
b)
Use a better segment cleaning policy
c)
Increase the number of inodes
d)
Enable journaling
25.
Key architectural distinction between Docker and Podman involves:
a)
Docker runs rootless
b)
Podman operates without daemon
c)
Docker is daemonless
d)
Podman requires root
26.
60% of OS code is in kernel mode, 40% in user mode. If kernel is optimized by 50%, what is overall speedup?
a)
0.25
b)
0.4
c)
0.2
d)
0.6
27.
Consider three processes with arrival times and burst times: P1 (0, 6), P2 (1, 4), P3 (2, 2). Using Shortest Remaining Time First (SRTF) scheduling, which process finishes first?
a)
P1
b)
P2
c)
P3
d)
All finish at the same time
28.
Apply First Fit for a 320 KB process on holes: 300 KB, 350 KB, 400 KB
a)
350 KB
b)
300 KB
c)
400 KB
d)
None
29.
Why does an LFS require more RAM compared to traditional file systems?
a)
It loads all file contents into RAM
b)
It stores directory entries in memory
c)
It caches inode maps and segment usage tables
d)
It performs compression in RAM
30.
Common shared component in containers that differentiates them from VMs is the:
a)
Kernel
b)
Complete OS image
c)
Network card
d)
BIOS
31.
An OS takes 100 MB RAM. On a system with 2 GB RAM, what % is consumed by OS?
a)
0.05
b)
0.1
c)
0.025
d)
0.2
32.
A scheduling algorithm gives priority to I/O-bound processes. What is the likely benefit of this approach?
a)
Reduces context switching
b)
Improves CPU utilization
c)
Reduces memory usage
d)
Minimizes waiting time for CPU-bound processes
33.
Determine internal fragmentation when 3 processes use partitions of 256 KB, with sizes 240 KB each
a)
16 KB
b)
48 KB
c)
36 KB
d)
32 KB
34.
After a power failure, the LFS system appears to have lost recent file changes. Which component might not have updated in time?
a)
Segment summary
b)
Inode map
c)
Checkpoint region
d)
Directory cache
35.
Docker command used to list all containers (active and inactive):
a)
docker run
b)
docker ps
c)
docker ps -a
d)
docker restart
36.
A multiprocessor system has 8 processors. If each processor executes at 2 GHz and achieves 1.5 IPC, what is total throughput?
a)
12 GIPS
b)
24 GIPS
c)
16 GIPS
d)
8 GIPS
37.
Two processes attempt to update a shared counter simultaneously without any locking mechanism. Sometimes the final value is incorrect. What synchronization issue does this illustrate?
a)
The counter overflows
b)
Race condition due to critical section violation
c)
Starvation of the counter
d)
Proper use of parallelism
38.
Bytes allocated by dynamic memory allocator requesting 1500 bytes in 512-byte chunks
a)
1500
b)
2048
c)
1536
d)
1024
39.
Distributed file systems store data across multiple nodes to ensure availability. Which system is an example?
a)
Ceph
b)
NTFS
c)
FAT32
d)
ext3
40.
Identify the configuration file used for storing user account details in Linux systems. This file plays a vital role in user authentication and identity management.
a)
/etc/user
b)
/etc/passwd
c)
/etc/logs
d)
/etc/sudoers
41.
In a system with 4 processors, the workload is 80% parallelizable. What is the maximum speedup achievable using Amdahl’s Law?
a)
2.5
b)
3.2
c)
3.6
d)
4
42.
In a two-process system, both processes check a flag to enter the critical section. If they check and find it clear at the same time, both enter. What key condition is violated?
a)
Progress
b)
Deadlock avoidance
c)
Bounded waiting
d)
Mutual exclusion
43.
Absolute address if linker assigns 3000 and relative address is 250
a)
250
b)
2750
c)
3250
d)
3000
44.
In HDFS, data is divided into fixed-size blocks and distributed. What is the default block size?
a)
64 MB
b)
128 MB
c)
256 MB
d)
512 MB
45.
Determine the command that modifies the ownership of a file. This operation is essential in managing file permissions and access control.
a)
chmod
b)
usermod
c)
chown
d)
touch
46.
A cache coherence protocol adds 5 cycles latency per access. If average memory access time without coherence is 50 cycles, what is new average access time?
a)
55 cycles
b)
50 cycles
c)
60 cycles
d)
65 cycles
47.
A developer uses a busy-wait loop to check a condition before entering a critical section. Over time, system performance drops. What is likely causing the issue?
a)
Lack of mutexes
b)
Thread starvation
c)
Excessive context switching
d)
CPU waste due to busy waiting
48.
Initial memory required if program size is 800 KB with 300 KB dynamic linking
a)
300 KB
b)
500 KB
c)
800 KB
d)
100 KB
49.
Contiguous allocation stores files in consecutive blocks. What is the main drawback of this method?
a)
Fast access
b)
External fragmentation
c)
Simplified bookkeeping
d)
No fragmentation
50.
Point out the correct role of the /etc/fstab configuration file. It automates the mounting of file systems during system boot.
a)
Mount file systems
b)
Start daemons
c)
Update kernel modules
d)
Track user sessions
51.
A multiprocessor system achieves 90% efficiency with 16 processors. What is the speedup?
a)
14.4
b)
12
c)
15
d)
10
52.
On a multi-core processor, two threads repeatedly check and update a shared resource using a shared variable without synchronization. Occasionally, the program crashes. What mechanism should be added?
a)
Paging
b)
Atomic hardware instructions like TestAndSet
c)
Thread pooling
d)
I/O buffering
53.
Memory allocation strategy causing least fragmentation
a)
First Fit
b)
Best Fit
c)
Worst Fit
d)
Random Fit
54.
Sequential allocation is best suited for which type of files?
a)
Random access files
b)
Sequential access files
c)
Database files
d)
Executable files
55.
Apply the command that lists running processes with real-time updates. This helps in monitoring system performance.
a)
ps aux
b)
top
c)
who
d)
uptime
56.
If each processor consumes 50W power and overhead due to communication is 25% extra, what is total power for 10 processors?
a)
625W
b)
500W
c)
750W
d)
600W
57.
A system allows multiple threads to enter a critical section when scheduled closely together. This leads to inconsistent data. What aspect of synchronization is improperly implemented?
a)
Preemptive scheduling
b)
Thread affinity
c)
Incorrect critical section logic
d)
Lock-free memory management
58.
Memory allocation technique that wastes more memory but faster
a)
Best Fit
b)
Worst Fit
c)
First Fit
d)
Next Fit
59.
Indexed allocation uses an index block to store pointers. What advantage does it have over sequential allocation?
a)
Supports direct access
b)
Uses less disk space
c)
Faster sequential access
d)
No need for index blocks
60.
Select the tool that helps in creating partitions on a hard disk. Disk management requires creating and resizing partitions.
a)
chmod
b)
fdisk
c)
diff
d)
echo
61.
A system with 12 processors runs a workload with 95% parallel portion. Using Amdahl’s Law, what is theoretical max speedup?
a)
10.5
b)
15
c)
11.4
d)
20
62.
A shared printer queue is accessed by multiple user processes. Sometimes, two users get the same print slot. What is the most likely cause?
a)
Printer driver error
b)
Duplicate process IDs
c)
Lack of mutual exclusion in queue access
d)
I/O starvation
63.
Number of undefined symbols detected by linker given object files
a)
0
b)
1
c)
2
d)
3
64.
Which type of allocation allows random access without external fragmentation?
a)
Contiguous
b)
Sequential
c)
Indexed
d)
Linked
65.
Choose the effect of the chmod 755 file.sh command. This sets execute permissions for the owner and read-execute for others.
a)
Owner can only read
b)
Everyone can execute
c)
Only root can modify
d)
Owner can write and execute
66.
Memory bandwidth is 10 GB/s. If each processor needs 500 MB/s, what is the maximum number of processors supported without bottleneck?
a)
20
b)
25
c)
15
d)
30
67.
An OS uses a semaphore initialized to 1 to protect a shared resource. One process enters the critical section and is terminated without signaling. What’s the result?
a)
The resource becomes shared
b)
All other processes are blocked indefinitely
c)
A race condition occurs
d)
The semaphore resets automatically
68.
Component resolving external symbols at runtime in dynamic linking
a)
Loader
b)
Compiler
c)
Dynamic Linker
d)
Assembler
69.
Ceph uses an algorithm to distribute data evenly across disks. What is this algorithm called?
a)
RAID
b)
CRUSH
c)
Consistent Hashing
d)
Replication
70.
Diagnose the issue caused by incorrect permissions on /etc/shadow. This file stores sensitive password hashes.
a)
Login failures
b)
GUI crash
c)
Kernel panic
d)
High CPU usage
71.
In a real-time system, a hard real-time task must meet a deadline of 50 ms. If the task requires 20 ms of computation time and the system has a scheduling overhead of 5 ms, what is the maximum time available for context switching and other system activities to ensure the deadline is met?
a)
25 ms
b)
30 ms
c)
20 ms
d)
45 ms
72.
A system has 3 processes and 4 instances of a resource. Max = [3,2,2], Allocation = [1,0,0]. What is Available?
a)
2
b)
1
c)
3
73.
In an operating system, memory management is essential to ensure processes execute efficiently. One common method is paging, which divides memory into fixed-size blocks. This allows non-contiguous memory allocation and simplifies memory allocation. Which of the following statements best explains the primary purpose of using paging?
a)
It allows memory allocation based on process size
b)
It helps in allocating contiguous memory for each process
c)
It breaks memory into fixed-size blocks to avoid external fragmentation
d)
It increases internal fragmentation significantly
74.
In a distributed computing environment, systems often need access to shared data. NFS allows multiple machines to access files from a common location. Identify the key benefit provided by NFS.
a)
Faster local storage access
b)
Data redundancy
c)
Centralized file access over a network
d)
Improved CPU performance
75.
What will be the output of print(myFunction(4)) given: myFunction <- function(a, b = 2){ result <- a * b; return(result) }?
a)
Error due to missing argument
b)
8
c)
6
d)
Null
76.
A soft real-time system processes video frames at 30 frames per second. If each frame requires 25 ms of processing time, what is the maximum allowable latency for scheduling to avoid frame drops?
a)
33.33 ms
b)
8.33 ms
c)
25 ms
d)
30 ms
77.
5 processes, 3 resources. Given max need and allocation, how many safe sequences exist?
a)
1
b)
Multiple
c)
None
d)
Exactly 2
78.
When a process is loaded into memory using paging, its logical address space is divided into pages, and the physical memory is divided into frames. The page table is used for address translation. Which of the following is the correct mapping mechanism in paging?
a)
Frame to page via TLB
b)
Logical to physical address using page table
c)
Physical to logical mapping using segments
d)
Frame to segment using base and limit
79.
Organizations using AWS need scalable, shared file storage across multiple instances. One service in AWS supports elastic file systems with POSIX compliance. Choose the correct AWS service.
a)
Google Filestore
b)
Azure Blob Storage
c)
Amazon EFS
d)
Dropbox
80.
In Ansible, which module is used to install a package on Debian-based systems?
a)
yum
b)
apt
c)
dnf
d)
install
81.
Consider a real-time system using Rate Monotonic Scheduling (RMS). Task T1 has a period of 100 ms and execution time of 20 ms, and Task T2 has a period of 150 ms and execution time of 30 ms. What is the total CPU utilization?
a)
0.35
b)
0.4
c)
0.5
d)
0.6
82.
Max = [7,5,3], Allocation = [3,2,2]. What is the Need?
a)
[4,3,1]
b)
[4,3,2]
c)
[3,3,1]
d)
[5,3,2]
83.
Paging can lead to internal fragmentation, especially when process sizes are not multiples of page sizes. Suppose a system uses a 4KB page size and a process requires 18KB of memory. What is the internal fragmentation in this case?
a)
2KB
b)
4KB
c)
6KB
d)
8KB
84.
High-speed data access is crucial for real-time applications. Some storage technologies are designed for ultra-low latency. Select the technology optimized for fastest access.
a)
SATA SSD
b)
NVMe SSD
c)
HDD
d)
Tape storage
85.
Which file in Ansible is used to define host groups?
a)
inventory
b)
hosts.cfg
c)
ansible.cfg
d)
group_vars
86.
In a real-time system, a task set is scheduled using Earliest Deadline First (EDF). If Task T1 has a deadline at 50 ms and T2 at 70 ms, and both tasks arrive at t=0 with execution times of 20 ms and 30 ms respectively, which task executes first?
a)
T1
b)
T2
c)
Both simultaneously
d)
Neither, system fails
87.
Given: A=10, B=5, C=7. Allocation and Max provided. If Available = [3,3,2], can P1 proceed?
a)
Yes
b)
No
c)
Depends
d)
Cannot say
88.
Segmentation differs from paging by allowing memory to be divided based on logical divisions such as functions, arrays, and data structures. This enables better protection and sharing. What is the major disadvantage of segmentation when compared to paging?
a)
Leads to internal fragmentation
b)
Increases system security
c)
Causes external fragmentation
d)
Does not support multiprogramming
89.
Unix systems maintain metadata like ownership, timestamps, and access permissions in a special structure. This structure does not store file data directly. Identify the structure used.
a)
Directory entry
b)
Inode
c)
File descriptor
d)
Superblock
90.
Puppet uses which language to define configuration files?
a)
Ruby
b)
YAML
c)
JSON
d)
Python
91.
Which of the following system calls is used to create a new process?
a)
read()
b)
fork()
c)
open()
d)
exit()
92.
Banker's Algorithm: Available = [3,3,2], Need for P2 = [1,2,2]. Can P2 proceed?
a)
Yes
b)
No
c)
Only if P1 finishes
d)
Need more info
93.
In segmentation, a logical address consists of a segment number and an offset. If the offset is larger than the segment limit, what kind of fault does the system generate, and why?
a)
Page fault due to invalid offset
b)
Memory overflow due to large limit
c)
Segment fault due to invalid offset
d)
No error occurs; memory wraps around
94.
Operating systems provide a consistent way for applications to interact with files, regardless of underlying storage types. This logical layer abstracts file operations. Identify this component.
a)
File system interface
b)
I/O scheduler
c)
Disk controller
d)
Virtual memory
95.
What is the output of ansible all -m ping if SSH is misconfigured?
a)
pong
b)
success
c)
unreachable
d)
success with warning
96.
Which of the following best describes soft real-time systems?
a)
Systems that cannot tolerate any delay
b)
Systems that can occasionally miss deadlines
c)
Systems that only process batch jobs
d)
Systems that have no timing constraints
97.
Given Allocation & Max, compute a safe sequence.
a)
P1,P3,P2
b)
P2,P1,P3
c)
P3,P2,P1
d)
Cannot say
98.
Segmentation provides better support for protection and sharing compared to paging. Each segment can have separate permissions and sharing attributes. Which of the following scenarios best demonstrates this advantage of segmentation?
a)
A program accessing its stack segment
b)
Multiple processes sharing a code segment read-only
c)
A process performing I/O operations
d)
A program using malloc for dynamic memory
99.
When creating a file in Unix, the system must reserve a metadata structure for it. A specific system call handles this allocation. Choose the call responsible for inode reservation.
a)
alloc
b)
namei
c)
ialloc
d)
ifree
100.
What port is used by Puppet Agent to communicate with the Puppet Master?
a)
8140
b)
443
c)
22
d)
8080