CS FundamentalsVery hardGATE CS (PYQ pattern)

Single resource type, 5 processes. Allocation: 2, 2, 0, 1, 4. Maximum: 3, 3, 8, 2, 6. Available = 3. The state is safe. What is the largest number of units that P2 can request at this moment (within its remaining need) and have granted by the Banker's algorithm?

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

Correct answer: C. 2

Try each request size k: grant it virtually, subtract from Available, and run the safety check. The largest k that still leaves a safe sequence is 2; requests above it are within Need and Available but lead to an unsafe state.

More Operating Systems questions

Exams that ask this topic