IAE Academy

GATE 2025 CS2 Q.27: solution and answer

GATE 2025 · CS2Q.27 · 1 mark · MSQ

An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account attempted simultaneous transfers of Rs. 10000 each from account to account . Both transactions read the same value, Rs. 11000, as the initial balance in and were allowed to go through. was credited Rs. 10000 twice. was debited only once and ended up with a balance of Rs. 1000.

Which of the following properties is/are certain to have been violated by the system?

  1. (A)

    Atomicity

  2. (B)

    Consistency

  3. (C)

    Isolation

  4. (D)

    Durability

See the question in the paper

Answer and solution

ANSWER

Consistency and Isolation are certainly violated: options B and C.

Official answer: B, CSource: Official answer key, GATE 2025 CS2 (IIT Roorkee)

  1. Write the two transfers as . Each one reads , computes , writes , then adds to .

  2. Both read . Each computes and writes . The second write overwrites the first, so one debit is lost. This is a lost update.

  3. Isolation: the final state matches no serial order. In a serial run, the second transaction would read and could not debit again. So the two transactions were not isolated, and Isolation is certainly violated.

  4. Consistency: a transfer must leave the total unchanged. Before, the total is . After, it is . So appeared from nothing, the database reached an invalid state, and Consistency is certainly violated.

  5. Atomicity: nothing says either transaction ran only partly. Each may have executed all its steps, so Atomicity is not certain to be violated.

  6. Durability: no committed update was lost after a failure. The lost debit came from concurrent overwriting, not from a crash, so Durability is not certain to be violated.

  7. Hence the properties certain to be violated are Consistency (B) and Isolation (C).

KEY IDEA

A lost update from two interleaved read-modify-write transactions breaks Isolation (the result matches no serial order). It also breaks the transfer's invariant that the total across A and B stays the same, which is Consistency.

WATCH OUT FOR

Calling this an Atomicity or Durability failure. Both need a partial execution or a crash, and the question gives neither. Only the two violations that follow from the stated balances are certain.

From the GATE 2025 CS2 paper. Every question of this paper · Download the full paper · All 9 Transactions questions, with notes

More Transactions questions