NEW
Font size
S
M
L
XL
Worksheetsosss
Total questions: 79
Worksheet time: 40mins
Name
Class
Date
1.
What is a "Race Condition"?
a)
Several processes access and manipulate different data concurrently and the outcome depends on the particular order in which the access takes place.
b)
Several processes access and manipulate the same data concurrently and the outcome depends on the particular order in which the access takes place.
c)
Several processes read the same data concurrently and the outcome depends on the particular order in which the access takes place.
d)
Several processes access and manipulate the same data concurrently and the outcome depends on the particular speed of execution.
2.
Which code section accesses shared resources and requires protection?
a)
Remainder Section
b)
Entry Section
c)
Critical Section
d)
Exit Section
3.
What is the function of a Semaphore's wait() operation?
a)
while (S <= 0) ; S--;
b)
while (S < 0) ; S--;
c)
while (S <= 0) ; S++;
d)
while (S > 0) ; S--;
4.
Which synchronization tool requires the process to "own" the lock to release it?
a)
Semaphore
b)
Monitor
c)
Mutex Locks
d)
Spinlock
5.
What is the "Dining Philosophers" problem about?
a)
Allocate resources in a deadlock-free and starvation-free manner.
b)
Allocate resources in a deadlock-free and interrupt-free manner.
c)
Allocate resources in a conflict-free and starvation-free manner.
d)
Allocate resources in a fast and efficient manner.
6.
What is an "Atomic Operation"?
a)
The instruction executes as a single, interruptible unit.
b)
The instruction executes as a single, uninterruptible unit.
c)
The instruction executes as multiple, uninterruptible units.
d)
The instruction executes as a single, reversible unit.
7.
What should happen in the "Critical Section"?
a)
The process may be reading common variables only.
b)
The process may be changing common variables, updating a table, writing a file, etc.
c)
The process is waiting to enter the memory.
d)
The process performs non-critical local calculations.
8.
In the Readers-Writers problem, what is the main conflict?
a)
Multiple writers can write at the same time.
b)
Multiple readers can read, but only one writer can access shared data at the same time.
c)
One reader and one writer can access shared data at the same time.
d)
Writers have lower priority than readers.
9.
Which synchronization construct is a high-level abstraction (often part of a programming language)?
a)
Semaphores
b)
Mutex Locks
c)
Monitors
d)
Spinlocks
10.
What is a "Critical Section"?
a)
Entry Section
b)
Remainder Section
c)
Critical Section
d)
Exit Section
11.
What happens if a process calls wait() on a semaphore that is zero?
a)
It will increment the semaphore and proceed.
b)
It will return an error code immediately.
c)
It will busy wait or be placed in a waiting queue.
d)
It will terminate the process.
12.
What is an "Atomic Operation"?
a)
The instruction executes as a single, interruptible unit.
b)
The instruction executes as a single, uninterruptible unit.
c)
The instruction executes as multiple, uninterruptible units.
d)
The instruction executes as a single, reversible unit.
13.
What is a "Semaphore"?
a)
Synchronization tool that provides less sophisticated ways for processes to synchronize.
b)
Synchronization tool that provides more sophisticated ways (than Mutex locks) for processes to synchronize their activities.
c)
Synchronization tool that provides more sophisticated ways (than Monitors) for processes to synchronize.
d)
Synchronization tool that provides simple ways for processes to synchronize.
14.
Which tool is specifically designed for Mutual Exclusion (ownership)?
a)
Counting Semaphore
b)
Monitor
c)
Mutex Locks
d)
Condition Variable
15.
What is "Busy Waiting"?
a)
A process loops continuously in the call to acquire().
b)
A process loops continuously in the call to release().
c)
A process sleeps until an interrupt occurs.
d)
A process yields the CPU to other processes.
16.
Which of the following is a classic software solution for Synchronization?
a)
Banker's Algorithm
b)
Peterson’s Solution
c)
Round Robin
d)
Belady's Solution
17.
What is the primary goal of Synchronization?
a)
To increase CPU utilization.
b)
To ensure orderly execution and maintain data consistency.
c)
To minimize memory usage.
d)
To prevent process termination.
18.
What is a "Monitor" in the context of OS?
a)
A low-level abstraction for synchronization.
b)
A high-level abstraction that provides a convenient and effective mechanism for process synchronization.
c)
A hardware support for synchronization.
d)
A type of semaphore.
19.
What is a "Deadlock"?
a)
Processes are waiting temporarily for an event caused by running processes.
b)
Processes are waiting indefinitely for an event that can be caused by only one of the waiting processes.
c)
Processes are waiting indefinitely for an event caused by the OS.
d)
Processes are running in an infinite loop.
20.
Which of the following is NOT a necessary condition for a Deadlock?
a)
Mutual exclusion
b)
Hold and wait
c)
Starvation
d)
Circular wait
21.
What is "Mutual Exclusion"?
a)
Multiple processes can use a resource simultaneously.
b)
Only one process at a time can use a resource.
c)
Resources are shared freely.
d)
Processes must release resources immediately.
22.
What is a "Spinlock"?
a)
A Mutex lock where the process loops continuously while waiting.
b)
A Mutex lock where the process sleeps while waiting.
c)
A Semaphore that allows negative values.
d)
A Monitor with condition variables.
23.
What is the goal of the Banker’s Algorithm?
a)
Deadlock Detection
b)
Deadlock Prevention
c)
Deadlock Avoidance
d)
Deadlock Recovery
24.
In a Resource Allocation Graph, what does a cycle indicate if resources have single instances?
a)
Possibility of deadlock
b)
No deadlock
c)
Deadlock
d)
Starvation
25.
What is the difference between Starvation and Deadlock?
a)
Deadlock is indefinite blocking; Starvation is temporary.
b)
Deadlock involves waiting for waiting processes; Starvation involves indefinite blocking in a queue.
c)
Deadlock is rare; Starvation is common.
d)
Deadlock involves CPU; Starvation involves Memory.
26.
What happens in the "Hold and Wait" deadlock condition?
a)
A process holds a resource and waits for the CPU.
b)
A process holds at least one resource and is waiting to acquire additional resources.
c)
A process holds no resources and waits for a resource.
d)
A process holds all resources and waits for nothing.
27.
How can "Circular Wait" be prevented?
a)
Using preemption.
b)
Requiring processes to hold all resources at start.
c)
Imposing a total ordering of all resource types (increasing order).
d)
Using the Banker's Algorithm.
28.
What is the "Safe Sequence" in deadlock avoidance?
a)
Sequence where Pi can be satisfied by Available + Held by Pj (j > i).
b)
Sequence where Pi can be satisfied by Available + Held by Pj (j < i).
c)
Sequence where resources are requested in increasing order.
d)
Sequence where processes are terminated one by one.
29.
What happens if a Resource Allocation Graph contains no cycles?
a)
Deadlock is inevitable.
b)
No deadlock.
c)
Deadlock is possible.
d)
Starvation is certain.
30.
What is the main problem in the "Dining Philosophers" problem?
a)
Starvation
b)
Deadlock and starvation
c)
Deadlock
d)
Livelock
31.
Which of the following is NOT a necessary condition for Deadlock?
a)
Mutual exclusion
b)
Hold and wait
c)
Preemption
d)
Circular wait
32.
What is the "Banker’s Algorithm" primarily used for?
a)
Deadlock detection
b)
Deadlock avoidance
c)
Deadlock prevention
d)
Deadlock recovery
33.
What is a "Safe State"?
a)
A state with deadlock
b)
A state if there exists a sequence where resources can be satisfied
c)
A state with cycles
d)
An unsafe state
34.
What is "Circular Wait"?
a)
There exists a set where threads wait linearly.
b)
There exists a set {T₀, T₁, ..., Tₙ} of waiting threads such that T₀ is waiting for a resource that is held by T₁, ..., Tₙ is waiting for a resource held by T₀.
c)
Threads release resources in circle.
d)
No waiting cycle.
35.
What is "Hold and Wait"?
a)
A thread waiting without holding resources.
b)
A thread holding at least one resource is waiting to acquire additional resources held by other threads.
c)
A thread releasing while waiting.
d)
A thread preempting while holding.
36.
What is "Livelock"?
a)
Threads are deadlocked.
b)
Threads are busy but not progressing, constantly changing state.
c)
Threads are sleeping.
d)
Threads are progressing.
37.
Which method is a strategy to recover from a deadlock?
a)
Deadlock Avoidance
b)
Process Termination or Resource Preemption
c)
Deadlock prevention
d)
Banker's Algorithm
38.
If a Resource Allocation Graph has NO cycles, what can we conclude?
a)
Deadlock
b)
No deadlock
c)
Possibility of deadlock
d)
Livelock
39.
the order of the resource allocation policy?
a)
Random order
b)
Total ordering of all resource types
c)
Linear order
d)
No order
40.
What is a "Safe Sequence"?
a)
A sequence leading to deadlock.
b)
A sequence where resources can be allocated safely.
c)
A cycle sequence.
d)
An unsafe sequence.
41.
Why is Deadlock handling difficult?
a)
Easy to detect.
b)
Deadlocks may be infrequent but costly.
c)
Always occurs.
d)
No cost.
42.
What is the main cause of External Fragmentation?
a)
Total memory space is insufficient.
b)
Total memory space exists but is not contiguous.
c)
Allocated memory is larger than requested.
d)
Pages are too small.
43.
How can External Fragmentation be typically resolved?
a)
By Compaction or Paging.
b)
By Segmentation.
c)
By increasing page size.
d)
By Best-fit allocation.
44.
Which allocation method is most likely to cause External Fragmentation?
a)
Paging
b)
First-fit and Best-fit
c)
Contiguous Memory Allocation
d)
Worst-fit only
45.
What is the main function of the Memory Management Unit (MMU)?
a)
Maps physical to virtual address at run time.
b)
Maps virtual to physical address at run time.
c)
Maps virtual to physical address at compile time.
d)
Checks for page faults only.
46.
Which memory allocation strategy picks the smallest hole that is big enough?
a)
First-fit
b)
Worst-fit
c)
Best-fit
d)
Next-fit
47.
Which hardware component maps logical addresses to physical addresses?
a)
CPU
b)
Memory Management Unit (MMU)
c)
TLB
d)
Page Table
48.
Which type of fragmentation does Segmentation typically suffer from?
a)
Internal Fragmentation
b)
External Fragmentation
c)
No Fragmentation
d)
Page Faults
49.
What is the main purpose of "Compaction" in memory management?
a)
To reduce internal fragmentation.
b)
To shuffle memory contents to place all free memory together.
c)
To increase the size of the page table.
d)
To swap processes to disk.
50.
What is "Locality of Reference"?
a)
Process migrates from one locality to another.
b)
Process stays in one locality.
c)
Process has no locality.
d)
Locality is global.
51.
Which type of address is generated by the CPU?
a)
Physical address
b)
Logical address (Virtual address)
c)
Absolute address
d)
Relocatable address
52.
Which hardware registers are used to protect memory (prevent a process from accessing another's memory)?
a)
Stack and heap registers
b)
Base and limit registers
c)
Page and frame registers
d)
TLB registers
53.
What is a "Memory-Mapped File"?
a)
Allows file I/O to be treated as routine memory access.
b)
Stores the entire file in the CPU registers.
c)
Is a file that stores the page table.
d)
Prevents paging to the backing store.
54.
What does the "Working Set" of a process refer to?
a)
The set of all pages a process owns.
b)
The set of pages in the most recent Δ page references.
c)
The set of pages currently in the TLB.
d)
The set of pages modified (dirty).
55.
Which mechanism allows a program to run even if it is larger than the physical RAM?
a)
Cache Memory
b)
Virtual Memory
c)
Segmentation
d)
Direct Memory Access
56.
In Paging, what is the relationship between a "Page" and a "Frame"?
a)
Page is larger than Frame.
b)
Frame is larger than Page.
c)
They are blocks of same size.
d)
They have no size relationship.
57.
What is "Demand Paging"?
a)
Bring all pages into memory at start.
b)
Bring a page into memory only when it is needed.
c)
Bring pages into memory before they are requested (prefetch).
d)
Keep pages in memory forever.
58.
What is the default page size in Windows 10?
a)
2KB
b)
4KB
c)
8KB
d)
16KB
59.
In the LRU (Least Recently Used) page replacement algorithm, which page is selected to be swapped out?
a)
Page not used for the longest period of time.
b)
Page used most recently.
c)
Page brought in earliest (FIFO).
d)
Page used most frequently.
60.
What is the benefit of "Dynamic Loading"?
a)
Routine is loaded before called.
b)
Routine is not loaded until it is called.
c)
All routines loaded at start.
d)
No loading needed.
61.
Where is the "Swap Space" usually located?
a)
Primary memory
b)
Secondary memory
c)
Virtual memory
d)
Cache
62.
What is a "Binary Semaphore" effectively the same as?
a)
Counting semaphore
b)
Mutex lock
c)
Monitor
d)
Condition variable
63.
How does Peterson’s Solution achieve synchronization?
a)
Using hardware.
b)
Using software with turn and flag.
c)
Using semaphores.
d)
Using monitors.
64.
In Paging, what is the result of increasing the page size?
a)
Decrease internal fragmentation.
b)
May lead to increase in internal fragmentation.
c)
No effect on fragmentation.
d)
Increase external fragmentation.
65.
What is "Thrashing" in a virtual memory system?
a)
A process is busy executing instructions.
b)
A process is busy swapping pages in and out.
c)
A process is waiting for user input.
d)
A process is utilizing 100% CPU.
66.
What is a "Page Fault"?
a)
Reference to a page not in memory (traps to OS).
b)
Reference to an invalid address.
c)
Error in the Page Table.
d)
Failure of the TLB.
67.
Which algorithm is used to solve the "Belady’s Anomaly"?
a)
FIFO
b)
Stack algorithms (like LRU/OPT)
c)
Round Robin
d)
Second Chance
68.
What does the "Dirty Bit" in a page table indicate?
a)
The page is invalid.
b)
The page has been modified.
c)
The page is read-only.
d)
The page is not in the TLB.
69.
What is the main advantage of Virtual Memory?
a)
Physical address space larger than logical.
b)
Logical address space can be much larger than physical address space.
c)
No need for memory.
d)
Reduces fragmentation.
70.
What is "Internal Fragmentation"?
a)
Total memory is split into small holes.
b)
Allocated memory is slightly larger than requested.
c)
Memory is swapped to disk.
d)
Pages are lost.
71.
What is the purpose of the Translation Lookaside Buffer (TLB)?
a)
To store the entire Page Table.
b)
To speed up address translation (hardware cache).
c)
To handle page faults.
d)
To store the Dirty Bits.
72.
Which concept allows a parent and child process to share memory until one modifies it?
a)
Demand Paging
b)
Copy-on-Write (COW)
c)
Memory Mapping
d)
Shared Memory
73.
What is "Thrashing"?
a)
Process executing efficiently.
b)
A process is busy swapping pages in and out.
c)
Process waiting for IO.
d)
Process using CPU 100%.
74.
What does the "Valid/Invalid" bit in a page table indicate?
a)
Read/Write permission.
b)
In-memory vs Not-in-memory.
c)
Admin vs User access.
d)
Dirty vs Clean.
75.
What is "Swapping"?
a)
Paging in memory.
b)
A process can be swapped temporarily out of memory to a backing store.
c)
Allocating frames.
d)
Compacting memory.
76.
Where is the Page Table usually stored?
a)
Secondary memory
b)
Physical memory
c)
Virtual memory
d)
Cache
77.
What is the main benefit of Shared Pages?
a)
One copy of read-write code.
b)
One copy of read-only (reentrant) code shared among processes.
c)
Multiple copies of code.
d)
No sharing.
78.
Which register points to the beginning of the page table?
a)
Instruction Pointer
b)
Stack Pointer
c)
Page-table base register (PTBR)
d)
Base Register
79.
What is the main advantage of Virtual Memory?
a)
Physical larger than logical.
b)
Logical address space can be much larger than physical address space.
c)
Reduces memory usage.
d)
Increases fragmentation.
Reset
