Databases
All interview questions related to Databases
Your application spans multiple microservices with separate databases. How would you ensure data consistency while maintaining scalability?
Describe your approach for performing a zero-downtime database migration in production.
Explain how you would design and implement database sharding for a large-scale application.
How would you detect, troubleshoot, and mitigate deadlocks in a relational database system?
How do you design and optimize database indexes for query performance without over-indexing?
Read replicas are falling minutes behind the primary. How do you diagnose replication lag and remediate it safely?
You need reliable event publication coupled with database writes. Describe how you’d implement the outbox pattern and ensure idempotency end to end.
How would you design data partitioning for a system that must handle billions of records with fast queries?
Design a globally available URL shortener like TinyURL/Bitly. Cover API design, key generation, storage, redirects, analytics, abuse prevention, and scalability.
Design a personalized news feed for a social network with billions of events per day. Cover write fan-out vs read fan-out, ranking, and cold start.
Design a highly available checkout/cart system handling flash sales, inventory reservations, payments, and order confirmation.
Design a reliable, horizontally scalable scheduler (distributed cron) that supports one-off and recurring jobs with retries and idempotency.
Design a horizontally scalable time-series database for metrics with high-cardinality support, rollups, and retention policies.
Design a blockchain ledger for financial transactions with consensus, immutability, and efficient query capabilities.
Design a database system that replicates across regions with low latency, conflict resolution, and disaster recovery.
Your application logs show frequent database connection pool exhaustion errors. How do you investigate and fix this?
Throughput bottlenecks appear on a subset of shards. Outline your approach to identify and mitigate hot partitions.
Users report that data they just wrote is not visible when reading immediately. Outline your investigation and mitigation.
A distributed database starts rejecting writes or showing anomalies due to detected clock skew on some nodes. How do you diagnose and stabilize?
Users face 503 errors during scheduled DB maintenance. How do you minimize impact and handle gracefully?