Database Administrator Interview Questions & Answers

12 questions with answer strategies$102K median salaryOutlook: Faster than average

A strong DBA interview answer sounds like this: “At 2:13 a.m., PostgreSQL replication lag crossed our 60-second alert threshold. I checked WAL generation, found an unindexed batch delete saturating disk I/O on the primary, paused the job, and restored lag to under five seconds in 18 minutes. I then changed the retention process and added a lag-by-database alert.” That is what 2026 DBA panels reward: operational judgment tied to evidence. Expect a recruiter screen, a technical round covering SQL, engine internals, backup/recovery, security, and performance, then a scenario panel with engineering or SRE partners. The deciding factor is rarely whether you can recite commands. It is whether you can explain your baseline, your diagnosis path, your rollback plan, and the measurable result.

Behavioral questions

Tell me about a database incident you owned from alert to resolution.

Why they ask: The interviewer is testing whether you operate methodically under pressure rather than making risky production changes. They want to hear how you separated symptoms from root cause and how you measured recovery.

How to answer: Lead with the service impact, the first signal, and the metrics that shaped your triage: error rate, connection saturation, replication lag, disk latency, or lock waits. Explain the containment action, the exact evidence used to identify root cause, and the permanent control you added afterward; weak answers say only that you “restarted the database.”

Example answer

I owned a MySQL outage affecting our checkout service during a promotion. Grafana showed application latency rising while the database CPU was only 45%, so I checked InnoDB status and found 1,800 sessions waiting on a metadata lock caused by a schema migration. I stopped the deployment, identified the long-running reporting query holding the transaction open, and terminated that read-only session after confirming it could be rerun safely. Checkout errors returned to baseline in 11 minutes, and we lost no committed orders. Afterward, I added migration lock-timeout checks and a dashboard alert for metadata-lock waiters, which prevented two similar releases from reaching production.

Describe a time you improved database performance in a way you could prove.

Why they ask: DBAs are expected to distinguish real performance improvements from anecdotes or one-off cache effects. The interviewer is probing for baseline discipline, query-plan fluency, and business-aware prioritization.

How to answer: Name the workload, establish a before metric, then show the diagnostic chain from slow-query data to execution plan to corrective change. Strong answers include p95 or p99 latency, rows examined, logical reads, CPU or I/O impact, and verification after deployment.

Example answer

At my last company, the customer search endpoint had a p95 database time of 2.8 seconds and was driving roughly 30% of our PostgreSQL CPU during business hours. I used pg_stat_statements to isolate the query, then EXPLAIN ANALYZE showed a sequential scan because the filter used lower(email) without a matching expression index. I added the index concurrently, validated the plan in staging with production-like statistics, and monitored write overhead after release. The query's p95 fell to 180 milliseconds, rows scanned dropped from about 9 million to fewer than 40, and peak CPU fell by 18%. I kept the index because its write cost stayed under our 5% insert-latency budget.

Tell me about a backup or recovery process you found was not reliable enough.

Why they ask: This tests whether you understand that a successful backup job is not proof of recoverability. Interviewers want a DBA who validates restore time, data integrity, retention, and recovery point objectives.

How to answer: Explain what exposed the gap: a restore test, audit finding, failed point-in-time recovery, or mismatch with an RPO/RTO. State the recovery target, the tools involved, the test cadence, and the measured restoration result after you redesigned the process.

Example answer

I inherited an Oracle environment where RMAN backups reported success, but nobody had restored one in more than a year. During a quarterly test, I found that archived logs were being retained for only 24 hours, which made our stated four-hour RPO impossible for a weekend incident. I changed the retention policy, configured RMAN validation, and built an automated monthly restore into an isolated environment using cataloged backups. Our first full restore and recovery to a chosen SCN took 2 hours and 37 minutes, compared with an undocumented recovery estimate of eight hours. I documented the runbook and had application owners sign off on the revised 30-minute RPO and three-hour RTO.

Give me an example of how you improved database security without breaking an application.

Why they ask: The panel is assessing whether you can apply least privilege and audit controls while understanding application dependencies. A DBA who simply revokes permissions without a migration plan creates outages.

How to answer: Describe the permission or exposure problem, inventory how identities actually access the data, and show how you tested the replacement access model. Quantify the reduction in privileged access, audit coverage, or credential rotation compliance.

Example answer

I found that twelve application services shared one PostgreSQL role with superuser-like permissions because it had grown through years of releases. I reviewed connection logs and application repositories to map the actual schemas, tables, and stored procedures each service used. I created separate roles, granted only required privileges, moved sensitive updates behind SECURITY DEFINER procedures with controlled ownership, and tested each service in a preproduction clone. We reduced privileged production accounts from twelve shared users to two break-glass accounts, and all service credentials moved to 90-day rotation through our secrets manager. The change also gave our audit team a clear identity trail for access to customer records.

