0
0
HLDsystem_design~20 mins

Database replication (master-slave) in HLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Master of Master-Slave Replication
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the primary role of the master in a master-slave database replication setup?
In a master-slave replication system, what is the main responsibility of the master database?
ATo handle all write operations and propagate changes to slaves
BTo serve read requests only without accepting writes
CTo synchronize data from slaves to itself
DTo act as a backup server without processing any requests
Attempts:
2 left
💡 Hint
Think about which database handles data changes first.
Architecture
intermediate
1:30remaining
Which component ensures data consistency between master and slaves in replication?
In a master-slave replication architecture, which mechanism is primarily used to keep slave databases consistent with the master?
AManual synchronization by database administrators
BPeriodic full database snapshots sent to slaves
CSlaves independently polling the master for changes
DBinary log shipping from master to slaves
Attempts:
2 left
💡 Hint
Consider how changes are recorded and sent continuously.
scaling
advanced
2:00remaining
How does master-slave replication improve read scalability?
In a system using master-slave replication, how is read scalability typically improved?
ABy increasing the number of write operations on the master
BBy making slaves handle write requests to reduce master load
CBy directing read requests to multiple slave databases to distribute load
DBy disabling replication during peak read times
Attempts:
2 left
💡 Hint
Think about how slaves can help with read requests.
tradeoff
advanced
2:00remaining
What is a common tradeoff when using asynchronous master-slave replication?
Choosing asynchronous replication between master and slaves often leads to which tradeoff?
APotential data loss on master failure due to lag in replication
BSlower write performance on the master due to waiting for slaves
CSlaves becoming write masters automatically
DIncreased network traffic from slaves to master
Attempts:
2 left
💡 Hint
Consider what happens if the master crashes before slaves catch up.
estimation
expert
2:30remaining
Estimate the maximum number of slaves supported given network bandwidth constraints
A master database generates 100 MB of binary log data per minute. Each slave requires a dedicated network connection with 10 MB/min bandwidth to receive replication data without lag. What is the maximum number of slaves that can be supported without replication delay?
A1 slave
B10 slaves
C50 slaves
D100 slaves
Attempts:
2 left
💡 Hint
Divide total data generated by bandwidth per slave.