InterviewStack.io LogoInterviewStack.io

Database Performance Tuning and Scaling Questions

Addresses database system level performance and scaling strategies and how they interact with query design. Candidates should describe approaches for identifying and resolving database level bottlenecks including slow query diagnosis using logs and profiling instrumenting metrics and establishing baselines and targets for latency and throughput. Topics include caching strategies materialized views partitioning and sharding replication and read replica architectures connection management and improving cache utilization as well as trade offs when denormalizing schema or adopting alternative data models. Candidates should be able to propose step by step remediation plans measure the impact of changes and reason about operational concerns such as index maintenance windows monitoring and capacity planning.

EasyTechnical
75 practiced
Write SQL to create a covering index for the query below and explain why it's covering. Query: SELECT user_id, COUNT(*) AS cnt FROM events WHERE event_type = 'click' AND created_at >= '2025-01-01' GROUP BY user_id ORDER BY cnt DESC LIMIT 50; Table: events(id, user_id, event_type, created_at, metadata JSONB).
HardTechnical
57 practiced
Hard operational: Create a runbook outline for a database performance regression detected by a CI benchmark (e.g., 20% increase in median query latency). Include steps to triage, rollback, validate a fix, and communicate to stakeholders. Mention tooling and logs to consult.
HardSystem Design
69 practiced
Hard design/problem: You need to implement a global leaderboard with frequent writes and reads with top-K queries per region and globally. Propose data models and storage choices (in-memory, Redis, relational, specialized stores), explain how to keep global top-K consistent, and how to scale both read and write paths.
MediumTechnical
52 practiced
You maintain a Postgres OLTP database with heavy write traffic. An index rebuild is required but must not impact latency for peak hours. Design an index maintenance plan that minimizes downtime and write amplification. Include scheduling, concurrent options, and rollback considerations.
HardTechnical
66 practiced
Design an experiment to measure the performance impact of adding a new index on a production table with 500M rows. Describe steps to run the experiment safely, metrics to collect, how to use a canary or replica to avoid risk, and how to roll back if the index increases write latency unexpectedly.

Unlock Full Question Bank

Get access to hundreds of Database Performance Tuning and Scaling interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.

40+ Database Performance Tuning and Scaling Interview Questions & Answers (2026) | InterviewStack.io