Interview Prep/Real-World Interview/Data loss and corruption

You need to restore last night's MySQL backup and discover the dump files for the past three months are 20 KB each.

IntermediateTroubleshootingData loss and corruption
Answer

Likely causes → The backup job "succeeded" with nothing in it: the dump command failed (auth error, wrong host) but the script didn't use set -o pipefail, so mysqldump | gzip returned gzip's exit code 0. Nobody alerted on size and nobody ever tested a restore.

Diagnose →

ls -lh /backups/mysql/ | tail
zcat /backups/mysql/2026-11-08.sql.gz | head -20
grep -i error /var/log/backup.log | tail

Fix → Use whatever else exists: RDS automated snapshots or PITR, replicas, binlogs, volume snapshots. Fix the script now and take a fresh full backup immediately.

set -euo pipefail
mysqldump --single-transaction --routines --triggers -h "$DB" app | gzip > "$OUT"

Prevent → A backup is only real once it's been restored. Run an automated weekly restore into a scratch instance with a row-count check, and alert on backup size changes greater than ±20%.

All Real-World Interview questions Roadmap: Interview readiness

More on Data loss and corruption