Knowing Need = Max - Allocation is easy. Marks are lost when deciding whether a request preserves safety or an order can finish. Two errors cost most of those marks: adding a waiting process's allocation back to Work, and comparing a need vector against availability by total rather than component by component. Every question below is a previous-year paper question, from ISRO, UGC NET, DSSSB and MPPSC papers set between 2005 and 2025.
Banker's Algorithm MCQs on purpose and applicability
Deadlock prevention breaks one of the four necessary conditions outright. Banker's algorithm leaves all four possible and instead admits only the allocations that still leave a safe sequence. The Operating System MCQs collection holds the sets for the rest of the syllabus.
Question 1 (ISRO 2017)
What problem is solved by Dijkstra banker’s algorithm?
A. Cache coherence
B. Mutual exclusion
C. Deadlock recovery
D. Deadlock avoidance
Answer: D. Deadlock avoidance. The algorithm grants a tentative allocation only if the result is safe. It acts before deadlock, unlike recovery, and does not solve mutual exclusion.
Question 2 (UGC NET 2005)
Bankers algorithm is for
A. Dead lock Prevention
B. Dead lock Avoidance
C. Dead lock Detection
D. Dead lock creation
Answer: B. Dead lock Avoidance. Prevention restricts requests, whereas avoidance checks whether one preserves a safe completion order. Detection examines the system after allocation.
Question 3 (DSSSB 2018)
Which of the following will be used for a system having multiple instances of a resource type?
A. Resource-allocation graph
B. Banker's algorithm
C. Wait-for graph
D. Semaphores
Answer: B. Banker's algorithm. It tracks vectors and matrices for multiple instances of each resource type. Resource-allocation-graph cycles prove deadlock only in the single-instance case; wait-for graphs and semaphores have other roles.
Banker's safety algorithm complexity MCQ
Set Work = Available, find an unfinished process with Need[i] <= Work, then add its allocation. If none exists before all finish, the test fails.
Question 4 (UGC NET 2016)
Consider a system which have ‘n’ number of processes and ‘m’ number of resource types. The time complexity of the safety algorithm, which checks whether a system is in safe state or not, is of the order of :
A. O(mn)
B. O(m² n²)
C. O(m² n)
D. O(mn²)
Answer: D. O(mn²). The worst case takes n rounds × n process scans × m resource comparisons = mn². Comparing Need with Work is linear in m, so no second m factor appears.
Deadlock-free resource-count MCQs
For one resource type, maximum demands M1, M2, ..., Mn require Σ(Mi - 1) + 1 units to guarantee a finisher. This is not a general Banker's matrix formula.
Question 5 (ISRO 2014)
What is the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes P1, P2 and P3 running in a system whose maximum demand for the resources of same type are 3, 4, and 5 respectively.
A. 3
B. 7
C. 9
D. 10
Answer: D. 10. Substitution gives (3 - 1) + (4 - 1) + (5 - 1) + 1 = 2 + 3 + 4 + 1 = 10. With 9 units, the processes could hold 2, 3 and 4 while each waits for one more, so 10 is minimal.
Question 6 (UGC NET 2018)
Suppose a system has 12 instances of some resource with 𝑛 processes competing for that resource. Each process may require 4 instances of the resources. The maximum value of 𝑛 for which the system never enters into deadlock is
A. 3
B. 4
C. 5
D. 6
Answer: A. 3. Apply n(4 - 1) + 1 <= 12, giving 3n + 1 <= 12 and n <= 11/3; the largest integer is 3. Four processes need 4 × 3 + 1 = 13 units, more than 12.
Single-resource safe-state and safe-sequence MCQs
Keep maximum, allocation, need and Work separate. Only a finisher's allocation returns to Work.
Question 7 (UGC NET 2015)
Consider a system with twelve magnetic tape drives and three processes 𝑃1, 𝑃2 and 𝑃3. process 𝑃1 requires maximum ten tape drives, process 𝑃2 may need as many as four tape drives and 𝑃3 may need upto nine tape drives. Suppose that at time 𝑡1, process 𝑃1 is holding five tape drives, process 𝑃2 is holding two tape drives and process 𝑃3 is holding three tape drives, At time 𝑡1, system is in:
A. safe state
B. unsafe state
C. deadlocked state
D. starvation state
Answer: B. unsafe state. Allocation is 5 + 2 + 3 = 10, so Work = 12 - 10 = 2; P1, P2 and P3 need 5, 2 and 6. P2 finishes and releases 2, making Work = 4, but neither remaining process can finish. Unsafe does not mean already deadlocked.
Question 8 (ISRO 2011)
A total of 9 units of a resource type available, and given the safe state shown below, which of the following sequence will be a safe state?
Process | Used | Max |
|---|---|---|
P1 | 2 | 7 |
P2 | 1 | 6 |
P3 | 2 | 5 |
P4 | 1 | 4 |
A. (P4, P1, P3, P2)
B. (P4, P2, P1, P3)
C. (P4, P2, P3, P1)
D. (P3, P1, P2, P4)
Answer: D. (P3, P1, P2, P4). Six allocated units leave Work = 3; the needs are 5, 5, 3 and 3. Option D produces 3 -> 5 -> 7 -> 8 -> 9; option A fails after P4 because Work = 4 cannot meet P1's need of 5.
Multi-resource Banker's state-classification MCQs
Need[i] <= Work must hold component-wise. One resource cannot cover another's shortage.
Question 9 (ISRO 2013)
Consider the following process and resource requirement of each process.
Process | Type 1 Used | Type 1 Max | Type 2 Used | Type 2 Max |
|---|---|---|---|---|
P1 | 1 | 2 | 1 | 3 |
P2 | 1 | 3 | 1 | 2 |
P3 | 2 | 4 | 1 | 4 |
Predict the state of this system, assuming that there are a total of 5 instances of resource type 1 and 4 instances of resource type 2.
A. Can go to safe or unsafe state based on sequence
B. Safe state
C. Unsafe state
D. Deadlock state
Answer: C. Unsafe state. Allocation is (4, 3), so Work = (5, 4) - (4, 3) = (1, 1). The Need vectors are P1 = (1, 2), P2 = (2, 1) and P3 = (2, 3); none is at most (1, 1) component-wise, so the safety test cannot start.
Question 10 (ISRO 2025)
Consider a system with 3 processes P0 to P2 and 3 resource types A, B, and C. Resource type A has 10 instances, resource type B has 5 instances and resource type C has 7 instances. The following snapshot of the system has been taken at a given time.
Process | Allocation A | Allocation B | Allocation C | Max A | Max B | Max C |
|---|---|---|---|---|---|---|
P0 | 0 | 1 | 0 | 7 | 5 | 3 |
P1 | 2 | 0 | 0 | 3 | 2 | 2 |
P2 | 3 | 0 | 2 | 9 | 0 | 2 |
Available (A, B, C) = (5, 4, 5).
Which of the following is true?
A. The system is not in safe state
B. The system is blocked
C. The system is in safe state
D. The request cannot be granted to all the processes
Answer: C. The system is in safe state. Need is P0 = (7,4,3), P1 = (1,2,2) and P2 = (6,0,0), with Work = (5,4,5). P1 makes Work (7,4,5), P0 makes it (7,5,5), and P2 finishes. Thus P1 -> P0 -> P2 is safe.
Banker's request-grant and safe-sequence MCQs
Check Request <= Need and Request <= Available, allocate tentatively, then rerun safety. Those checks alone do not justify a grant.
Question 11 (DSSSB 2018)
Consider a system with ten units of resource R and three processes: X, Y, and Z. The maximum resource requirement and current allocation to these processes are as follows:
X | Y | Z | |
|---|---|---|---|
Maximum Resource Requirement | 8 | 7 | 5 |
Current Allocation | 4 | 1 | 3 |
Now, consider the following resource requests:
(i) X makes a request for 2 resource units
(ii) Y makes a request for 2 resource units
(iii) Z makes a request for 2 resource units
For the system to be in safe state, which of the following must be granted?
A. Only request (i) must be granted
B. Only requests (i) and (ii) must be granted
C. Only request (iii) must be granted
D. Only request (ii) must be granted
Answer: C. Only request (iii) must be granted. Initially Available = 10 - (4 + 1 + 3) = 2; needs are X = 4, Y = 6, Z = 2. Giving 2 units to X or Y leaves Work = 0 with no finisher. Giving them to Z makes its need 0 and permits Z, X, Y.
Question 12 (MPPSC 2025)
A system has 5 processes [P0 – P4] and 3 resource types (A, B, C). The current allocation and maximum need matrices are:
Allocation = [[0, 1, 0], [2, 0, 0], [3, 0, 2], [2, 1, 1], [0, 0, 2]]
Max = [[7, 5, 3], [3, 2, 2], [9, 0, 2], [2, 2, 2], [4, 3, 3]]
Available = [3, 3, 2]
Which of the following sequence is not a safe sequence according to the Banker’s algorithm?
A. P1 → P3 → P4 → P0 → P2
B. P3 → P1 → P4 → P0 → P2
C. P4 → P3 → P1 → P0 → P2
D. P1 → P4 → P3 → P2 → P0
Answer: C. P4 → P3 → P1 → P0 → P2. The Need matrix is [[7,4,3], [1,2,2], [6,0,0], [0,1,1], [4,3,1]]. Option C starts with P4, needing (4,3,1) when Available is (3,3,2), so it cannot begin. Options A, B and D pass after each listed Work update.
Banker's Algorithm MCQ revision: the short version and next step
Point | Revision line |
|---|---|
Purpose | Avoidance |
State test | A safe sequence exists |
Safety complexity |
|
Identical-resource guarantee |
|
Request rule | Pretend to allocate, then retest safety |
Rebuild weak concepts through Operating Systems for GATE: Deadlocks, Scheduling, Memory. Retry missed questions later, writing one Work update per completion.
GATE Guidance by Sanchit Sir provides a structured OS sequence. The GATE CS Exam Preparation category leads to the next subject or test.




