Database Administrator
Design a setup for a critical database that needs to survive losing a server or a whole data center with minimal data loss. What trade-offs do you make?
What the interviewer is looking for
- This question tests high availability & replication. Understands replication modes, failover, replica lag and the trade-off between consistency and availability.
- Strong answers: Replicas across zones or sites, synchronous versus asynchronous trade-offs on latency and data loss, automated failover with fencing, and tested procedures.
- Likely follow-up: How do you avoid two servers both thinking they are the primary?
Another way it may be asked: Your company's orders database must keep running even if a building loses power. How would you set that up?
A structure to follow: Requirements, sketch, deep-dive, trade-offs
- Step 1
Requirements
Ask who uses it, what it must do, and which qualities matter most: speed, reliability, cost, consistency.
- Step 2
Sketch
Draw the main parts and the path one request takes through them before adding detail.
- Step 3
Deep-dive
Pick the riskiest part (storage, queueing, failure handling) and go deeper there.
- Step 4
Trade-offs
Name what you gave up for each choice, and what you would do first if it needed to grow.
This is guidance on shape, not a script. Use your own real experience and facts; never invent details to fill a gap. See the STAR guide and answer frameworks.
Common slips
- Naming tools before establishing requirements.
- Drawing every box at the same depth instead of going deep where it matters.
- Presenting one design as the only answer, with no trade-offs.
How to practise it
Time yourself: two minutes on requirements, five on the sketch, five on one deep-dive, two on trade-offs.
Related questions
- How does replication work in a database you know well, and what can go wrong with replica lag?
- What is the difference between a full, an incremental and a point-in-time backup, and when would you need point-in-time recovery?
- What is an index, and why can adding too many indexes to a table actually hurt?
- A developer asks for full admin access to the production database to debug an issue. How do you respond?
- A query that used to take a second now takes a minute. Walk me through how you would figure out why.