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
52 practiced

A read-heavy service is seeing increased database read latency during traffic spikes. Walk through how you would reduce it: what would you look at first, what would you try next, and how would you decide between the different levers available to you, spanning data-access changes, caching, and precomputation? For each option you pick, explain the trade-offs and how you would measure whether it worked.

MediumTechnical
58 practiced

You need to add a column to a production table with hundreds of millions of rows, and you cannot take a long lock or cause a visible outage. Describe a safe approach: what technique would you use to make the change incrementally, how would a dual-write-and-backfill strategy work if you needed one, and how would you monitor and cap the impact on live traffic while it runs, including a way to back out if something goes wrong?

HardTechnical
65 practiced

A multi-tenant SaaS product runs many tenants on a shared database cluster. One tenant's workload suddenly causes I/O and CPU spikes that degrade performance for everyone else. Propose an architecture and operational plan to detect and isolate noisy tenants: logical isolation (schemas, row-level throttles), physical isolation (dedicated instances for the worst offenders), resource limits, and how you would think about cost and billing allocation.

MediumTechnical
68 practiced

You are running PostgreSQL with a 500GB dataset on a host with 200GB of total memory. How would you determine reasonable values for shared_buffers and work_mem? What would you monitor to know if you got it right (cache hit ratio, page read times, OS page cache usage), how would you avoid swapping, and how would you roll the change out safely in production?

MediumTechnical
67 practiced

A service has an end-to-end p99 latency target of 100 milliseconds. How would you decompose that latency budget across network, application, and database components? Which database-specific metrics would you instrument to find the database's share of the tail latency, and what would you do if the database were blowing the budget?

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.