CS Atlas GATE 2027
Operating Systems course
0 / 58 complete

Operating Systems/Phase 4 · Deadlock

Checkpoint CP-4 · Item 34 of 58

Phase 4 Checkpoint (15 questions)

Read at your own pace. Try the questions before opening the answers.

On this page

Phase 4

Phase 4 Checkpoint: 15 questions on deadlock.

15 questions · 22 marks · 40 minutes. Negative marking on MCQ only: −1/3 mark for a wrong 1-mark MCQ, −2/3 for a wrong 2-mark MCQ. No negative marking for MSQ or NAT; MSQ has no partial credit.

Q1 · MSQ · 2 mark(s) — Conditions

Which of these, if prevented, make deadlock impossible?

  1. (A) Context switching
  2. (B) Circular wait
  3. (C) Hold and wait
  4. (D) Mutual exclusion

Q2 · MCQ · 1 mark(s) — RAG

An edge from process P to resource R in a resource-allocation graph means:

  1. (A) R is free
  2. (B) P has finished with R
  3. (C) P is waiting for R
  4. (D) P holds R

Q3 · MCQ · 2 mark(s) — Multiple instances

A RAG contains a cycle and one of the resources in it has 2 instances. Then:

  1. (A) deadlock is impossible
  2. (B) the RAG is wrong
  3. (C) deadlock is certain
  4. (D) deadlock is possible but not certain

Q4 · MCQ · 1 mark(s) — Starvation

A low-priority process never gets the CPU because higher-priority processes keep arriving. This is:

  1. (A) a race condition
  2. (B) circular wait
  3. (C) starvation
  4. (D) deadlock

Q5 · NAT · 1 mark(s) — Need

Max (7, 5, 3), Allocation (0, 1, 0). Need of resource B?

Numerical answer: ________

Q6 · NAT · 2 mark(s) — Banker's

13 units of one resource. A holds 6 (max 9), B holds 2 (max 5), C holds 2 (max 8). How many units are free after the first process of the safe sequence A, B, C finishes?

Numerical answer: ________

Q7 · MCQ · 2 mark(s) — Banker's

In the same state, B asks for 1 more unit. What happens?

  1. (A) Granted: still safe
  2. (B) B waits: unsafe
  3. (C) B waits: not enough free units
  4. (D) Error: exceeds B's maximum

Q8 · MCQ · 1 mark(s) — Unsafe

Which is true?

  1. (A) Safe and unsafe mean the same
  2. (B) Every deadlocked state is unsafe
  3. (C) Safe states can be deadlocked
  4. (D) Every unsafe state is a deadlock

Q9 · MCQ · 1 mark(s) — Prevention

Numbering resource types and requesting them only in increasing order breaks:

  1. (A) circular wait
  2. (B) no pre-emption
  3. (C) mutual exclusion
  4. (D) hold and wait

Q10 · NAT · 2 mark(s) — Safety

Worked example of Lesson 4.1.2 (Available (2,1,2)): after P3 and P1 finish, what is the total of the three Work values?

Numerical answer: ________

Q11 · NAT · 1 mark(s) — Minimum resources

Processes need at most 2, 3, 4 and 5 units of one resource. Minimum units for which deadlock is impossible?

Numerical answer: ________

Q12 · NAT · 2 mark(s) — Maximum processes

A system has 16 units; each process needs at most 4. Largest number of processes that is guaranteed deadlock-free?

Numerical answer: ________

Q13 · NAT · 2 mark(s) — Detection

Lesson 4.1.3's detection example (no changes): in what position does P4 finish in the order the algorithm finds (scanning from P0 each pass)?

Numerical answer: ________

Q14 · MCQ · 1 mark(s) — Recovery

When recovering by pre-emption, what must the OS avoid?

  1. (A) Choosing a victim
  2. (B) Re-running detection
  3. (C) Always picking the same process as the victim
  4. (D) Rolling back the victim

Q15 · MCQ · 1 mark(s) — Strategy

Most general-purpose operating systems handle deadlock by:

  1. (A) wait-for graphs on every request
  2. (B) ignoring it (ostrich approach)
  3. (C) the banker's algorithm
  4. (D) requesting all resources at start

