CS FundamentalsVery hardGATE CS (PYQ pattern)

In a wait-for graph over transactions T1..T7 the edges (Ti waits for Tj) are T1→T2, T2→T3, T3→T1, T3→T4, T4→T5, T5→T4, T6→T3, T2→T7, T7→T6. What is the minimum number of transactions that must be aborted to break every deadlock?

  1. A. 3
  2. B. 1
  3. C. 4
  4. D. 2

Correct answer: D. 2

Cycles: T1→T2→T3→T1; T4→T5→T4; and T2→T7→T6→T3→T1→T2. Aborting T3 breaks the first and third cycles (all pass through T3) but not T4–T5, which needs a second victim: 2 in total.

More DBMS and SQL questions

Exams that ask this topic