All quizzesMedium
Distributed Systems — Series 2
Preview — 3 of 10 questions
Two editors read document version 7. The first saves version 8. How should an optimistic update from the second avoid silently overwriting it?
ACompare the version in JavaScript, then issue an unconditional update.
BUpdate only where version is 7 and reject a zero-row result.
CUpdate by document ID and increment the version afterward.
DSleep briefly before saving so the first transaction can finish.
Results are ordered by immutable created_at DESC, id DESC. Which cursor supports deterministic next-page retrieval when timestamps can tie?
AOnly the count of rows shown, used as the next OFFSET.
BThe current wall-clock time, used to filter newer rows.
CThe last row's timestamp and ID, compared as an ordered pair.
DOnly the last row's timestamp, with a strict less-than filter.
An API's clients depend on a string status. The server needs a richer status object. Which rollout preserves existing clients?
AReturn the object only when the server happens to hit a new instance.
BAdd a new field or version and retain the old contract during migration.
CChange the field name and keep the same endpoint without overlap.
DReplace the string immediately and document it in release notes.
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.