Database Performance Tuning and Scaling Questions

System-level performance work beyond a single query: configuration and resource tuning, capacity planning, handling large data volumes, and scaling read and write throughput. Covers identifying bottlenecks, growth management, the vertical-versus-horizontal scaling decision, materialized views for expensive queries, and maintenance work such as vacuuming, index rebuilds, bulk loads, and safe schema changes on large tables. Tests whether a candidate can keep a database healthy as load grows.

MediumTechnical
56 practiced

A database is projected to grow 5x in storage and IOPS over the next 12 months. Walk through how you would build a capacity plan for it: how you would model the growth, what safety margins you would build in, how you would project cost, and what automation or alerting you would put in place so capacity never becomes an unplanned outage.

MediumTechnical
63 practiced

Your team runs a single relational database instance that is approaching its performance ceiling as traffic grows. Explain the difference between scaling it vertically (a bigger instance) and scaling it horizontally (multiple instances). What are the practical limits and cost implications of each, and how do they affect availability and operational complexity as the system keeps growing?

MediumTechnical
70 practiced

Write PostgreSQL SQL to create a materialized view summarizing daily user metrics, and show how you would refresh it concurrently without blocking readers. What are the locking implications of a concurrent refresh, and how would you schedule refreshes to minimize impact on users?

MediumBehavioral
65 practiced

Tell me about a time you optimized a database's performance in production. What was slow, what metrics did you start with (latency, throughput), what did you actually do (indexing, partitioning, denormalization, query rewrites, or something else), how did you validate the improvement, and what trade-offs did you accept?

MediumTechnical
67 practiced

A production service is returning intermittent errors, and metrics show its database connection pool is occasionally hitting its max. How would you diagnose whether this is caused by leaking connections, an undersized pool, slow queries holding connections too long, or a sudden traffic spike? What database and application metrics or logs would you check, and what would you do to restore availability immediately?

Unlock Full Question Bank

Get access to all 18 Database Performance Tuning and Scaling interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.