Bird
0
0

You are designing a UI system where multiple components observe a shared data model. Which design choice best improves scalability and reduces UI lag when data changes rapidly?

hard📝 Trade-off Q15 of 15
LLD - Design — Chess Game
You are designing a UI system where multiple components observe a shared data model. Which design choice best improves scalability and reduces UI lag when data changes rapidly?
ANotify each observer immediately on every data change without batching
BUpdate UI components only on user interaction, ignoring data changes
CUse polling in each UI component to check data changes periodically
DUse the Observer pattern with batched notifications to observers
Step-by-Step Solution
Solution:
  1. Step 1: Consider rapid data changes impact

    Immediate notifications on every change can cause UI lag and overload.
  2. Step 2: Evaluate design choices for scalability

    Batching notifications reduces update frequency, improving performance and scalability.
  3. Step 3: Compare with alternatives

    Polling wastes resources; ignoring data changes harms UX.
  4. Final Answer:

    Use the Observer pattern with batched notifications to observers -> Option D
  5. Quick Check:

    Batching notifications = scalable, smooth UI [OK]
Quick Trick: Batch updates to observers reduce lag and improve scalability [OK]
Common Mistakes:
  • Not batching causes UI lag
  • Polling wastes CPU and delays updates
  • Ignoring data changes breaks UI sync

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes