CS FundamentalsVery hardProduct-company DevOps interview
A team wants to rename the column cust_name to customer_name in a live database with zero downtime while old and new app versions run side by side during a rolling deploy. Which approach is correct?
- A. Rename the column in one migration just before deploying the new code
- B. Deploy the new code first, then rename the column
- C. Expand-contract: add customer_name, write to both and backfill, switch reads to the new column, and drop cust_name only after no running version uses it
- D. Stop all instances, rename, then restart
Correct answer: C. Expand-contract: add customer_name, write to both and backfill, switch reads to the new column, and drop cust_name only after no running version uses it
During a rolling or blue-green deploy both versions hit the same database, so every schema change must stay compatible with both. Expand (add), migrate, then contract (remove) keeps each step backward compatible.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A Dockerfile ends with ENTRYPOINT ["python", "app.py"] and CMD ["--port", "80"]. The container is started with docker run myimg --port…
- A Go service's Docker image is 900 MB because it includes the compiler and build tools. Which change gives a small image containing only…
- An engineer runs docker exec into a running container, edits a config file, and later the container is removed and recreated from the same…
- A pipeline builds the application separately for each environment (dev, QA, prod) from the same commit. Which principle does this break…
- According to the Twelve-Factor App methodology, where should a service keep its database URL and API keys that differ between staging and…
- A CI pipeline takes 40 minutes: end-to-end UI tests (30 min) run first, then unit tests (3 min), then linting (1 min). Most failures are…