CS FundamentalsHardTCS NQT · Infosys interview pattern

Three processes share a single resource type with identical instances. Their maximum needs are 3, 4 and 5 instances. What is the minimum number of instances that guarantees deadlock can never occur?

  1. A. 12
  2. B. 9
  3. C. 13
  4. D. 10

Correct answer: D. 10

Worst case: each process holds one less than its maximum, (3 − 1) + (4 − 1) + (5 − 1) = 9, and all are stuck. One more instance lets some process finish and release its holdings, so 9 + 1 = 10. 12 is the total maximum demand, which is more than needed.

More Operating Systems questions

Exams that ask this topic