Grokking the Modern Frontend System Design Interview
0% completed
Design a Collaborative Document Editor
Two people open the same document. The first line reads "The launch is on Friday." Ana selects "Friday" and types "Monday". At the same moment, Ben clicks after "The" and types " team".
On each screen, the local edit appears at once and is correct. The difficulty is what each browser does with the other person's edit. Suppose Ana's browser receives "insert ' team' at position 3" and Ben's browser receives "replace characters 17 to 22 with 'Monday'". Ben's copy then applies Ana's change to the wrong characters, because his insert has already moved the word "Friday" five places to the right
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%