CDM Continuous Integration & Continuous Delivery 3 — Questions and Answers
Question 1: What is the key difference between Continuous Delivery and Continuous Deployment?
- Continuous Delivery requires automated testing; Continuous Deployment does not
- Continuous Delivery requires a manual approval before production release; Continuous Deployment releases automatically (Correct answer)
- Continuous Deployment uses blue-green deployments; Continuous Delivery does not
- Continuous Delivery targets cloud environments; Continuous Deployment targets on-premises
Correct answer: Continuous Delivery requires a manual approval before production release; Continuous Deployment releases automatically
In Continuous Delivery a human must approve the final production push, while Continuous Deployment automatically releases every passing build to production.
Question 2: Which technique allows a new version to serve a small percentage of production traffic while the old version handles the rest?
- Blue-Green Deployment
- Rolling Deployment
- Canary Release (Correct answer)
- Feature Toggling
Correct answer: Canary Release
A canary release routes a small slice of real production traffic to the new version so risk is limited while real-world validation occurs.
Question 3: A team's CI build takes 45 minutes, causing developers to avoid committing frequently. What is the best remediation?
- Run the build less frequently to reduce server load
- Parallelize test execution and split the pipeline into fast and slow test suites (Correct answer)
- Remove slower integration tests from the pipeline entirely
- Upgrade to a more powerful single build server
Correct answer: Parallelize test execution and split the pipeline into fast and slow test suites
Parallelizing tests and separating fast unit tests from slower integration tests dramatically reduces feedback time without sacrificing coverage.
Question 4: What is the purpose of using immutable infrastructure in a CD pipeline?
- To allow administrators to patch servers in place after deployment
- To ensure servers are never modified after deployment; new versions always replace old ones (Correct answer)
- To prevent developers from deploying on weekends
- To store deployment logs in a read-only database
Correct answer: To ensure servers are never modified after deployment; new versions always replace old ones
Immutable infrastructure means deployed instances are never modified; rollbacks and updates are performed by replacing instances with new ones built from a known-good image.
Question 5: Which practice ensures that database schema changes do not break a CI/CD pipeline during a zero-downtime deployment?
- Running all schema migrations after the application is fully deployed
- Using backward-compatible, multi-phase migrations (expand/contract pattern) (Correct answer)
- Locking the database during deployment to prevent read/write conflicts
- Deleting and recreating the database schema on every deployment
Correct answer: Using backward-compatible, multi-phase migrations (expand/contract pattern)
The expand/contract pattern adds new schema elements before the application update and removes old ones after, allowing both old and new code to run simultaneously.
Question 6: What does a 'flaky test' mean in a CI pipeline, and why is it particularly harmful?
- A test that only runs on certain operating systems, limiting coverage
- A test that non-deterministically passes or fails, eroding trust in the pipeline (Correct answer)
- A test that checks deprecated API endpoints
- A test with insufficient assertions that always passes
Correct answer: A test that non-deterministically passes or fails, eroding trust in the pipeline
Flaky tests produce inconsistent results unrelated to code changes, causing developers to re-run pipelines rather than trust failures, which undermines CI's value.
Question 7: In a CI system, what is the function of a 'commit stage' or 'commit pipeline'?
- To request peer review for every incoming commit before it is tested
- To run fast, automated checks (compile, unit tests, static analysis) that give developers rapid feedback within minutes (Correct answer)
- To merge feature branches into the main branch automatically
- To deploy every commit to a staging environment for manual testing
Correct answer: To run fast, automated checks (compile, unit tests, static analysis) that give developers rapid feedback within minutes
The commit stage runs quick automated checks immediately after a commit so developers get feedback in minutes, not hours, enabling rapid iteration.
What is the key difference between Continuous Delivery and Continuous Deployment?