0
0
DBMS Theoryknowledge~20 mins

CAP theorem in DBMS Theory - 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 database system, which two properties can be guaranteed simultaneously according to the CAP theorem?

AConsistency and Availability
BConsistency, Availability, and Partition Tolerance
CConsistency and Partition Tolerance
DAvailability and Partition Tolerance
Attempts:
2 left
💡 Hint

Remember, network failures can happen, so the system must handle partitions.

Architecture
intermediate
2:00remaining
Design choice under network partition

You are designing a distributed key-value store. During a network partition, you want the system to always respond to client requests even if some nodes are unreachable. Which CAP property are you prioritizing?

AAvailability
BConsistency
CPartition Tolerance
DNeither Consistency nor Availability
Attempts:
2 left
💡 Hint

Think about whether the system responds or waits during partitions.

scaling
advanced
2:30remaining
Scaling a distributed system with CAP constraints

You want to scale a distributed database across multiple data centers worldwide. Network partitions are common. To maintain strong consistency, what is the likely impact on system availability?

AAvailability remains unaffected by consistency choices.
BAvailability will increase because more nodes can serve requests independently.
CAvailability will increase because partitions are ignored.
DAvailability will decrease because the system waits for all nodes to agree.
Attempts:
2 left
💡 Hint

Strong consistency requires coordination among nodes.

tradeoff
advanced
2:30remaining
Choosing CAP properties for a social media feed

A social media platform wants to ensure users always see the latest posts but can tolerate some delays during network issues. Which CAP property combination best fits this need?

AConsistency and Partition Tolerance
BAvailability and Partition Tolerance
CConsistency and Availability
DOnly Availability
Attempts:
2 left
💡 Hint

Latest posts mean strong consistency is important.

estimation
expert
3:00remaining
Estimating system behavior under CAP constraints

A distributed database replicates data across 5 nodes. During a network partition, 2 nodes become unreachable. If the system prioritizes availability over consistency, how many nodes must respond to a read request to maintain availability?

AAt least 2 nodes must respond
BOnly 1 node must respond
CAll 5 nodes must respond
DAt least 3 nodes must respond
Attempts:
2 left
💡 Hint

Availability means responding even if some nodes are down.