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
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?

HardTechnical
52 practiced

A database is showing high write latency and you suspect it is I/O-bound, but you are not certain. How would you collect evidence to distinguish a CPU-, memory-, or I/O-bound bottleneck, and what remediation would you consider for each, for example filesystem or I/O-scheduler tuning, batching writes, or reconsidering the storage engine?

HardTechnical
109 practiced

Design a query-timeout policy for a reporting system serving many concurrent users. How would you decide timeout thresholds, for example by query complexity or user tier, what would you fall back to when a query times out (partial results, cached stale data), and how would you avoid silently dropping a retrieval that actually mattered?

MediumSystem Design
69 practiced

You manage a transactions table with 5 years of history, about 3 billion rows, where most queries target the last 90 days and older data is only queried occasionally for audits. Propose a partitioning and retention strategy: how would you choose the partition key and size, archive or drop old data, and migrate the existing table into this scheme with minimal disruption?

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.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.