Deadlock Basics and Conditions MCQs: 12 Solved Questions with Explanations

Attempt 12 published deadlock MCQs, then use the worked reasoning to check definitions, Coffman conditions, resource bounds, circular waits, and unsafe states.

KnowledgeGate Team

Exam prep & CS education

Updated 13 Sep 20268 min read

Deadlock questions often look like memory tests, but one reversed phrase such as "preemption" instead of "no pre-emption" changes the answer. Understanding deadlock requires the Coffman conditions, single-resource sufficiency, the minimum-resource bound, five-process mutex cycles, the distinction between deadlock and unsafe state, and multi-statement logic. Attempt each item before reading its explanation. Practise policy trade-offs, rollback, and equal-demand prevention formulas in Deadlock Prevention MCQs: 12 Solved Questions; these 12 questions test condition recognition, uneven peak-demand bounds, mutex cycles, and unsafe-state distinctions.

More than 20 Operating System questions on Deadlock Basics and Conditions are available for practice, so learning the reasoning pattern matters more than memorising one answer.

Related reading: Deadlock in OS and Deadlock prevention.

Learn the four-condition test before touching the options

Deadlock means a set of processes cannot proceed because each is waiting for an event or resource release that another process in the set must cause. Its four necessary Coffman conditions are mutual exclusion, hold and wait, no pre-emption, and circular wait. All four must hold for deadlock to be possible, but seeing them as system properties does not prove that every execution is already deadlocked.

Calibrate that test with two single-instance, non-shareable resources. P1 holds R1 and requests R2, while P2 holds R2 and requests R1.

  1. Mutual exclusion holds because each resource has one owner.

  2. Hold and wait holds because each process keeps one resource while requesting another.

  3. No pre-emption holds because the system cannot forcibly take R1 or R2 back.

  4. Circular wait is P1 -> R2 -> P2 -> R1 -> P1.

Require every process to acquire resources only in the order R1 then R2, and that cycle cannot form. This removes one necessary condition and prevents this deadlock.

Questions 1-2: recognise the definition, not a symptom

Question 1

TPSC Assistant Programmer 2025

What is a “deadlock” in an operating system ?

  • (a) A system crash

  • (b) A process waiting for resources forever

  • (c) A memory leak

  • (d) A security breach

Answer: (b) A process waiting for resources forever. An indefinite resource wait is the only option that expresses the deadlock idea. More precisely, deadlock usually involves blocked processes whose waits depend on one another, not a process that is merely slow or waiting temporarily. The other options describe different failure classes.

Question 2

Capgemini 2023

A set of processes is deadlock if __________

  • (a) each process is blocked and will remain so forever

  • (b) each process is terminated

  • (c) all processes are trying to kill each other

  • (d) none of the mentioned

Answer: (a) each process is blocked and will remain so forever. Termination may be used during recovery, but it is not the definition. In the P1/R1/P2/R2 cycle, each process remains blocked because neither can make the release the other needs.

Questions 3-5: identify necessary conditions without reversing the wording

Question 3

Which set of conditions is known as the Coffman conditions for deadlock?

  • (a) Mutual exclusion, hold and wait, preemption, and circular wait

  • (b) Mutual exclusion, no waiting, no preemption, and circular wait

  • (c) Hold and wait, starvation, aging, and mutual exclusion

  • (d) Mutual exclusion, hold and wait, no preemption, and circular wait

Answer: (d) Mutual exclusion, hold and wait, no preemption, and circular wait. This is the only option with all four necessary conditions. Option (a) reverses no preemption, option (b) replaces hold and wait with no waiting, and option (c) mixes scheduling mechanisms with resource conditions. All four conditions make deadlock possible but do not prove that an execution is already deadlocked.

Question 4

UGC NET Computer Science, June 2012

Resources are allocated to the process on non-sharable basis is

  • (a) mutual exclusion

  • (b) hold and wait

  • (c) no pre-emption

  • (d) circular wait

Answer: (a) mutual exclusion. A non-shareable resource can be used by only one process at a time, which is mutual exclusion. Hold and wait describes retaining one resource while requesting another, while circular wait describes a closed dependency chain.

Question 5

Indian Space Research Organization 2013

Which of the following is not a necessary condition for deadlock?

  • (a) Mutual exclusion

  • (b) Reentrancy

  • (c) Hold and wait

  • (d) No pre-emption

Answer: (b) Reentrancy. Circle not, then recall mutual exclusion, hold and wait, no pre-emption, and circular wait. Reentrant code can safely be entered again before an earlier invocation completes. That property is separate from the resource-allocation conditions that permit deadlock.

Questions 6-7: reason about resource sufficiency with actual values

Question 6

Indian Space Research Organization 2016

If the system contains exactly one non-shareable resource instance in total, deadlock among competing processes occurs:

  • (a) when more than two processes compete for that resource instance

  • (b) when exactly two processes compete for that resource instance

  • (c) when exactly one process competes for that resource instance

  • (d) in none of these cases

Answer: (d) in none of these cases. The number of competitors alone does not create circular wait. With exactly one non-shareable resource instance, one process holds it and the others can only wait for that holder. The holder has no second resource to request, so no wait edge can return to a waiting process and close a cycle.

Question 7

BEL 2007

