Mock Quiz Hub
Dark
Mock Quiz Hub
1
Recent Updates
Added: OS Mid 1 Quiz
Added: OS Mid 2 Quiz
Added: OS Lab 1 Quiz
Check back for more updates!
Time: 00:00
Quiz
Navigate through questions using the controls below
0%
Question 1 of 60
Quiz ID: q1
What is the primary danger of incorrect synchronization in operating systems?
It can cause memory leaks
It can block all processes
It reduces CPU performance
It corrupts file systems
Question 2 of 60
Quiz ID: q2
In the Dining Philosophers problem, how many philosophers are sitting around the table?
Three
Four
Five
Six
Question 3 of 60
Quiz ID: q3
In the Dining Philosophers problem, how many forks does each philosopher need to eat?
One fork
Two forks
Three forks
No forks needed
Question 4 of 60
Quiz ID: q4
Why does philosopher[4] have to be implemented differently from the others in the code example?
It has different eating preferences
It handles the wraparound from fork[4] to fork[0]
It eats faster than the others
It doesn't need to think
Question 5 of 60
Quiz ID: q5
According to the formal definition, deadlock exists among a set of processes when:
All processes are running simultaneously
Every process is waiting for an event that can only be caused by another process in the set
Processes are competing for CPU time
Memory allocation exceeds available RAM
Question 6 of 60
Quiz ID: q6
In the bridge analogy for deadlocks, what represents a resource?
The entire bridge
Each car on the bridge
Each section of the bridge
The traffic lights
Question 7 of 60
Quiz ID: q7
Which of the following is NOT one of the four necessary conditions for deadlock?
Mutual exclusion
Hold and wait
Resource starvation
Circular wait
Question 8 of 60
Quiz ID: q8
The mutual exclusion condition for deadlock states that:
All resources must be shared equally
At least one resource must be held in a non-sharable mode
No process can hold more than one resource
Resources can only be used by one process at a time
Question 9 of 60
Quiz ID: q9
The hold and wait condition requires:
Processes to release all resources before requesting new ones
One process holding one resource and waiting for another resource
All processes to wait for the same resource
Resources to be held indefinitely
Question 10 of 60
Quiz ID: q10
What does the 'no preemption' condition mean in the context of deadlocks?
Resources can be taken away from processes at any time
Resources cannot be preempted (critical sections cannot be aborted externally)
Only high-priority processes can preempt resources
Preemption is handled by the operating system kernel
Question 11 of 60
Quiz ID: q11
The circular wait condition requires:
All processes to wait in a circle
A set of processes where P1 waits for P2, P2 for P3, etc., forming a cycle
Resources to be arranged in a circular queue
Processes to access resources in circular order
Question 12 of 60
Quiz ID: q12
How many of the four deadlock conditions must be present for deadlock to occur?
At least one
At least two
At least three
All four
Question 13 of 60
Quiz ID: q13
What are the two main approaches to dealing with deadlock mentioned in the lecture?
Detection and prevention
Pro-active (prevention) and reactive (detection + corrective action)
Hardware and software solutions
Static and dynamic allocation
Question 14 of 60
Quiz ID: q14
To prevent deadlock by eliminating mutual exclusion, which approach is suggested?
Use only shared resources
Buy more resources, split into pieces, or virtualize to make 'infinite' copies
Implement resource pooling
Use lock-free programming
Question 15 of 60
Quiz ID: q15
How can the hold and wait condition be eliminated?
Allow unlimited resource holding
Implement resource timeouts
Wait on all resources at once (must know in advance)
Use priority-based allocation
Question 16 of 60
Quiz ID: q16
Which is an example of eliminating the no preemption condition?
Using mutex locks
Physical memory virtualized with VM, allowing pages to be taken away
Implementing semaphores
Using critical sections
Question 17 of 60
Quiz ID: q17
What is one way to eliminate the circular wait condition?
Use multiple locks simultaneously
Implement random resource access
Partial ordering of resources
Dynamic resource allocation
Question 18 of 60
Quiz ID: q18
In a resource allocation graph, what do the nodes represent?
Only processes
Only resources
Both processes and resources
System states
Question 19 of 60
Quiz ID: q19
What does a directed edge from Pi to Rj represent in a resource allocation graph?
Pi is holding an instance of Rj
Pi is requesting Rj
Rj is available to Pi
Pi has released Rj
Question 20 of 60
Quiz ID: q20
What does a directed edge from Rj to Pi represent in a resource allocation graph?
Pi is requesting Rj
Pi is holding an instance of Rj
Rj is being released by Pi
Pi is waiting for Rj
Question 21 of 60
Quiz ID: q21
If a resource allocation graph has no cycles, what can be concluded?
Deadlock definitely exists
Deadlock might exist
No deadlock exists
The system is unsafe
Question 22 of 60
Quiz ID: q22
If a resource allocation graph contains a cycle and each resource type has only one instance, what can be concluded?
No deadlock exists
Deadlock might exist
Deadlock definitely exists
The system needs restart
Question 23 of 60
Quiz ID: q23
If a resource allocation graph contains a cycle and some resource types have multiple instances, what can be concluded?
Deadlock definitely exists
No deadlock exists
Maybe deadlock, maybe not
The system is in safe state
Question 24 of 60
Quiz ID: q24
How many approaches are there for dealing with deadlock according to the lecture?
Two
Three
Four
Five
Question 25 of 60
Quiz ID: q25
What is the 'Ostrich Algorithm' approach to deadlock?
Aggressive deadlock prevention
Pretend that deadlock never occurs
Immediate deadlock detection
Resource preemption strategy
Question 26 of 60
Quiz ID: q26
Why might the Ostrich Algorithm be chosen for dealing with deadlocks?
It's the most efficient solution
Deadlocks occur rarely, are difficult to detect, and prevention cost is high
It provides the best user experience
It's required by operating system standards
Question 27 of 60
Quiz ID: q27
What information does deadlock avoidance require in advance?
Process execution time
Memory requirements
What resources will be needed by processes
Network bandwidth needs
Question 28 of 60
Quiz ID: q28
What is the main challenge with deadlock avoidance in practice?
It requires too much memory
It's too slow
Hard to determine all resources needed in advance
It doesn't work with multiple processors
Question 29 of 60
Quiz ID: q29
What is the Banker's Algorithm used for?
Deadlock detection
Deadlock recovery
Deadlock avoidance for resources with multiple units
Deadlock prevention
Question 30 of 60
Quiz ID: q30
In the Banker's Algorithm, what must be stated in advance?
Process priority
Maximum credit claim (resource needs)
Execution time
Memory allocation
Question 31 of 60
Quiz ID: q31
What defines a 'dangerous state' in the Banker's Algorithm?
When all resources are allocated
When no processes are running
A state where a sudden request by any customer for full credit limit could lead to deadlock
When the system is overloaded
Question 32 of 60
Quiz ID: q32
Why is the Banker's Algorithm rarely used in practice?
It's too complex to implement
It doesn't work correctly
Low resource utilization due to maintaining resource surplus
It requires too much memory
Question 33 of 60
Quiz ID: q33
What two algorithms are needed for detection and recovery approach?
Prevention and avoidance algorithms
One to determine deadlock occurrence, another to recover from it
Resource allocation and deallocation algorithms
Process scheduling and memory management algorithms
Question 34 of 60
Quiz ID: q34
How does deadlock detection work?
Monitor CPU usage patterns
Check memory allocation
Traverse the resource graph looking for cycles
Analyze process communication
Question 35 of 60
Quiz ID: q35
Why is deadlock detection expensive?
It requires special hardware
Many processes and resources to traverse
It uses too much memory
It interferes with normal operations
Question 36 of 60
Quiz ID: q36
What factors determine when to invoke the detection algorithm?
System load and user preferences
How often deadlock is likely and how many processes will be affected
Available memory and CPU usage
Network traffic and I/O patterns
Question 37 of 60
Quiz ID: q37
What are the two main options for deadlock recovery?
Restart system or increase resources
Abort processes or preempt resources
Change priorities or reallocate memory
Suspend processes or modify algorithms
Question 38 of 60
Quiz ID: q38
What happens when all deadlocked processes are aborted?
The system becomes more efficient
Resources are permanently lost
Processes need to start over again
The system automatically prevents future deadlocks
Question 39 of 60
Quiz ID: q39
What must the system do when aborting one process at a time for deadlock recovery?
Increase system priority
Allocate more memory
Rerun detection algorithm after each abort
Notify all users
Question 40 of 60
Quiz ID: q40
What must be considered when preempting resources for deadlock recovery?
Network bandwidth and storage space
Process and resource selection, rollback, and preventing starvation
User permissions and security policies
Hardware compatibility and driver support
Question 41 of 60
Quiz ID: q41
According to the deadlock summary, what causes deadlock to occur?
High system load
Processes waiting on each other and cannot make progress
Insufficient memory
Poor process scheduling
Question 42 of 60
Quiz ID: q42
In the context of deadlock prevention, what does 'invalidating mutual exclusion' mean for read-only files?
Files cannot be read simultaneously
Mutual exclusion is not required for sharable resources like read-only files
All files must be write-protected
Only one process can access the file system
Question 43 of 60
Quiz ID: q43
What are the potential problems with preventing hold and wait?
Increased complexity and memory usage
Low resource utilization and possible starvation
Higher CPU overhead and slower execution
Network congestion and I/O bottlenecks
Question 44 of 60
Quiz ID: q44
In deadlock prevention by eliminating no preemption, what happens when a process requests a resource that cannot be immediately allocated?
The process waits indefinitely
The system crashes
All resources currently held by the process are released
The request is denied permanently
Question 45 of 60
Quiz ID: q45
What is required for circular wait prevention through resource ordering?
Resources must be accessed randomly
Each resource must be assigned a unique number and acquired in order
Resources must be shared equally among processes
All resources must be acquired simultaneously
Question 46 of 60
Quiz ID: q46
What additional information does deadlock avoidance require that the system has available?
Current system performance metrics
Some additional a priori information about maximum resource needs
Real-time process execution data
Network topology and bandwidth information
Question 47 of 60
Quiz ID: q47
What defines a safe state in deadlock avoidance?
No processes are currently running
All resources are available
There exists a sequence of all processes where each can complete with available resources plus resources from completed processes
The system is running at minimum capacity
Question 48 of 60
Quiz ID: q48
What is the relationship between safe states and deadlocks?
Safe states can lead to deadlocks
If a system is in safe state, no deadlocks can occur
Safe states and deadlocks are unrelated
Deadlocks always occur in safe states
Question 49 of 60
Quiz ID: q49
What does an unsafe state mean in deadlock avoidance?
Deadlock will definitely occur
The system will crash
There's a possibility of deadlock
All processes must be terminated
Question 50 of 60
Quiz ID: q50
Which algorithms are used for deadlock avoidance depending on resource instances?
First-fit and best-fit algorithms
Round-robin and priority scheduling
Resource-allocation graph for single instance, Banker's Algorithm for multiple instances
FIFO and LIFO algorithms
Question 51 of 60
Quiz ID: q51
In the resource-allocation graph scheme for avoidance, what does a claim edge represent?
A process currently holds a resource
A process may request a resource in the future
A resource is being released
A deadlock has been detected
Question 52 of 60
Quiz ID: q52
In the Banker's Algorithm data structures, what does the Need matrix represent?
Resources currently allocated to processes
Maximum resources each process may request
Resources that may still be needed by each process
Available resources in the system
Question 53 of 60
Quiz ID: q53
In the Safety Algorithm, what does it mean when Finish[i] = true for all i?
All processes are deadlocked
The system is in unsafe state
The system is in safe state
Resources need to be reallocated
Question 54 of 60
Quiz ID: q54
What is the first step in the Resource-Request Algorithm when process Pi makes a request?
Check if resources are available
Allocate resources immediately
Check if Request ≤ Need, otherwise raise error
Run the safety algorithm
Question 55 of 60
Quiz ID: q55
For deadlock detection with single instance of each resource type, what type of graph is maintained?
Resource allocation graph
Wait-for graph
Process dependency graph
System state graph
Question 56 of 60
Quiz ID: q56
What is the time complexity for detecting a cycle in a wait-for graph?
O(n) operations
O(n log n) operations
O(n²) operations
O(n³) operations
Question 57 of 60
Quiz ID: q57
In the deadlock detection algorithm for multiple resource instances, what does it mean if Finish[i] == false for some process Pi?
Process Pi is running normally
Process Pi is in safe state
Process Pi is deadlocked
Process Pi needs more resources
Question 58 of 60
Quiz ID: q58
What factors should be considered when deciding which process to abort for deadlock recovery?
Process creation time and memory usage
Priority, computation time, resources used/needed, number of processes affected, interactive vs batch
Process ID and parent process
CPU usage and I/O patterns
Question 59 of 60
Quiz ID: q59
What are the three main considerations for resource preemption in deadlock recovery?
Speed, efficiency, and reliability
Selecting a victim, rollback, and preventing starvation
Memory, CPU, and I/O resources
User permissions, security, and audit trails
Question 60 of 60
Quiz ID: q60
Which deadlock handling approach focuses on making one of the four necessary conditions impossible?
Deadlock avoidance
Deadlock detection
Deadlock prevention
Deadlock recovery
Quiz Summary
Review your answers before submitting
60
Total Questions
0
Answered
60
Remaining
00:00
Time Spent
Submit Quiz
Back to Questions
Previous
Question 1 of 60
Next
!
Confirm Submission
Cancel
Submit Quiz