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.

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?

HardSystem Design
60 practiced

You need a materialized view or aggregated table that stays fresh within 10 minutes over a dataset ingesting about 1TB per day. How would you implement incremental refresh so you are not recomputing the whole view every time, what would partition-level refresh buy you, and what do you do when the underlying data gets corrected after the fact through a backfill?

MediumTechnical
70 practiced

Explain what VACUUM and ANALYZE do in PostgreSQL, why autovacuum exists, and what happens to a busy transactional table if neither runs. How would you detect that a table has become bloated, tune autovacuum's parameters for a high-write table, and safely run a manual VACUUM or VACUUM FULL on a production system without causing an outage?

HardSystem Design
66 practiced

You need to cut p95 read latency for a global user base from 120 milliseconds to under 40 milliseconds at 50,000 reads per second. Design a read-scaling architecture layering edge or CDN caching, in-memory caching, and read replicas. How would you decide what to cache and for how long, using a pattern like stale-while-revalidate, and what consistency guarantees would you be willing to give up to hit that target?

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?

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.