🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Banker's Algorithm in Practice: questions with answers

15 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. In the safety algorithm, what is added to Work when a process can finish?
  2. Q2. A process asks for more than its Need. What does the resource-request algorithm do?
  3. Q3. Request ≤ Available, but after the pretend allocation no safe sequence exists. What happens?
  4. Q4. In the example, why could P3's request (1, 0, 1) be granted?
  5. Q5. At the end of a successful safety check, Work should equal:
  6. Q6. Which matrix does deadlock DETECTION use in place of Need?
  7. Q7. 3 processes each need at most 4 instances of a resource. What is the minimum number of instances that guarantees no deadlock?
  8. Q8. A system has 6 tape drives and each process needs 2. What is the largest number of processes that can never deadlock?
  9. Q9. What does this print? (code)
  10. Q10. Why is the Banker's algorithm rarely used in general-purpose operating systems?
  11. Q11. A system has (10, 5, 7) instances in total, and the processes hold (7, 2, 5) between them. What is Available?
  12. Q12. P2 asks for (1, 0, 0). It is within its Need, but Available is (0, 1, 1). What does the resource-request algorithm do?
  13. Q13. 4 processes each need at most 3 instances of a resource. What is the minimum number of instances that guarantees no deadlock?
  14. Q14. What does this print? (code)
  15. Q15. In the detection example, after P2 requests one more C, which process can still finish?