Senior Database Interview Questions (Top 100 Questions with Answers)
Master Senior Database Interview Questions covering architecture, performance tuning, distributed databases, transactions, replication, sharding, cloud databases, troubleshooting, scalability, and real-world production scenarios.
Introduction
Senior Database interviews are significantly different from junior-level interviews.
Interviewers expect you to demonstrate
- Production Experience
- Architecture Knowledge
- Performance Tuning
- Troubleshooting Skills
- Scalability Design
- High Availability
- Disaster Recovery
- Cloud Experience
- Decision Making
This guide contains 100 Senior Database Interview Questions commonly asked at companies like
- Amazon
- Microsoft
- Netflix
- Meta
- IBM
- Oracle
- JPMorgan Chase
- Walmart
- Adobe
Senior Database Interview Roadmap
Database Fundamentals
│
▼
Performance
│
▼
Transactions
│
▼
Distributed Systems
│
▼
Replication
│
▼
Sharding
│
▼
Cloud Databases
│
▼
Production Troubleshooting
│
▼
Architecture Decisions
Database Architecture
1. How do you choose a database for a new application?
Consider
- Functional Requirements
- Data Volume
- Read/Write Ratio
- ACID Requirements
- Scalability
- Cost
- Cloud Support
2. SQL vs NoSQL?
SQL
- Strong Consistency
- Complex Queries
NoSQL
- Horizontal Scaling
- Flexible Schema
3. Which database would you choose for Banking?
PostgreSQL
Oracle
Aurora PostgreSQL
4. Which database would you choose for IoT?
Cassandra
DynamoDB
5. Which database would you choose for Sessions?
Redis
6. Which database would you choose for Product Catalog?
MongoDB
or
PostgreSQL
7. Explain Polyglot Persistence.
Using multiple databases for different workloads.
Example
- PostgreSQL → Orders
- Redis → Cache
- MongoDB → Catalog
- Elasticsearch/OpenSearch → Search
8. Explain CAP Theorem.
- Consistency
- Availability
- Partition Tolerance
Distributed systems must balance these properties.
9. Explain Eventual Consistency.
Updates propagate across replicas over time.
10. Explain Strong Consistency.
Every read returns the latest committed data.
Performance
11. A query suddenly became slow. What will you check?
- Execution Plan
- Statistics
- Indexes
- Blocking
- Data Growth
12. Database CPU is 100%.
Investigate
- Full Table Scans
- Missing Indexes
- Bad Queries
- Large Reports
13. High Disk I/O.
Check
- Temp Tables
- Sorts
- Large Scans
- Backups
14. Memory usage is high.
Review
- Buffer Cache
- Connection Count
- Cache Size
15. Large Table Performance?
Use
- Partitioning
- Indexes
- Archiving
16. Explain Execution Plans.
They show how the optimizer executes SQL.
17. What is Cost-Based Optimization?
Optimizer selects the lowest estimated execution cost.
18. Why are Statistics important?
They help the optimizer choose efficient execution plans.
19. Explain Covering Index.
Contains every column needed by the query.
20. Explain Index Selectivity.
Higher uniqueness generally improves index usefulness.
Transactions
21. Explain ACID.
Atomicity
Consistency
Isolation
Durability
22. Explain MVCC.
Multiple versions allow readers and writers to operate concurrently.
23. Explain Isolation Levels.
- Read Committed
- Repeatable Read
- Serializable
24. Explain Deadlocks.
Two transactions waiting on each other.
25. Prevent Deadlocks?
- Consistent Lock Ordering
- Short Transactions
- Proper Indexes
26. Optimistic Locking?
Version-based concurrency.
27. Pessimistic Locking?
Locks resources before updates.
28. Distributed Transactions?
Use
Saga Pattern
or
Two Phase Commit.
29. Why avoid long transactions?
Increase locking and reduce concurrency.
30. Explain Idempotency.
Repeated requests produce the same result.
Replication
31. Why Replication?
- Read Scaling
- High Availability
- Disaster Recovery
32. Synchronous vs Asynchronous?
Synchronous provides stronger consistency.
Asynchronous provides lower latency.
33. Multi-Region Replication?
Improves availability and reduces user latency.
34. Explain Replica Lag.
Delay between Primary and Replica.
35. Causes of Replica Lag?
- Network
- Heavy Writes
- Slow Disk
36. Explain Read Replica.
Read-only database synchronized from Primary.
37. Explain Failover.
Replica becomes Primary.
38. Disaster Recovery Strategy?
- Backup
- Replication
- Recovery Testing
39. Point-in-Time Recovery?
Restore database to a specific timestamp.
40. Recovery Objectives?
- RTO (Recovery Time Objective)
- RPO (Recovery Point Objective)
Sharding
41. What is Sharding?
Distributing data across multiple databases.
42. Why Sharding?
Horizontal scalability.
43. Good Shard Key?
- High Cardinality
- Even Distribution
44. Bad Shard Key?
Creates hotspots.
45. Cross-Shard Queries?
Expensive.
Avoid when possible.
46. Explain Consistent Hashing.
Minimizes data movement when nodes change.
47. Hot Partition?
Single partition receives most traffic.
48. Rebalancing?
Redistributes data after scaling.
49. Sharding Challenges?
- Joins
- Transactions
- Reporting
50. When should you shard?
Only after optimization and replication are insufficient.
Cloud Databases
51. RDS vs Aurora?
Aurora provides higher availability and performance.
52. DynamoDB vs Aurora?
NoSQL
vs
Relational.
53. Cosmos DB?
Microsoft's globally distributed NoSQL database.
54. Spanner?
Google globally distributed relational database.
55. Cloud SQL?
Managed relational database.
56. Explain Serverless Database.
Automatically scales compute based on demand.
57. Auto Scaling?
Automatic resource adjustment.
58. Storage Auto Growth?
Automatically increases storage capacity.
59. Explain Read Scaling.
Read Replicas distribute read traffic.
60. Database Migration?
- Backup
- Validate
- Cutover
- Rollback
Production Troubleshooting
61. Production database suddenly slow.
Check
- Monitoring
- Execution Plans
- Locks
- CPU
62. High Connection Count.
Use Connection Pooling.
63. Deadlocks increased.
Analyze lock ordering.
64. Slow Reports.
Use
Materialized Views
or
Reporting Database.
65. Storage fills quickly.
Review
Logs
Backups
Archive Data.
66. Replication broken.
Check
Logs
Network
Disk.
67. Database restart.
Analyze
Logs
Crash Recovery.
68. Slow Writes.
Review
Indexes
Triggers
Disk.
69. Cache Hit Ratio decreases.
Check
Redis
TTL
Evictions.
70. High Latency.
Investigate
Application
Network
Database.
System Design
71. Design Banking Database.
Focus
- ACID
- Security
- Audit
- Transactions
72. Design Payment Gateway.
Idempotency
Retries
Audit
73. Design Order Management.
Orders
Inventory
Payments
74. Design Chat Application.
Messages
Redis
WebSocket
Database
75. Design E-Commerce Platform.
Catalog
Orders
Search
Cache
76. Design Global Database.
Multi-Region
Replication
Failover
77. Design Analytics Platform.
OLTP
↓
CDC
↓
Data Warehouse
78. Design Audit System.
Immutable Event Store.
79. Design Notification Platform.
Queue
Retry
DLQ.
80. Design Recommendation Engine.
NoSQL
Cache
Machine Learning.
Leadership Questions
81. How do you handle production incidents?
- Assess Impact
- Communicate
- Mitigate
- Resolve
- RCA
82. How do you mentor junior engineers?
Knowledge sharing.
Code reviews.
Architecture sessions.
83. How do you review database designs?
Check
- Normalization
- Indexes
- Scalability
- Security
84. How do you perform capacity planning?
Estimate
- Users
- TPS
- Storage
- Growth
85. How do you reduce costs?
- Archiving
- Compression
- Auto Scaling
- Reserved Capacity
Architect-Level Questions
86. Multi-Tenant Database?
- Shared Schema
- Separate Schema
- Separate Database
87. Event Sourcing?
Persist events instead of current state.
88. CQRS?
Separate read and write models.
89. CDC?
Capture database changes for downstream systems.
90. Outbox Pattern?
Reliable event publishing.
91. Blue-Green Database Deployment?
Zero-downtime deployments.
92. Zero-Downtime Migration?
Dual Writes
CDC
Validation.
93. How do you secure databases?
- Encryption
- IAM
- RBAC
- Auditing
- Secrets Management
94. Monitoring Stack?
- Prometheus
- Grafana
- CloudWatch
- Datadog
- Splunk
95. SLA vs SLO vs SLI?
Understand service reliability metrics.
96. How do you design for one billion users?
- Sharding
- Caching
- CDN
- Replication
97. Handle one million TPS?
- Distributed Databases
- Kafka
- Cache
- Async Processing
98. Database Design Checklist?
- Schema
- Indexes
- Security
- Replication
- Backup
- Monitoring
99. What qualities define a Senior Database Engineer?
- Production Experience
- Troubleshooting
- Automation
- Scalability
- Leadership
100. What do interviewers expect from senior candidates?
- Technical Depth
- Clear Communication
- Tradeoff Analysis
- Architecture Thinking
- Real Production Experience
Enterprise Database Architecture
Users
│
Load Balancer
│
┌────────────┴────────────┐
▼ ▼
Application A Application B
│ │
└────────────┬────────────┘
▼
Redis Cache
│
┌───────────────┴───────────────┐
▼ ▼
Read Replica Read Replica
│ │
└───────────────┬───────────────┘
▼
Primary Database
│
┌─────────────┴─────────────┐
▼ ▼
Backup CDC/Kafka
│ │
▼ ▼
Disaster Recovery Analytics Platform
Senior Interview Checklist
| Area | Must Know |
|---|---|
| SQL | Execution Plans |
| Transactions | ACID, MVCC |
| Performance | Indexes, Statistics |
| Replication | HA, Failover |
| Sharding | Consistent Hashing |
| Cloud | Aurora, DynamoDB |
| Distributed Systems | Saga, Outbox, CDC |
| Monitoring | Grafana, Prometheus |
| Security | Encryption, IAM |
| Leadership | RCA, Mentoring |
Interview Tips
Senior interviews focus less on syntax and more on decision-making.
When answering questions:
- Start with requirements.
- Explain tradeoffs.
- Discuss production experiences.
- Mention monitoring and observability.
- Include scalability and disaster recovery.
- Think beyond the database to the overall architecture.
- Demonstrate leadership and communication skills.
Summary
Senior Database interviews assess your ability to build and operate highly available, scalable, and secure data platforms in production. Success requires deep knowledge of SQL, NoSQL, performance tuning, transactions, replication, sharding, distributed systems, cloud databases, observability, and architecture tradeoffs.
Mastering these 100 Senior Database Interview Questions prepares you for Senior Software Engineer, Staff Engineer, Principal Engineer, Database Architect, Cloud Architect, and Solution Architect interviews.