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?

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?

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

A dashboard's average load time is 8 seconds, and the business needs it under 2. Walk through your remediation plan: how you would measure where the time is going, what quick wins you would try first, what medium-term and long-term architecture changes you would consider, and how you would know if a change made things worse.

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?

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.