Interview questions
Predict the result, find the errors, explain the solution. You can read the questions without an account.
Topic: Transactions and locksReset all
24 questions
Will
FOR UPDATE SKIP LOCKEDwork withoutBEGIN?Predict the resultMiddleCan you use
COUNT(*)withFOR UPDATE?Predict the resultSeniorFind the bugs: long-running transactions
Find the errorsMiddleWhat is a transaction, and what does ACID mean?
ExplainJuniorWhy can't the application see your
UPDATE?ExplainJuniorWhat is a deadlock, and how can you prevent one?
ExplainJuniorWhat is MVCC, and why does PostgreSQL need
VACUUM?ExplainSeniorWhich sessions are idle with an open transaction?
Predict the resultJuniorFind the bugs: selecting orders for processing
Find the errorsMiddleWhat happens when you lock an order and its line items?
Predict the resultMiddleFind the bugs: paid orders with no items
Find the errorsJuniorHow does
autocommitaffect multiple statements?ExplainJuniorWhy use
SAVEPOINTand partial rollbacks?ExplainMiddleWhy does InnoDB use
gap locksandnext-key locks?ExplainSeniorHow does
Sagadiffer from two-phase commit?ExplainSenior