Questions: Logical Clocks and Event Ordering

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

Process A sends a message at local Lamport clock value 5, and process B receives it when its own clock reads 3. After the receive, B updates its clock. Then B executes another local event. What is B's clock value after that local event?

A4 — B just increments from 3.
B6 — B sets its clock to max(3, 5) = 5, then increments to 6 after the receive, then increments again to 7... wait, the question asks after the local event following receive.
C7 — B sets clock to max(3, 5) + 1 = 6 on receive, then increments to 7 on the next local event.
D5 — B adopts the sender's timestamp to stay synchronized.
Question 2 Multiple Choice

Two events have Lamport clock values 10 (event X) and 15 (event Y). What can you reliably conclude about their causal relationship?

AX happened-before Y, because 10 < 15.
BX and Y are concurrent, because their clock values differ by 5.
CIf X happened-before Y, then clock(X) < clock(Y) — but clock(X) < clock(Y) does not prove X happened-before Y; they may be concurrent.
DNothing can be said — Lamport clocks are unreliable for ordering events.
Question 3 True / False

If event A has a strictly smaller Lamport timestamp than event B, then A is expected to have happened-before B.

TTrue
FFalse
Question 4 True / False

Logical clocks are designed to detect and track the 'happens-before' causal relationship between distributed events, not to measure elapsed physical time.

TTrue
FFalse
Question 5 Short Answer

Why is wall-clock time insufficient for ordering events in a distributed system, and what specific property do logical clocks provide instead?

Think about your answer, then reveal below.