Technical & role-specific questions

A PostgreSQL query that was fast last week is now slow. Walk me through your investigation.

Why they ask: This reveals whether you use a disciplined performance workflow instead of guessing at indexes. The interviewer is looking for command of PostgreSQL statistics, execution plans, lock behavior, resource saturation, and workload context.

How to answer: Start by confirming the regression with pg_stat_statements, application traces, and p95 latency rather than one manually run query. Then compare EXPLAIN (ANALYZE, BUFFERS), table statistics, data-volume changes, indexes, blocking sessions, autovacuum activity, I/O latency, and changed parameters or releases; state how you would validate and roll back a fix.

Example answer

I would first identify whether the regression is query-specific or system-wide by comparing pg_stat_statements mean time, calls, shared block reads, and total execution time against the prior week. For the query, I would capture EXPLAIN ANALYZE with BUFFERS in a safe environment and compare estimated versus actual row counts, because a large mismatch often points to stale statistics or skewed data. I would also inspect pg_stat_activity and pg_locks for blocking, then check autovacuum and disk latency before adding an index. If the plan changed after a data load, I would run targeted ANALYZE and retest; if an index is justified, I would create it concurrently and measure both read improvement and write overhead. I would consider the fix successful only if the endpoint p95 returns to its prior SLO and the database does not show a new CPU, bloat, or replication-lag regression.

How would you design backup and point-in-time recovery for a production MySQL database with a 15-minute RPO and a two-hour RTO?

Why they ask: The interviewer is testing whether you can translate recovery objectives into a concrete, testable architecture. They want more than “daily backups”: binlog retention, restore sequencing, integrity validation, and recovery drills matter.

How to answer: Describe full or physical backups plus binary logs, durable offsite storage, encryption, retention, and monitoring of backup age and completion. Explain the recovery sequence to a timestamp or position, estimate restore throughput against the two-hour RTO, and insist on recurring restore tests using production-scale data.

Example answer

I would use a physical backup tool such as Percona XtraBackup for regular full backups and retain binary logs continuously with enough margin beyond the 15-minute RPO. Backups and binlogs would be encrypted, copied to a separate account and region, and monitored for freshness, size anomalies, and checksum failures. For recovery, the runbook would restore the latest full backup to clean infrastructure, apply binlogs to the approved timestamp, validate InnoDB recovery and application reconciliation checks, then direct traffic only after sign-off. I would benchmark this with a production-sized restore rather than assume it fits two hours; if the restore takes 95 minutes, the remaining 25 minutes must cover binlog replay and validation. I would run at least quarterly point-in-time restore exercises and report the actual RPO and RTO achieved.

What causes index bloat or table bloat in PostgreSQL, and what would you do about it?

Why they ask: This checks engine-level knowledge of MVCC, dead tuples, autovacuum, transaction behavior, and maintenance tradeoffs. A DBA must know when maintenance is safe and when an aggressive operation could disrupt production.

How to answer: Explain that updates and deletes create dead tuples that VACUUM must reclaim, while long-running transactions can prevent cleanup. Cover diagnosis with pg_stat_user_tables, dead-tuple trends, table and index size, autovacuum logs, and transaction age; distinguish routine tuning from REINDEX, pg_repack, or a carefully scheduled VACUUM FULL.

Example answer

In PostgreSQL, bloat usually grows when dead tuples accumulate faster than autovacuum can clean them, often because of high-churn tables, undersized autovacuum settings, or old transactions holding snapshots open. I would first measure n_dead_tup, table growth, index size, autovacuum frequency, and the oldest transaction age rather than assume a large table is bloated. For a busy orders table, I would tune per-table autovacuum thresholds and cost settings, fix any application session holding idle transactions, and observe whether bloat growth stabilizes. If existing index bloat is materially harming cache efficiency, I would use REINDEX CONCURRENTLY where supported or pg_repack after testing its operational impact. I would reserve VACUUM FULL for a maintenance window because it takes an exclusive lock and can create a larger outage than the bloat.

How do you review a proposed schema change for a high-traffic production database?

Why they ask: The interviewer is assessing whether you understand that data modeling changes are operational changes. They want a DBA who evaluates locking, rewrite risk, index build behavior, replication impact, rollback feasibility, and application compatibility.

How to answer: Ask for table size, write rate, engine version, query patterns, deployment sequence, and rollback plan before approving the change. A strong answer distinguishes safe metadata operations from table rewrites or blocking DDL and requires measured testing on representative data.

