Sample questions
Question 1Easy
A precedence (serialization) graph is used to test for:
- Cascading rollback
- Lossless decomposition
- Conflict serializability
- Deadlock between two transactions
Answer: C. Conflict serializability
Explanation
Nodes are transactions and edges are conflicting operation pairs; an acyclic graph means the schedule is conflict serializable.
Step-by-step solution
- One node per transaction.
- An edge Ti -> Tj for each conflict where Ti's operation comes first.
- If the graph is acyclic, the schedule is conflict serializable.
Why the other options are wrong
- A. Cascading rollback is checked by looking at reads of uncommitted data.
- B. Lossless decomposition uses FDs, not schedules.
- D. Deadlocks are found with a wait-for graph.
Tip: Precedence graph = serializability; wait-for graph = deadlock.
Question 2Easy
A serial schedule is one in which:
- All operations are reads
- Transactions run one after another without interleaving
- Transactions run in timestamp order with interleaving
- No transaction commits
Answer: B. Transactions run one after another without interleaving
Explanation
Serial schedules are always correct (consistent) but give no concurrency.
Step-by-step solution
- In a serial schedule, one transaction runs all its operations before the next starts.
- No operations from different transactions are interleaved.
Why the other options are wrong
- A. A serial schedule can contain writes.
- C. Any interleaving makes it non-serial, even in timestamp order.
- D. Transactions in a serial schedule normally commit.
Tip: Serial means no interleaving at all.
Question 3Easy
Two operations from different transactions conflict when they access the same data item and:
- Both are writes only
- At least one of them is a write
- They belong to the same transaction
- Both are reads
Answer: B. At least one of them is a write
Explanation
Read-read pairs never conflict; read-write, write-read and write-write pairs do, because swapping them can change the result.
Step-by-step solution
- Operations conflict if they are from different transactions,
- access the same data item,
- and at least one of them is a write.
Why the other options are wrong
- A. Read-write pairs also conflict.
- C. Operations within one transaction never conflict in this sense.
- D. Two reads never conflict.
Tip: RR = no conflict; RW, WR, WW = conflict.
Question 4Easy
A schedule is called serializable when it is:
- Executed on a single CPU
- Free of reads
- Always deadlock-free
- Equivalent to some serial schedule
Answer: D. Equivalent to some serial schedule
Explanation
Serializability is the standard correctness criterion for concurrent schedules.
Step-by-step solution
- An interleaved schedule may still produce the same result as running the transactions one at a time.
- If it is equivalent to some serial order, it is serializable.
- Equivalence is usually checked as conflict or view equivalence.
Why the other options are wrong
- A. A single CPU can still interleave operations unsafely.
- B. Serializable schedules can contain reads.
- C. Serializability is about the final effect, not about deadlock.
Tip: Serializable means equivalent to some serial schedule.
Question 5Medium
Classify the following schedule (Ci means Ti commits):
W1(A) R2(A) C2 C1
- Recoverable but not cascadeless
- Cascadeless but not strict
- Not recoverable
- Strict
Answer: C. Not recoverable
Explanation
T2 reads A written by the uncommitted T1 and commits before T1, so if T1 aborts, T2's committed result is based on data that never existed.
Step-by-step solution
- T2 reads A written by T1 (uncommitted).
- T2 commits before T1 commits.
- If T1 later aborted, T2's commit could not be undone: not recoverable.
Why the other options are wrong
- A. Recoverable needs T1 to commit before T2.
- B. Cascadeless forbids reading uncommitted data.
- D. Strict is even stronger than cascadeless.
Tip: Reader commits before writer = not recoverable.
Question 6Medium
The following schedule is conflict serializable. Which serial order is it equivalent to?
R1(A) R2(B) W1(A) R3(A) W2(B) W3(A) R1(B)
- T3 -> T1 -> T2
- T1 -> T3 -> T2
- T2 -> T3 -> T1
- T2 -> T1 -> T3
Answer: D. T2 -> T1 -> T3
Explanation
Precedence graph edges: T1 -> T3, T2 -> T1. The only topological order is T2 -> T1 -> T3.
Step-by-step solution
- On A: R1(A), W1(A) come before R3(A), W3(A): T1 -> T3.
- On B: W2(B) before R1(B): T2 -> T1.
- Edges T2 -> T1 -> T3: the order is T2, T1, T3.
Why the other options are wrong
- A. T1 must come before T3.
- B. T2 must come before T1.
- C. T1 must come before T3.
Tip: Topological sort of the precedence graph = serial order.
Question 7Medium
Is the following schedule conflict serializable?
R1(A) W1(A) R2(A) W2(A) R1(B) W1(B) R2(B) W2(B)
- Yes
- No
- Only if T1 commits first
- It is view serializable only
Answer: A. Yes
Explanation
Precedence graph edges: T1 -> T2. The graph is acyclic, so the schedule is conflict-equivalent to T1 -> T2.
Step-by-step solution
- Every conflict on A has T1 first (R1, W1 before R2, W2).
- Every conflict on B also has T1 first.
- Only edge T1 -> T2: conflict serializable as T1, T2.
Why the other options are wrong
- B. There is no edge from T2 to T1.
- C. Serializability does not depend on commit order.
- D. It is conflict serializable, which also makes it view serializable.
Tip: All edges one way = serializable.
Question 8Medium
Is the following schedule conflict serializable?
R1(A) R2(A) W1(A) W2(A)
- Yes
- No
- Only if T1 commits first
- It is view serializable only
Answer: B. No
Explanation
Precedence graph edges: T1 -> T2, T2 -> T1. The graph has a cycle, so the schedule is not conflict serializable.
Step-by-step solution
- R1(A) before W2(A): T1 -> T2.
- R2(A) before W1(A): T2 -> T1.
- Cycle, so not conflict serializable.
Why the other options are wrong
- A. The precedence graph has a cycle.
- C. Commit order does not change conflict serializability.
- D. Both transactions read the initial A, which no serial order allows, so it is not view serializable either.
Tip: R1 R2 W1 W2 on one item = lost update = not serializable.
Question 9Hard
Which statement about strict schedules is correct?
- Strict schedules are always serial
- Every strict schedule is cascadeless, and every cascadeless schedule is recoverable
- Every recoverable schedule is strict
- Cascadeless schedules may be non-recoverable, because they still permit reads of uncommitted data
Answer: B. Every strict schedule is cascadeless, and every cascadeless schedule is recoverable
Explanation
Strict ⊂ cascadeless ⊂ recoverable. Strict 2PL produces strict schedules.
Step-by-step solution
- Recoverable: a transaction commits only after the transactions it read from commit.
- Cascadeless: transactions read only committed data, which also makes them recoverable.
- Strict: no read or overwrite of uncommitted data, which also makes them cascadeless.
- So strict is a subset of cascadeless, which is a subset of recoverable.
Why the other options are wrong
- A. Strict schedules can interleave; they only restrict access to uncommitted data.
- C. Recoverable schedules may still allow dirty reads, so they need not be strict.
- D. Cascadeless schedules forbid reading uncommitted data.
Tip: Strict is a subset of Cascadeless, which is a subset of Recoverable.
Question 10Hard
Classify the following schedule (Ci means Ti commits):
W1(A) W2(A) C1 C2
- Strict
- Recoverable but not cascadeless
- Not recoverable
- Cascadeless but not strict
Answer: D. Cascadeless but not strict
Explanation
No transaction reads uncommitted data, so it is cascadeless; but T2 overwrites A while T1 is still uncommitted, so it is not strict.
Step-by-step solution
- No transaction reads uncommitted data, so it is cascadeless (and recoverable).
- W2(A) overwrites A written by uncommitted T1.
- Strict forbids reading or writing an item until its last writer commits, so it is not strict.
Why the other options are wrong
- A. T2 writes A before T1 commits.
- B. There is no read of uncommitted data.
- C. There are no reads at all, so recoverability holds.
Tip: Strict = no read or write of uncommitted data.
Practise all 25 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →