Interview questions and model answers
"Someone ran DELETE without a WHERE clause on production an hour ago. What do you do?"
Stop further damage first: pause the job or revoke the access that did it. Then use point-in-time recovery to restore a new instance to just before the delete, without touching production. From the restored copy, export the deleted rows and re-insert them into production, or, if much else is broken, switch the application to the restored instance and reconcile writes made since. Afterwards: a blameless review, least-privilege access, and safer tooling such as requiring transactions and reviews for manual changes.
"RPO vs RTO?"
RPO is how much data we can afford to lose, measured in time, and it's set by how often data is copied away: backups, log archiving or replication. RTO is how long we can be down, set by how fast we can fail over or restore. Synchronous replication gives near-zero RPO; a warm standby gives low RTO; nightly backups alone mean up to a day of loss and hours to restore.
"Multi-AZ vs read replicas?"
Multi-AZ is for availability: a synchronous standby in another AZ that takes over automatically if the primary fails, with no data loss; in the classic instance version it can't serve reads. Read replicas are asynchronous copies used to scale reads or for cross-region DR; they can lag and need promotion to become writers. Aurora blurs this since replicas share storage and are failover targets.
"How does your application survive a database failover?"
It connects to the cluster endpoint, not an instance, with a short DNS cache, its pool validates and replaces broken connections, and it retries transient errors with back-off. RDS Proxy can hold client connections and reconnect for us. We test it by forcing failovers in staging under load.
"The app gets 'too many connections' after we scaled from 10 to 50 pods. Why and what do you do?"
Each pod has its own connection pool, so 50 pods with a pool of 20 open up to 1,000 connections, beyond max_connections. I'd add a pooler, RDS Proxy or PgBouncer in transaction mode, reduce per-pod pool sizes, and size pools from the database's capacity divided by the maximum number of pods, which HPA limits should respect.
"How do you add a column and an index to a 500 GB table with no downtime?"
Add the column as nullable without a rewriting default, deploy code that writes it, backfill in small batches, then add any default or constraint. Create the index concurrently in PostgreSQL, or with online DDL or gh-ost in MySQL, and set a lock timeout so the migration fails fast instead of blocking traffic. Run it from the pipeline through the migration tool, watching locks and replication lag.
"How would you upgrade PostgreSQL 15 to 17 on RDS with minimal downtime?"
Test the upgrade on a restored snapshot in staging for extensions, query plans and drivers. Then create an RDS Blue/Green deployment with the green environment on 17, let it sync, run checks against it, and switch over in a low-traffic window; the switchover usually takes under a minute and refuses to proceed if replication isn't caught up. Keep the old blue environment until we're confident, as the rollback path.
"How do you know your backups work?"
By restoring them automatically on a schedule into a scratch instance, running data checks and an app smoke test, and recording how long it took, so we know the real RTO. Backups are copied to another account and region, with an immutable vault lock, so a compromised account can't delete them.