✓Answer Vault

Try the questions first. Open when you are ready to check.

🔐 Open the Answer Vault

Q1 Answer: (B) (C) (D) · 2 mark(s)

Breaking any of the four conditions works.

  • (A) is wrong: Not a deadlock condition.

Re-read: Lesson 4.1.1 — Deadlock: the four conditions and resource-allocation graphs

Q2 Answer: (C) · 1 mark(s)

Request edge.

  • (A) is wrong: Free instances have no edge.
  • (B) is wrong: No edge then.
  • (D) is wrong: That is R → P.

Re-read: Lesson 4.1.1 — Deadlock: the four conditions and resource-allocation graphs

Q3 Answer: (D) · 2 mark(s)

Another holder may finish and release.

  • (A) is wrong: It may still be deadlocked.
  • (B) is wrong: Such graphs are valid.
  • (C) is wrong: Only with single instances.

Re-read: Lesson 4.1.1 — Deadlock: the four conditions and resource-allocation graphs

Q4 Answer: (C) · 1 mark(s)

It waits indefinitely while others run.

  • (A) is wrong: Not about shared data.
  • (B) is wrong: No cycle.
  • (D) is wrong: Others are not waiting for it.

Re-read: Lesson 4.1.1 — Deadlock: the four conditions and resource-allocation graphs

Q5 Answer: 4 · 1 mark(s)

5 − 1.

Re-read: Lesson 4.1.2 — Prevention and avoidance: safe states and the banker's algorithm

Q6 Answer: 9 · 2 mark(s)

Free 3; A takes 3 more, then returns all 9.

Re-read: Lesson 4.1.2 — Prevention and avoidance: safe states and the banker's algorithm

Q7 Answer: (A) · 2 mark(s)

Free 2; B's need 2 fits; B, then A, then C finish.

  • (B) is wrong: A safe sequence exists.
  • (C) is wrong: 1 ≤ 3.
  • (D) is wrong: 3 ≤ 5.

Re-read: Lesson 4.1.2 — Prevention and avoidance: safe states and the banker's algorithm

Q8 Answer: (B) · 1 mark(s)

A deadlock leaves no way for those processes to finish.

  • (A) is wrong: No.
  • (C) is wrong: Safe means a finishing order exists.
  • (D) is wrong: Unsafe only risks deadlock.

Re-read: Lesson 4.1.2 — Prevention and avoidance: safe states and the banker's algorithm

Q9 Answer: (A) · 1 mark(s)

No cycle can form.

  • (B) is wrong: Nothing is taken away.
  • (C) is wrong: Still exclusive.
  • (D) is wrong: Processes still hold and wait.

Re-read: Lesson 4.1.2 — Prevention and avoidance: safe states and the banker's algorithm

Q10 Answer: 10 · 2 mark(s)

Work (4, 2, 4).

Re-read: Lesson 4.1.2 — Prevention and avoidance: safe states and the banker's algorithm

Q11 Answer: 11 · 1 mark(s)

1 + 2 + 3 + 4 + 1.

Re-read: Lesson 4.1.3 — Detection, recovery, and the minimum-resources formula

Q12 Answer: 5 · 2 mark(s)

3n + 1 ≤ 16.

Re-read: Lesson 4.1.3 — Detection, recovery, and the minimum-resources formula

Q13 Answer: 5 · 2 mark(s)

P3, then P0, P1, P2, P4.

Re-read: Lesson 4.1.3 — Detection, recovery, and the minimum-resources formula

Q14 Answer: (C) · 1 mark(s)

That process would starve.

  • (A) is wrong: A victim is needed.
  • (B) is wrong: Running detection again is fine.
  • (D) is wrong: Rollback is part of the method.

Re-read: Lesson 4.1.3 — Detection, recovery, and the minimum-resources formula

Q15 Answer: (B) · 1 mark(s)

Deadlocks are rare and checks are costly.

  • (A) is wrong: Too costly.
  • (C) is wrong: Too costly and needs maxima.
  • (D) is wrong: Wastes resources.

Re-read: Lesson 4.1.3 — Detection, recovery, and the minimum-resources formula

Ready for the next idea?

Mark this item complete when you’ve finished reading and working through it.