NEW
Font size
WorksheetsOperating System Concepts Quiz
Total questions: 40
Worksheet time: 20mins
Consider a system with 3 processes using a turn variable for critical section entry in a round-robin manner. If process P1 has just finished, what is the value of turn, and which process enters next?
turn = 2; P2
turn = 0; P0
turn = 1; P1
turn = 3; Invalid
In a producer-consumer setup with a buffer size of 5, the producer places 3 items, and the consumer removes 2. What are the final semaphore values assuming full = 0, empty = 5, mutex = 1 initially?
full = 1, empty = 4
full = 3, empty = 2
full = 1, empty = 5
full = 2, empty = 3
A monitor manages access to a shared printer. If 4 threads request access, and each print job takes 2 seconds, what is the total execution time (in seconds) assuming serialized access using monitor?
2
4
6
8
A system has 3 processes and 3 instances of a single resource type. Each process holds 1 instance and requests 1 more. Is the system in deadlock?
Yes
No
Depends on resource release
Not enough info
In a system with 2 types of resources (R1: 3 instances, R2: 2 instances), what is the maximum number of processes that can be granted at least one instance of both R1 and R2 to avoid circular wait?
1
2
3
0
A program has three modules with sizes 4 KB, 6 KB, and 8 KB respectively. The dynamic linker uses lazy binding and loads only necessary modules during execution. If only the first two modules are used during a particular run, what is the total memory occupied by the loaded modules?
10 KB
18 KB
8 KB
20 KB
If a logical address consists of a 4-bit segment number, 3-bit page number, and 10-bit offset, what is the total logical address size in bits and the total logical address space in KB?
17 bits, 128 KB
17 bits, 256 KB
17 bits, 64 KB
20 bits, 256 KB
A system with 32-bit logical address space uses demand paging with a page size of 4 KB. If the memory contains 256 frames, how many bits are used for the frame number in the physical address?
8 bits
10 bits
12 bits
16 bits
Calculate the effective memory access time if the memory access time is 100 ns, page fault service time is 10 ms, and page fault rate is 0.001.
109,900 ns
10,000 ns
199 ns
10,100 ns
Consider the following snapshot: Process Max Allocation Available = (3, 3) P0 (5,2) (2,0) P1 (3,2) (1,1) P2 (4,3) (2,1) Can the system be in a safe state?
Yes, safe sequence exists
No, system is unsafe
Cannot determine
Depends on future request
Given an index block size of 4 KB and block size of 4 KB, how many data blocks can one index block reference if each block pointer is 4 bytes?
1024
512
256
2048
If an inode contains 12 direct pointers, 1 single indirect pointer, and each block pointer is 4 bytes with block size 4 KB, what is the maximum file size supported assuming the indirect block only points to data blocks?
52 KB
64 KB
16 MB
48 KB
A buffer cache has 128 buffers, each of 4 KB. If the file system reads a file of 2 MB sequentially, how many buffer cache hits occur assuming once loaded, blocks are reused once?
512
128
256
64
An NVMe device supports 250,000 IOPS with an average latency of 20 μs per I/O operation. How many operations can it perform per second?
50,000
200,000
250,000
500,000
If AWS EFS charges $0.30 per GB per month and you use 500 GB for 3 months, what is your total storage cost?
$45
$50
$75
$90
A system uses LRU page replacement. The reference string is: 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7. If the number of frames is 3, how many page faults will occur?
11
10
9
8
A process has a working set size of 4 pages and currently allocated 3 frames. If the page-fault frequency is high, what should be the minimum number of frames allocated to reduce thrashing?
2
3
4
5
A program has 5 dynamically linked libraries each of 12 KB. If only 3 libraries are loaded dynamically at runtime, what is the total dynamic memory used for libraries?
36 KB
60 KB
48 KB
72 KB
A system has 4 processes and 3 resources of type A. Given the allocation: P1: 1, P2: 1, P3: 1, P4: 0 All request 1 more. Can the system detect deadlock?
Yes, deadlock detected
No deadlock
Circular wait not possible
Insufficient data
If 5 processes are deadlocked and all hold 1 resource and wait for 1 more, how many processes must be preempted to break the deadlock?
1
2
4
5
A dynamic storage system uses a buddy system. The total free memory is 1024 KB. If a request of 140 KB arrives, what is the size of the allocated block?
128 KB
256 KB
512 KB
1024 KB
A system has 512 MB RAM. 4 processes with sizes 100 MB, 120 MB, 130 MB, and 140 MB are swapped in. How much memory remains free?
22 MB
32 MB
12 MB
42 MB
Using contiguous allocation, if memory blocks of 60 KB, 200 KB, 300 KB are free, and a process requests 250 KB, which block is allocated under first-fit and best-fit?
300 KB for both
300 KB and 200 KB
200 KB and 300 KB
200 KB for both
A binary semaphore S = 1 is used by 3 threads. If two threads call P(S) simultaneously, how many enter the critical section?
0
1
2
3
A system has a 24-bit logical address and a page size of 4 KB. Calculate the number of bits for page number and offset.
12 bits page, 12 bits offset
14 bits page, 10 bits offset
10 bits page, 14 bits offset
8 bits page, 16 bits offset
Calculate the number of pages in a logical address space of 16 MB with a page size of 2 KB.
8192
4096
16384
2048
A segmented system has 32 segments, each divided into 8 pages. If page size is 512 bytes, calculate total logical address space.
128 KB
64 KB
512 KB
256 KB
Logical address format has 5 bits for segment number, 4 bits for page number, and 8 bits for offset. What is the maximum logical address space size?
512 KB
128 KB
64 KB
256 KB
In a deadlock recovery strategy, if preempting one process releases 3 resources and 2 other processes need only 1 each to complete, how many total can complete post-preemption?
1
2
3
0
If page size is 1 KB and physical memory has 256 frames, calculate number of bits for physical address.
8 bits
10 bits
12 bits
16 bits
Effective access time is calculated with memory access = 100 ns, page fault service time = 20 ms, page fault rate = 0.002. What is the effective access time?
41,000 ns
20,200 ns
200,100 ns
120,000 ns
A bounded buffer of size 6 has 2 items. Producer produces 3 and consumer consumes 1. How many items now?
4
5
6
3
Reference string: 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2 with 4 frames, using FIFO, how many page faults occur?
9
10
11
12
A process has a working set size of 5 pages but currently allocated 3 frames. What is the minimum number of frames needed to avoid thrashing?
3
4
5
6
Calculate page fault rate if total memory access time is 150 ns, memory access = 100 ns, page fault service = 10 ms.
0.005
0.01
0.02
0.015
If Available = (2, 1), Allocation = (2, 1), Max = (3, 2) for P1, what is Need vector?
(1, 1)
(5, 3)
(1, 2)
(0, 1)
Deadlock can occur if which condition is not violated?
Hold and Wait
Circular Wait
Mutual Exclusion
All of the above
Disk queue: 120, 10, 60, 80, 50, 90, head at 50, SCAN algorithm moving towards 0. Total head movement?
170
210
230
240
Disk has 8000 cylinders. Requests at 1000, 4000, 3500, 7000, 2000. Current head at 3000, using SSTF, total head movement?
6000
5500
5000
6500
Disk transfer rate is 100 MB/s and average seek time is 4 ms. Calculate the average access time for 4 KB block.
4.1 ms
4.04 ms
4.5 ms
5 ms