Example answer

I start by asking what engine and version we are on, the table's row count and growth rate, peak write volume, and whether the application can tolerate a backward-compatible rollout. For PostgreSQL, I check whether an added column, default, type change, constraint, or index will rewrite the table or acquire a lock that conflicts with production traffic. For example, I prefer adding a nullable column, backfilling in throttled batches, deploying code that writes both paths, then validating and enforcing a constraint later. I require an EXPLAIN for any backfill query, monitor WAL volume and replica lag during the test, and use CREATE INDEX CONCURRENTLY where appropriate. I do not approve a migration until the team can state the expected lock duration, success metrics, and exact rollback point.

Situational & judgment questions

It is Friday afternoon and an engineer asks you to add an index immediately because a dashboard query is timing out. What do you do?

Why they ask: This tests whether you balance urgency against the production risk of DDL. The interviewer wants judgment about evidence, engine-specific locking behavior, capacity impact, and alternatives.

How to answer: Do not reflexively approve or refuse. Establish impact and query evidence, determine the database engine and online-index capabilities, check table size and write load, then choose a safe path such as a concurrent or online index build, query rewrite, temporary reporting replica, or a scheduled change.

Example answer

I would first verify that the dashboard query is the actual source of the timeout using query logs or pg_stat_statements, then inspect its plan and current table statistics. If this is PostgreSQL and the proposed index is justified, I would evaluate CREATE INDEX CONCURRENTLY, including available disk space, expected build time, and the effect on replicas and write latency. If the table is under heavy write load and the dashboard is noncritical, I would route the report to a replica or reduce its date range until the index can be built safely. I would communicate a measurable decision: for example, build only if the query is consuming more than 10% of total database time and staging shows a p95 improvement without unacceptable write regression. A weak response is “I would just add the index,” because it ignores lock, I/O, and rollback risk.

Your primary database is healthy, but replica lag has risen from seconds to 25 minutes and reporting users are seeing stale data. How do you respond?

Why they ask: This probes replication diagnosis and prioritization under a partial outage. The interviewer wants to know whether you can identify whether the bottleneck is write volume, replay, network, disk, a long query, or a broken replication process.

How to answer: State how you confirm lag and its business impact, then inspect replication status and primary-versus-replica resource behavior. Explain containment options—pausing expensive reporting, redirecting reads, throttling batch work, or scaling the replica—and define the lag threshold that marks recovery.

Example answer

I would confirm the reported lag from the replication metrics and compare the replica's replay or apply position with the primary, then check whether dashboards are reading data beyond their allowed freshness window. I would inspect primary write volume, replica CPU and disk latency, network throughput, long-running queries, and any maintenance or ETL job that began near the lag increase. If a nonessential report is consuming replica resources, I would cancel or throttle it first; if a bulk load is generating excessive WAL or binlogs, I would rate-limit that workload with the application owner. I would avoid failing reporting back to the primary unless capacity data shows it can absorb the read load safely. I would declare recovery only after lag remains under our five-minute reporting SLO for at least one normal workload cycle and document the actual trigger.

A developer requests direct production access to investigate a customer-data issue. How do you handle it?

Why they ask: This tests security judgment, incident responsiveness, and ability to preserve auditability. DBAs must solve urgent data problems without normalizing uncontrolled access to sensitive production systems.

How to answer: Offer a controlled alternative: time-bound, least-privilege access through approved identity controls; supervised query execution; or a sanitized replica, depending on the incident. Require a ticket, business justification, audit trail, and restrictions on data export or write access; explain how you verify that access expires.

Example answer

I would ask what data they need, whether the issue is customer-impacting, and whether a read-only query run by the DBA team can answer it faster. For a legitimate urgent case, I would open or link an incident ticket, grant a named identity temporary read-only access to the required schema through our privileged-access workflow, and set automatic expiration. I would not provide shared credentials or unrestricted production access, especially if customer PII is involved. If they need to test code, I would direct them to a masked replica or reproduce the issue with an approved data extract. Afterward, I would review access logs, confirm the role was removed, and record whether the request exposed a gap in our support tooling.

During a recovery exercise, you discover that the last usable backup is 10 hours old, but the business RPO is one hour. What do you do next?

Why they ask: This assesses whether you escalate a serious control failure honestly and turn it into an actionable recovery and prevention plan. The wrong answer is to quietly fix the next backup and hope nobody notices.

How to answer: First preserve evidence and determine whether transaction logs, replicas, snapshots, or storage-level copies can reduce data loss. Escalate the RPO breach to incident and business owners, calculate the actual recoverable point, then remediate the failed backup chain, monitoring, restore validation, and ownership model.

