Q#1: A deadlock in DBMS occurs when:
(A) Two or more transactions wait indefinitely for resources held by each other
(B) A transaction completes successfully
(C) Database is consistent
(D) A transaction rolls back voluntarily
Answer: (A) Two or more transactions wait indefinitely for resources held by each other
Q#2: Which of the following is a necessary condition for deadlock?
(A) Mutual exclusion
(B) Hold and wait
(C) No preemption
(D) Circular wait
Answer: (D) Circular wait
Q#3: Mutual exclusion means:
(A) Only one transaction can use a resource at a time
(B) Transactions are executed in parallel
(C) Resources can be shared freely
(D) Transactions are rolled back
Answer: (A) Only one transaction can use a resource at a time
Q#4: Hold and wait condition means:
(A) A transaction holds at least one resource and waits for others
(B) Transaction releases all resources before waiting
(C) Transactions never wait
(D) Transactions are serial
Answer: (A) A transaction holds at least one resource and waits for others
Q#5: No preemption means:
(A) A resource cannot be forcibly taken from a transaction
(B) Transaction can be terminated anytime
(C) Database is read-only
(D) Transactions are committed automatically
Answer: (A) A resource cannot be forcibly taken from a transaction
Q#6: Circular wait means:
(A) A set of transactions are waiting for each other in a circular chain
(B) Transactions execute sequentially
(C) Transaction holds all resources
(D) Transaction is rolled back
Answer: (A) A set of transactions are waiting for each other in a circular chain
Q#7: Which of the following is a deadlock prevention method?
(A) Resource ordering
(B) Wait-die scheme
(C) Wound-wait scheme
(D) All of the above
Answer: (D) All of the above
Q#8: In wait-die scheme:
(A) Older transaction waits, younger transaction dies
(B) Younger transaction waits, older dies
(C) Both wait indefinitely
(D) Both are rolled back
Answer: (A) Older transaction waits, younger transaction dies
Q#9: In wound-wait scheme:
(A) Older transaction preempts younger transaction, forcing it to rollback
(B) Younger transaction preempts older transaction
(C) Both wait indefinitely
(D) Transactions are committed automatically
Answer: (A) Older transaction preempts younger transaction, forcing it to rollback
Q#10: Deadlock can also be handled by:
(A) Deadlock detection and recovery
(B) Ignoring deadlocks
(C) Encryption
(D) Normalization
Answer: (A) Deadlock detection and recovery
Q#11: Wait-for graph is used for:
(A) Detecting deadlocks
(B) Committing transactions
(C) Locking database
(D) Updating schema
Answer: (A) Detecting deadlocks
Q#12: A cycle in wait-for graph indicates:
(A) Deadlock
(B) Commit
(C) Rollback
(D) No deadlock
Answer: (A) Deadlock
Q#13: Recovery from deadlock can be done by:
(A) Transaction termination
(B) Resource preemption
(C) Rollback
(D) All of the above
Answer: (D) All of the above
Q#14: Choosing a victim for deadlock recovery usually involves:
(A) Selecting transaction with lowest cost of rollback
(B) Selecting the oldest transaction
(C) Selecting the newest transaction
(D) Selecting all transactions
Answer: (A) Selecting transaction with lowest cost of rollback
Q#15: Deadlock avoidance uses:
(A) Resource allocation algorithms
(B) Random execution
(C) Serial execution only
(D) Encryption
Answer: (A) Resource allocation algorithms
Q#16: Banker’s algorithm is used for:
(A) Deadlock avoidance
(B) Deadlock detection
(C) Deadlock prevention
(D) Recovery
Answer: (A) Deadlock avoidance
Q#17: Starvation occurs when:
(A) A transaction waits indefinitely due to resource allocation policy
(B) Transaction commits
(C) Transaction rolls back
(D) No deadlock exists
Answer: (A) A transaction waits indefinitely due to resource allocation policy
Q#18: Preemptive scheduling can help in:
(A) Deadlock prevention
(B) Deadlock detection
(C) Deadlock recovery
(D) None
Answer: (A) Deadlock prevention
Q#19: Non-preemptive resources increase the chance of:
(A) Deadlock
(B) Commit
(C) Rollback
(D) Isolation
Answer: (A) Deadlock
Q#20: Deadlock detection is preferred when:
(A) Resources are allocated dynamically and deadlocks are rare
(B) Resources are static
(C) Transactions are serial
(D) No rollback is allowed
Answer: (A) Resources are allocated dynamically and deadlocks are rare
Q#21: Deadlock prevention can increase:
(A) Transaction waiting time
(B) Resource utilization
(C) Database size
(D) Redundancy
Answer: (A) Transaction waiting time
Q#22: Deadlock detection algorithm is usually run:
(A) Periodically
(B) Continuously
(C) Never
(D) Only at commit
Answer: (A) Periodically
Q#23: Safe state in deadlock avoidance means:
(A) There exists a sequence of transactions that can complete without deadlock
(B) Deadlock has occurred
(C) Transaction must rollback
(D) Resource is free
Answer: (A) There exists a sequence of transactions that can complete without deadlock
Q#24: Unsafe state may lead to:
(A) Deadlock
(B) Commit
(C) Isolation
(D) Normalization
Answer: (A) Deadlock
Q#25: In resource allocation graph, nodes represent:
(A) Transactions and resources
(B) Tables only
(C) Columns only
(D) Locks only
Answer: (A) Transactions and resources
Q#26: In resource allocation graph, edges represent:
(A) Requests or assignments
(B) Locks
(C) Commit points
(D) Atomic operations
Answer: (A) Requests or assignments
Q#27: Deadlock prevention avoids circular wait by:
(A) Imposing resource ordering
(B) Allowing random resource allocation
(C) Ignoring resource order
(D) None
Answer: (A) Imposing resource ordering
Q#28: Time-out method can be used for:
(A) Deadlock handling
(B) Recovery
(C) Encryption
(D) Normalization
Answer: (A) Deadlock handling
Q#29: Deadlock recovery may involve:
(A) Rolling back one or more transactions
(B) Killing all transactions
(C) Freezing database
(D) Ignoring deadlock
Answer: (A) Rolling back one or more transactions
Q#30: Main goal of deadlock management is:
(A) Ensure smooth execution of transactions without indefinite waiting
(B) Increase redundancy
(C) Encrypt data
(D) Normalize tables
Answer: (A) Ensure smooth execution of transactions without indefinite waiting