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, resource exhaustion, and data-integrity incidents such as duplicate keys or lost updates after a crash or migration. Covers a systematic troubleshooting method under incident pressure. Tests operational instincts distinct from design knowledge.

EasyTechnical
43 practiced

List and explain five key metrics you would monitor to assess the health and performance of a production relational database. For each metric, describe one alert condition you might set and why.

EasyTechnical
38 practiced

Explain what the PostgreSQL view pg_stat_activity shows and how you'd use it to identify long-running queries and blocking relationships. Provide an example SQL query that lists sessions running longer than 5 minutes including pid, state, wait_event, query_start, client_addr, and application_name, and describe how you would interpret typical results.

EasyTechnical
40 practiced

You're on call and get paged for "high CPU and slow queries" on a production relational database. Walk through your first diagnostic steps: what you'd check first, which system and database-level commands you'd run to gather evidence, what you'd correlate against a recent deploy or config change, and how you'd package what you found for whoever picks up the deeper investigation.

EasyTechnical
40 practiced

Write a PostgreSQL SQL query that lists the top 5 queries by average duration in the last 24 hours using pg_stat_statements. Include columns: query, calls, total_time, mean_time, and max_time. Provide the SQL and a short explanation of how you'd interpret the results to prioritize optimization work.

EasyTechnical
36 practiced

Given a MySQL slow query log entry, explain what each field means and how you'd use those logs to prioritize tuning work. Describe how to enable slow query logging safely in production, what pitfalls to watch out for, and how to correlate slow log entries with application traces.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.