0
0
HLDsystem_design~20 mins

Consistency models (strong, eventual) in HLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Consistency Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Strong Consistency
In a distributed database with strong consistency, what guarantee does the system provide when a client reads data after a write operation?
AThe client always reads the most recent write, ensuring no stale data is returned.
BThe client may read stale data if the write has not propagated to all replicas yet.
CThe client reads data from a random replica without any ordering guarantees.
DThe client reads data only from the primary node, ignoring replicas.
Attempts:
2 left
💡 Hint
Think about what 'strong consistency' means for read-after-write behavior.
🧠 Conceptual
intermediate
2:00remaining
Eventual Consistency Behavior
In an eventually consistent system, what is true about the data read by clients immediately after a write operation?
AClients always read the latest write immediately after it happens.
BClients might read stale data temporarily, but all replicas will converge eventually.
CClients cannot read data until all replicas confirm the write.
DClients read data only from the replica that processed the write.
Attempts:
2 left
💡 Hint
Consider what 'eventual' means in terms of data synchronization over time.
Architecture
advanced
2:30remaining
Designing a System for Strong Consistency
Which architectural component is essential to ensure strong consistency in a distributed key-value store?
AA caching layer that serves stale data for faster reads.
BA background process that asynchronously syncs replicas after writes.
CA load balancer that directs reads to any available replica.
DA consensus protocol like Paxos or Raft to coordinate writes across replicas.
Attempts:
2 left
💡 Hint
Think about how replicas agree on the order of writes.
scaling
advanced
2:30remaining
Scaling Eventual Consistency Systems
What is a common tradeoff when scaling an eventually consistent distributed database to many replicas?
ATemporary data inconsistency across replicas during replication delays.
BIncreased write latency due to synchronous replication to all replicas.
CReduced read throughput because all reads must go to the primary node.
DComplete data loss risk if one replica fails.
Attempts:
2 left
💡 Hint
Consider what happens when many replicas update asynchronously.
tradeoff
expert
3:00remaining
Choosing Consistency Models for a Global Application
A global social media platform wants to balance user experience and data correctness. Which consistency model should it choose and why?
AStrong consistency only for writes, eventual consistency for reads.
BStrong consistency to ensure all users see the exact same data immediately, sacrificing latency.
CEventual consistency to provide low latency and availability, accepting temporary stale data.
DNo consistency guarantees to maximize throughput and ignore data correctness.
Attempts:
2 left
💡 Hint
Think about user experience in a global system with many users and locations.