CAD CAD Continuous Integration and Delivery Questions and Answers 2 — Questions and Answers
Question 1: What is the primary purpose of a build pipeline in continuous integration?
- To deploy code directly to production without testing
- To automate the process of compiling, testing, and packaging code changes (Correct answer)
- To replace manual code reviews entirely
- To manage project documentation updates
Correct answer: To automate the process of compiling, testing, and packaging code changes
A build pipeline automates compiling, running tests, and packaging code so that integration issues are detected quickly and consistently.
Question 2: In a CI/CD workflow, what does 'trunk-based development' emphasize?
- Maintaining long-lived feature branches for stability
- Developers committing to a single shared branch frequently (Correct answer)
- Avoiding merges until the end of a sprint
- Using separate repositories for each team
Correct answer: Developers committing to a single shared branch frequently
Trunk-based development encourages frequent commits to a single main branch to reduce merge conflicts and enable continuous integration.
Question 3: Which practice helps ensure that a deployment can be safely rolled back in a continuous delivery pipeline?
- Deleting previous build artifacts after each deployment
- Using blue-green or canary deployment strategies (Correct answer)
- Disabling monitoring during deployments to reduce noise
- Deploying only during weekends when traffic is low
Correct answer: Using blue-green or canary deployment strategies
Blue-green and canary deployments allow quick rollback by maintaining a previous stable environment alongside the new release.
Question 4: What is a 'flaky test' in the context of continuous integration?
- A test that consistently fails due to a known bug
- A test that produces inconsistent pass/fail results without code changes (Correct answer)
- A test that runs too slowly to include in the pipeline
- A test written without assertions
Correct answer: A test that produces inconsistent pass/fail results without code changes
A flaky test intermittently passes or fails on the same code, undermining confidence in CI results and slowing down development.
Question 5: Why should database schema migrations be backward-compatible in a continuous delivery environment?
- Because databases cannot handle schema changes during uptime
- To allow the previous application version to function during a rolling deployment (Correct answer)
- To avoid needing automated testing for database changes
- Because agile teams never modify database schemas
Correct answer: To allow the previous application version to function during a rolling deployment
Backward-compatible migrations ensure that both old and new application versions can run simultaneously during a rolling or staged deployment.
Question 6: What role does a container registry play in a CI/CD pipeline?
- It stores and versions built container images for consistent deployment across environments (Correct answer)
- It replaces the need for version control systems
- It monitors application performance in production
- It manages developer access permissions to the codebase
Correct answer: It stores and versions built container images for consistent deployment across environments
A container registry stores versioned container images so that the exact same artifact built in CI can be deployed consistently to any environment.
What is the primary purpose of a build pipeline in continuous integration?