wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Operating System Concepts Quiz

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.

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?

a)

turn = 2; P2

b)

turn = 0; P0

c)

turn = 1; P1

d)

turn = 3; Invalid

2.

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?

a)

full = 1, empty = 4

b)

full = 3, empty = 2

c)

full = 1, empty = 5

d)

full = 2, empty = 3

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?

a)

2

b)

4

c)

6

d)

8

4.

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?

a)

Yes

b)

No

c)

Depends on resource release

d)

Not enough info

5.

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?

a)

1

b)

2

c)

3

d)

0

6.

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?

a)

10 KB

b)

18 KB

c)

8 KB

d)

20 KB

7.

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?

a)

17 bits, 128 KB

b)

17 bits, 256 KB

c)

17 bits, 64 KB

d)

20 bits, 256 KB

8.

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?

a)

8 bits

b)

10 bits

c)

12 bits

d)

16 bits

9.

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.

a)

109,900 ns

b)

10,000 ns

c)

199 ns

d)

10,100 ns

10.

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?

a)

Yes, safe sequence exists

b)

No, system is unsafe

c)

Cannot determine

d)

Depends on future request

11.

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?

a)

1024

b)

512

c)

256

d)

2048

12.

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?

a)

52 KB

b)

64 KB

c)

16 MB

d)

48 KB

13.

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?

a)

512

b)

128

c)

256

d)

64

14.

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?

a)

50,000

b)

200,000

c)

250,000

d)

500,000

15.

If AWS EFS charges $0.30 per GB per month and you use 500 GB for 3 months, what is your total storage cost?

a)

$45

b)

$50

c)

$75

d)

$90

16.

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?

a)

11

b)

10

c)

9

d)

8

17.

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?

a)

2

b)

3

c)

4

d)

5

18.

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?

a)

36 KB

b)

60 KB

c)

48 KB

d)

72 KB

19.

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?

a)

Yes, deadlock detected

b)

No deadlock

c)

Circular wait not possible

d)

Insufficient data

20.

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?

a)

1

b)

2

c)

4

d)

5

21.

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?

a)

128 KB

b)

256 KB

c)

512 KB

d)

1024 KB

22.

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?

a)

22 MB

b)

32 MB

c)

12 MB

d)

42 MB

23.

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?

a)

300 KB for both

b)

300 KB and 200 KB

c)

200 KB and 300 KB

d)

200 KB for both

24.

A binary semaphore S = 1 is used by 3 threads. If two threads call P(S) simultaneously, how many enter the critical section?

a)

0

b)

1

c)

2

d)

3

25.

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.

a)

12 bits page, 12 bits offset

b)

14 bits page, 10 bits offset

c)

10 bits page, 14 bits offset

d)

8 bits page, 16 bits offset

26.

Calculate the number of pages in a logical address space of 16 MB with a page size of 2 KB.

a)

8192

b)

4096

c)

16384

d)

2048

27.

A segmented system has 32 segments, each divided into 8 pages. If page size is 512 bytes, calculate total logical address space.

a)

128 KB

b)

64 KB

c)

512 KB

d)

256 KB

28.

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?

a)

512 KB

b)

128 KB

c)

64 KB

d)

256 KB

29.

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?

a)

1

b)

2

c)

3

d)

0

30.

If page size is 1 KB and physical memory has 256 frames, calculate number of bits for physical address.

a)

8 bits

b)

10 bits

c)

12 bits

d)

16 bits

31.

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?

a)

41,000 ns

b)

20,200 ns

c)

200,100 ns

d)

120,000 ns

32.

A bounded buffer of size 6 has 2 items. Producer produces 3 and consumer consumes 1. How many items now?

a)

4

b)

5

c)

6

d)

3

33.

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?

a)

9

b)

10

c)

11

d)

12

34.

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?

a)

3

b)

4

c)

5

d)

6

35.

Calculate page fault rate if total memory access time is 150 ns, memory access = 100 ns, page fault service = 10 ms.

a)

0.005

b)

0.01

c)

0.02

d)

0.015

36.

If Available = (2, 1), Allocation = (2, 1), Max = (3, 2) for P1, what is Need vector?

a)

(1, 1)

b)

(5, 3)

c)

(1, 2)

d)

(0, 1)

37.

Deadlock can occur if which condition is not violated?

a)

Hold and Wait

b)

Circular Wait

c)

Mutual Exclusion

d)

All of the above

38.

Disk queue: 120, 10, 60, 80, 50, 90, head at 50, SCAN algorithm moving towards 0. Total head movement?

a)

170

b)

210

c)

230

d)

240

39.

Disk has 8000 cylinders. Requests at 1000, 4000, 3500, 7000, 2000. Current head at 3000, using SSTF, total head movement?

a)

6000

b)

5500

c)

5000

d)

6500

40.

Disk transfer rate is 100 MB/s and average seek time is 4 ms. Calculate the average access time for 4 KB block.

a)

4.1 ms

b)

4.04 ms

c)

4.5 ms

d)

5 ms