InterviewStack.io LogoInterviewStack.io

Database Monitoring, Troubleshooting, and Diagnostics Questions

Observing and fixing databases in production: health checks, metrics and alerting, and diagnosing common failures like slow queries, lock contention, replication lag, and resource exhaustion. Covers a systematic troubleshooting method under incident pressure. Tests operational instincts distinct from design knowledge.

MediumTechnical
42 practiced

Which metrics would you monitor to detect saturation of a relational database (e.g., Postgres) and how would you set alert thresholds? Discuss CPU, I/O, locks, connection count, query latency, queue length and actionable mitigations for each metric.

EasyTechnical
55 practiced

Explain the difference between an index scan and a sequential scan in relational databases. Describe the cost trade-offs that influence the optimizer's choice, when an index helps most, and concrete situations where adding an index will not improve—and may worsen—performance (consider write overhead, poor selectivity, and random I/O).

MediumTechnical
30 practiced

A MySQL replica is lagging by 5 minutes and clients are reading stale data. List the diagnostic checks and exact commands you'd run (for example SHOW SLAVE STATUS, examine relay logs, check IO_THREAD and SQL_THREAD), likely root causes (long-running transaction, disk I/O, network), and safe corrective actions including catch-up strategies, rebootstrap, and when to resync from primary.

MediumTechnical
56 practiced

You have a PostgreSQL table with JSONB columns and frequent filters on nested keys. How would you profile and optimize these queries? Discuss using GIN indexes, expression indexes, partial indexes, materialized views, and denormalization trade-offs. Provide example CREATE INDEX statements for common patterns.

HardTechnical
29 practiced

Design a safe online schema migration to add a NOT NULL column with a default to a table containing hundreds of millions of rows without blocking writes. Provide a step-by-step plan for PostgreSQL (create nullable column, backfill in batches, set default, validate, and then enforce NOT NULL) and discuss trade-offs and validation checkpoints.

Unlock Full Question Bank

Get access to all 41 Database Monitoring, Troubleshooting, and Diagnostics interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.