All Questions
Dealing With Contention easy

Two users try to 'Like' a post (Count=10) at the exact same moment. Both read 10. Both add 1 and write 11. What is the result?

  1. A Count = 12 (Correct)
  2. B Count = 11 (One like is lost)
  3. C Count = 10
  4. D Database error.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions