0
0
HLDsystem_design~20 mins

The CAP theorem in HLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
CAP Theorem Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding CAP Theorem Trade-offs

In a distributed system, which two properties can be guaranteed simultaneously according to the CAP theorem?

AConsistency and Availability
BConsistency and Partition Tolerance
CAvailability and Partition Tolerance
DConsistency, Availability, and Partition Tolerance
Attempts:
2 left
💡 Hint

Remember, the CAP theorem states you can only have two out of three properties at the same time.

Architecture
intermediate
2:00remaining
Designing for Availability in CAP Theorem

You are designing a distributed database that must remain available during network partitions but can tolerate eventual consistency. Which CAP properties does your design prioritize?

AAvailability and Partition Tolerance
BConsistency and Partition Tolerance
CConsistency and Availability
DOnly Availability
Attempts:
2 left
💡 Hint

Think about which property is relaxed to keep the system available during partitions.

scaling
advanced
2:00remaining
Scaling a Distributed System with CAP Constraints

You have a distributed system that must scale globally with strong consistency guarantees. What is the main challenge you will face according to the CAP theorem?

AScaling without any network partitions
BEnsuring partition tolerance without consistency loss
CMaintaining availability during network partitions
DAvoiding consistency issues by sacrificing partition tolerance
Attempts:
2 left
💡 Hint

Think about what happens when network partitions occur and you want strong consistency.

tradeoff
advanced
2:00remaining
Choosing Between Consistency and Availability

In a banking application requiring accurate account balances, which CAP property should be prioritized during network partitions?

AConsistency over Availability
BAvailability over Consistency
CPartition Tolerance over both
DNeither Consistency nor Availability
Attempts:
2 left
💡 Hint

Consider the importance of accurate data in financial transactions.

estimation
expert
3:00remaining
Estimating Impact of Network Partitions on System Availability

A distributed system has 5 nodes across different regions. Network partitions occur randomly with a 1% chance per hour. If the system prioritizes consistency and partition tolerance, what is the expected availability impact over 24 hours?

AApproximately 50% downtime due to frequent partitions
BApproximately 1% downtime as partitions are rare and availability is prioritized
CNo downtime because partition tolerance ensures availability
DApproximately 24% downtime due to unavailability during partitions
Attempts:
2 left
💡 Hint

Calculate downtime based on partition probability and availability trade-offs.