Consider a system having ‘m’ resources of the same type. The resources are shared by 3 processes A,B,C, which have peak time demands of 3,4,6 respectively. The minimum value of ‘m’ that ensures that deadlock will never occur is

  • (a) 11

  • (b) 12

  • (c) 13

  • (d) 14

Answer: (a) 11. In the worst stalled allocation, A holds 3 - 1 = 2, B holds 4 - 1 = 3, and C holds 6 - 1 = 5. Thus, 2 + 3 + 5 = 10 resources can be held while every process still needs one. One extra resource lets at least one process reach its peak, finish, and release its allocation. Therefore the minimum is (3 - 1) + (4 - 1) + (6 - 1) + 1 = 2 + 3 + 5 + 1 = 11.

This is the single-resource-type bound, not a full allocation-matrix problem. Use Banker's Algorithm for GATE to extend the same finish-and-release reasoning to safe sequences.

Question 8: trace a five-process circular wait

Question 8

GATE Computer Science 2000

Let m[0] ... m[4] be mutexes (binary semaphores) and P[0] ... P[4] be processes. Suppose each process P[i] executes the following:

Code
wait(m[i]);
wait(m[(i + 1) mod 5]);

// critical section

release(m[i]);
release(m[(i + 1) mod 5]);

This could cause:
  • (a) Thrashing

  • (b) Deadlock

  • (c) Starvation, but not deadlock

  • (d) None of the above

Answer: (b) Deadlock. Let P[0] acquire m[0], P[1] acquire m[1], P[2] acquire m[2], P[3] acquire m[3], and P[4] acquire m[4]. Next, P[0] waits for m[1], P[1] for m[2], P[2] for m[3], P[3] for m[4], and P[4] for m[0]. This closed cycle means no process reaches either release call. Starvation still permits other processes to progress, while thrashing concerns excessive paging.

Resource-allocation graph for the GATE 2000 trace: five processes each hold one mutex and request the next, forming a closed cycle.

Questions 9-10: separate a deadlocked state from a vulnerable algorithm

Question 9

AMCAT 2024

A process said to be in _____ state, if it was waiting for an event that will never occur.

  • (a) safe

  • (b) unsafe

  • (c) starvation

  • (d) deadlock

Answer: (d) deadlock. "Will never occur" separates a permanent deadlock wait from an ordinary blocked state. Unsafe means the system cannot guarantee a safe completion sequence, but deadlock has not necessarily happened. Starvation is indefinite postponement while the rest of the system can continue making progress.

Question 10

UPPSC Polytechnic Lecturer 2022

The algorithm which is prone to deadlock is:

  • (a) Maekawa's algorithm

  • (b) Ricart–Agrawala's algorithm

  • (c) Lamport’s algorithm

  • (d) None of these

Answer: (a) Maekawa's algorithm. Maekawa's quorum-based mutual-exclusion method can let processes hold some permissions while waiting for others. Incompatible quorum requests can then form a circular wait unless extra deadlock-handling machinery is used. The tested pattern is hold and wait combined with circular wait.

Questions 11-12: handle multi-statement logic and negative wording

Question 11

GATE Computer Science 2022, MSQ

Which of the following statements is/are TRUE with respect to deadlocks?

  • (a) Circular wait is a necessary condition for the formation of deadlock.

  • (b) In a system where each resource has more than one instance, a cycle in its wait-for graph indicates the presence of a deadlock.

  • (c) If the current allocation of resources to processes leads the system to unsafe state, then deadlock will necessarily occur.

  • (d) In the resource-allocation graph of a system, if every edge is an assignment edge, then the system is not in deadlock state.

Answer: (a) and (d). Statement (a) is true because circular wait is necessary. Statement (b) is false because, with multiple resource instances, a cycle alone is not sufficient proof. Statement (c) is false because unsafe means deadlock is possible, not inevitable. Statement (d) is true because assignment edges alone mean there is no outstanding request edge and hence no resource-wait cycle.

Question 12

DSSSB PGT 2021

Which one of these is not a condition for Resource Deadlock?

  • (a) Non-sharable resources

  • (b) Hold-and-wait

  • (c) Preemption

  • (d) Circular wait

Answer: (c) Preemption. Circle not. Non-sharable resources means mutual exclusion, while hold-and-wait and circular wait are stated directly. As in Question 3, preemption is rejected because the necessary condition is no pre-emption.

Score the set and choose the next practice step

Use your misses as a diagnosis, not as a rank prediction.

  • Missed Questions 1-2: rebuild the definition.

  • Missed Questions 3-5 or 12: memorise the exact four conditions and watch the preemption wording.

  • Missed Questions 6-8: practise resource-allocation traces and the single-resource bound.

  • Missed Questions 9-11: revise deadlock versus unsafe state, starvation, and cycle sufficiency.

Do one untimed correction pass, explaining every option aloud, then attempt the set again under time pressure.

The short version

First identify whether the stem asks for a definition, a necessary condition, or sufficient evidence. Next, draw the wait relation. Finally, test whether some process can still finish and release resources.

For the complete Operating System learning sequence, continue with GATE Guidance by Sanchit Sir. If you are ready to mix this topic into mock practice, use GATE Test Series: Mocks & Topic-wise Tests. To compare the wider course catalogue, start at the GATE category.