Consistency & Consensus for System Design Interview (3): broadcast order

SystemDesign
Tech Wrench
Published in
6 min readJul 7, 2023

--

PREV | HOME | NEXT | System Design Resource List

Don’t forget to get your copy of Designing Data Intensive Applications, the single most important book to read for system design interview prep!

Check out ByteByteGo’s popular System Design Interview Course

Consider signing-up for paid Medium account to access our curated content for system design resources.

Introduction

Consider the following pseudocode snippet


int x = rand() // returns a random integer

if ( x mod 17 == 0) {
x = 25;
}
Grokking Modern System Design for Software Engineers and Managers

The snippet demonstrates two writes to the variable x, the first one assigns a random value to x and the second one executes if x is a multiple of 17. The following is the sequence of reads and writes that occur for the above snippet in case x is a multiple of 17.

We can say that the second write is causally related to the first write. The second write only happens after the first write. In other words, the second write is aware of the first write and the two aren’t concurrent. There…

--

--