Example answer

I would immediately determine whether binary logs, WAL archives, a healthy replica, or immutable storage snapshots could move the recoverable point closer than the 10-hour backup. I would treat the finding as an incident because the organization is operating outside its approved RPO, even if production is currently healthy. I would report the exact exposure—for example, “we can currently recover only to 10:00 a.m., not the one-hour objective”—and pause any risky maintenance until the recovery posture is understood. Then I would identify why alerts did not fire, repair the backup chain, and perform a full restore plus point-in-time recovery before declaring compliance restored. My preventive metric would be a daily control showing latest verified restore point, backup age, and achieved RPO for every critical database.

How to prepare for a Database Administrator interview

  • Build four incident stories with numbers: one performance regression, one backup or restore failure, one replication or availability event, and one access-control change. For each, write the alert signal, commands or dashboards used, containment action, root cause, recovery time, and the control you added.
  • Practice reading execution plans aloud for PostgreSQL and the primary engine named in the job description. Use EXPLAIN ANALYZE, BUFFERS, pg_stat_statements, MySQL EXPLAIN ANALYZE, Oracle AWR or ASH, and be ready to explain estimated-versus-actual row differences.
  • Run a restore lab before interviewing: take a backup, restore it to a clean instance, perform point-in-time recovery if your engine supports it, and record elapsed time, data validation checks, and the gap between your achieved RPO/RTO and the target.
  • Prepare a one-page production change review checklist covering table size, write rate, lock behavior, table rewrite risk, online or concurrent index options, replication impact, monitoring, rollback, and post-change success metrics.
  • Translate every tool on your resume into an operational claim you can defend. If you list Oracle RMAN, PostgreSQL, MySQL, Terraform, monitoring, or cloud managed databases, prepare one concrete example of what you measured, what threshold triggered action, and how you verified the outcome.

Interviewers will also have your resume in front of them — make sure it holds up. See our database administrator resume example with salary data and proven bullet points.

Database Administrator interview FAQ

How technical are Database Administrator interviews in 2026?

They are technical in the operational sense, not just trivia-heavy. Expect to reason through SQL plans, locks, replication, recovery objectives, permissions, and production change risk on a specific engine such as PostgreSQL, Oracle, or MySQL. Panels often care more about your diagnostic sequence and measurable decision criteria than perfect syntax. If you cannot explain how you validate a restore or prove an index helped, your engine knowledge will sound shallow.

Do I need to know every database platform listed in the job posting?

No, but you need depth in the platform that dominates the role and a credible comparison framework for the others. Be precise about what differs: PostgreSQL MVCC and autovacuum, MySQL InnoDB and binlogs, Oracle RMAN and Data Guard, or managed-service backup boundaries. Never claim equivalent production expertise just because you have run basic queries on a platform. State where your hands-on experience ends and show how you would safely learn the company's stack.

What should I say when they ask for my salary expectations as a DBA?

Use the posted scope and your production ownership to anchor the discussion, not a vague market claim. The US range is roughly $54,070 to $155,660, with a median of $101,510; a candidate handling 24/7 on-call, recovery design, security, and multiple production engines should not position themselves like an entry-level operations hire. Say: “Given the role's production scope, on-call expectations, and total compensation, I am targeting $X to $Y, while I am open to discussing the full package.” Choose X and Y from your local market, experience level, and the role's actual responsibilities.

What questions should I ask at the end to signal DBA seniority?

Ask questions that expose operational maturity: “What are the RPO and RTO targets for each critical database, and when were they last proven in a restore test?” Ask how schema changes are reviewed, what percentage of database load comes from the top queries, and how replication lag or backup failures are escalated. Also ask which access paths still use shared credentials or broad roles. Avoid ending with generic culture questions when the panel has not demonstrated its production controls.

How do I answer if I have mostly managed cloud databases rather than self-hosted servers?

Do not apologize for managed-service experience; explain the DBA controls you still owned. Discuss parameter groups, read replicas, backup retention, point-in-time recovery testing, IAM or database roles, performance insights, slow-query analysis, maintenance windows, and cost or capacity thresholds. Also name the boundaries: the provider may manage patching and hardware, but you remain accountable for data modeling, query behavior, access, recoverability, and application-facing availability. Strong candidates can explain what they would verify rather than assuming the cloud provider's “automated backups” meet the business RPO.

Get questions for a specific job posting

Paste a real job description and our free AI generator predicts the 5 questions you're most likely to face — tailored to that exact posting.

Try the free generator

Practice these questions out loud

Answer in a live voice conversation with an AI interviewer that listens, follows up, and gives instant feedback. Free to start.

Start practicing