Scrivio Interview library

Operating databases

31 questions in 8 subtopics.

Capacity planning

ScenarioFoundations7 min read
Your orders table grows by 2 million rows a day, each row about 300 bytes including indexes is roughly 900 bytes. Estimate disk growth for a year and say what else you would plan for besides raw size.
DesignIntermediate7 min read
A PostgreSQL primary runs at 70 percent CPU at peak and traffic is expected to double in 9 months. Describe how you would plan capacity and which options you would compare.
LeadershipAdvanced6 min read
Database capacity incidents happen every quarter across your company because each team plans on its own. How would you set up capacity management as a practice?
LeadershipPrincipal7 min read
Your company plans to expand into three new regions over five years with data residency rules. How do you plan database capacity and topology at this horizon?

Monitoring metrics

ConceptFoundations7 min read
Which database metrics would you put on the first dashboard for a PostgreSQL database behind a Spring Boot service, and why?
DebuggingIntermediate7 min read
Every afternoon p99 latency jumps from 20 ms to 2 s for ten minutes. HikariCP shows pending threads and connection timeouts, while database CPU is only 30 percent. How do you investigate?
DesignAdvanced6 min read
Define a database observability standard for 200 databases (PostgreSQL, MySQL and some managed NoSQL) so that on-call engineers can diagnose any of them in the same way.
LeadershipPrincipal6 min read
Database monitoring tools across your company come from five vendors and two in-house systems, and no one can compare databases. How do you decide what to standardise and what to leave to teams?

Backup and restore drills

ConceptFoundations6 min read
What is the difference between a logical backup (pg_dump) and a physical backup with WAL archiving for PostgreSQL? What do RPO and RTO mean here?
ScenarioIntermediate7 min read
A developer ran an UPDATE without a WHERE clause on the production customers table at 14:05. Writes continue. Walk through recovering with point-in-time recovery while limiting impact.
LeadershipAdvanced6 min read
An audit finds that most of your company's database backups have never been test-restored. How would you set up restore drills and measure success?
LeadershipPrincipal6 min read
The board asks whether the company could survive a ransomware attack that encrypts production databases and the main backup system. How do you answer and what do you invest in?

Managed vs self-hosted databases

ConceptFoundations6 min read
What does a managed database service such as Amazon RDS, Aurora, Cloud SQL or Azure Database for PostgreSQL take care of, and what remains your responsibility?
ScenarioIntermediate6 min read
Your team runs self-hosted PostgreSQL on VMs with Patroni. Management suggests moving to a managed service. What do you compare before deciding?
LeadershipPrincipal5 min read
Your company runs about half its databases on a cloud provider's managed services and half self-hosted in its own data centres. Define a ten-year database hosting strategy.

Cost management

ScenarioFoundations6 min read
Your cloud database bill doubled in three months. List the first things you would check.
DesignIntermediate6 min read
Propose a plan to cut database costs by 30 percent for a set of 40 PostgreSQL instances without increasing risk.
LeadershipAdvanced5 min read
Teams treat databases as free because a central budget pays for them. How would you introduce cost accountability without slowing teams down?
LeadershipPrincipal6 min read
Database and storage costs are now one of the company's top three infrastructure costs and growing faster than revenue. What strategic options do you evaluate?

Choosing a database

ConceptFoundations6 min read
For a new Spring Boot service storing orders, customers and payments, why is a relational database like PostgreSQL usually the default, and when would you consider something else?
DesignIntermediate6 min read
A team wants to use MongoDB for a new service because 'the schema will change a lot'. The data is accounts, transactions and balances. How do you review this choice?
LeadershipAdvanced5 min read
Your company runs 14 different database technologies. How would you create an approved technology list without blocking legitimate needs?
DesignPrincipal6 min read
Distributed SQL databases (CockroachDB, YugabyteDB, Spanner) promise relational features with horizontal scale. Should your company adopt one as the new standard OLTP database?

Migrating between databases

ConceptFoundations7 min read
What changes when a Spring Boot application with Spring Data JPA moves from MySQL to PostgreSQL? List the code and configuration you expect to touch.
ScenarioIntermediate7 min read
You must migrate a 2 TB MySQL 8.0 database to PostgreSQL with less than 15 minutes of downtime. Outline the plan.
DesignAdvanced5 min read
Your company decides to move 60 services from a commercial database to PostgreSQL over three years. How do you organise the programme?
LeadershipPrincipal6 min read
Leadership wants to leave an expensive proprietary database vendor whose contract renews in two years. Many critical systems depend on procedural code in the database. How do you frame the decision?

Integrity checks and crash recovery

ConceptFoundations8 min read
How does PostgreSQL recover after a crash, and why does fsync matter? What happens if fsync is turned off?
DebuggingIntermediate8 min read
A PostgreSQL query fails with 'ERROR: could not read block 1234 in file base/16384/24576: read only 0 of 8192 bytes'. What does this suggest and how do you respond?
DesignAdvanced7 min read
How would you continuously verify data integrity across a fleet of PostgreSQL databases so corruption is found before users do?
LeadershipPrincipal6 min read
After a silent data corruption incident that went unnoticed for weeks, the CTO asks how to make data integrity a company-level property rather than a per-team concern. What do you propose?