Skip to content
Sharp

Data Access · interview question

A bug appears around transactions. What is the strongest first debugging move?

Multiple choiceMediumchapter-11-curatedpremiumdata-accesstransactions
python
with connection:
    connection.execute("INSERT INTO orders(id, subtotal_cents) VALUES (?, ?)", ("ORD-1", 8800))
    connection.execute("INSERT INTO order_events(order_id, event_type) VALUES (?, ?)", ("ORD-1", "CREATED"))
Choose one answer
Answer and explanation

Correct answer

A. Trace one concrete example, inspect the state transitions, and compare them to the intended rule before rewriting anything.

Why

That approach is reliable because it creates evidence. Without a transaction, partial writes can leave the database telling two incompatible stories at once.

Test yourself on Data Access

A free test with instant, explained results. No account needed.

Start free test
All Data Access questions →