State Management · Middle · Question 73 of 75
What is the difference between optimistic and pessimistic updates?
- ✓Correct answer: Optimistic updates change the UI before the server confirms and roll back on error; pessimistic updates wait for the response
- 2Optimistic updates never contact the server
- 3Pessimistic updates are always faster
Explanation
Optimistic UI feels instant for likely-successful actions (likes, toggles). Use pessimistic updates for payments and anything hard to undo.