Full-Stack Development Full-Stack Development DevOps, CI/CD & Cloud Deployment 2 — Questions and Answers
Question 1: What is the goal of Continuous Integration (CI) in software development?
- Continuously integrating third-party APIs into the codebase
- Automatically building and testing code on every commit to detect integration issues early (Correct answer)
- Deploying code to production on every merge
- Monitoring production application uptime continuously
Correct answer: Automatically building and testing code on every commit to detect integration issues early
CI pipelines automatically run builds and tests whenever code is pushed, giving teams fast feedback and catching bugs before they reach the main branch.
Question 2: Which file format does GitHub Actions use to define CI/CD workflows?
- JSON (.json)
- YAML (.yml) (Correct answer)
- TOML (.toml)
- XML (.xml)
Correct answer: YAML (.yml)
GitHub Actions workflows are defined in YAML files stored in .github/workflows/, specifying triggers, jobs, and steps for automated pipelines.
Question 3: What is the difference between Continuous Delivery and Continuous Deployment?
- They are the same term used interchangeably
- Continuous Delivery automates up to a manual approval gate; Continuous Deployment deploys to production automatically without manual approval (Correct answer)
- Continuous Delivery deploys to production; Continuous Deployment stops at staging
- Continuous Delivery covers testing; Continuous Deployment covers building
Correct answer: Continuous Delivery automates up to a manual approval gate; Continuous Deployment deploys to production automatically without manual approval
Continuous Delivery ensures code is always releasable and may require a human click to deploy; Continuous Deployment goes further by automatically deploying every passing build to production.
Question 4: What is a 'build artifact' in a CI/CD pipeline?
- A bug introduced during the build process
- The compiled output (binary, bundle, container image) produced by the build step and used in subsequent deployment steps (Correct answer)
- A log file generated by the build server
- A Git tag applied to a successful commit
Correct answer: The compiled output (binary, bundle, container image) produced by the build step and used in subsequent deployment steps
Build artifacts are the compiled, bundled, or packaged outputs of a build job, passed to later pipeline stages like testing, staging deployment, or production release.
Question 5: What does a 'blue-green deployment' strategy achieve?
- Deploying to blue environments in US datacenters and green in EU datacenters
- Running two identical production environments where traffic is switched from the old (blue) to the new (green) version with zero downtime (Correct answer)
- Color-coding deployments for different feature branches
- Using blue for frontend and green for backend deployments
Correct answer: Running two identical production environments where traffic is switched from the old (blue) to the new (green) version with zero downtime
Blue-green deployment maintains two identical environments; the new version is deployed to green while blue serves traffic, then the load balancer switches traffic to green, enabling instant rollback if issues arise.
Question 6: What is the purpose of environment variables in a deployed application?
- To configure the shell environment of the developer's machine
- To store configuration values like API keys and database URLs separately from code, enabling the same code to run in different environments (Correct answer)
- To define CSS variables for theming
- To set hardware resource limits for the process
Correct answer: To store configuration values like API keys and database URLs separately from code, enabling the same code to run in different environments
Environment variables externalize configuration from code, allowing the same Docker image or build artifact to behave differently in dev, staging, and production by injecting environment-specific values at runtime.
What is the goal of Continuous Integration (CI) in software development?