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

You need to bulk-load 100 million rows into PostgreSQL with minimal downtime and minimal WAL bloat. Walk through your plan: how would you validate the data first, choose between COPY and row-by-row INSERT, decide whether to disable and rebuild indexes, consider partitioning or UNLOGGED tables, and tune settings like maintenance_work_mem and parallelism? What risks would you flag, and how would you confirm the load succeeded?

HardTechnical
64 practiced

Your OLTP database is seeing p99 write latency spikes traced to bursts of fsyncs. What mitigations would you consider at the OS, filesystem, database-engine, and application layers to reduce that tail latency without giving up durability, and what are the trade-offs of each?

MediumTechnical
51 practiced

You manage a 500GB OLTP table that shows average fragmentation over 30 percent. How would you decide between reorganizing and rebuilding its indexes, including the thresholds you would use, whether you can do it online, the impact on locks, and how fillfactor should factor into the decision? Describe a maintenance approach that minimizes impact on users.

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?

EasyTechnical
62 practiced

You are building a monitoring dashboard for a production database. What are the 8 to 10 metrics you would include, covering resource utilization, replication, query performance, and capacity? Why does each one matter, and what alert thresholds would you set for them?

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.