Web Development Deployment 4 — Questions and Answers
Question 1: What is the purpose of semantic versioning (SemVer) in deployments?
- To generate unique hashes for each build artifact
- To communicate the nature of changes via MAJOR.MINOR.PATCH version numbers (Correct answer)
- To automatically deploy only semantic changes to production
- To validate that code comments match the version in package.json
Correct answer: To communicate the nature of changes via MAJOR.MINOR.PATCH version numbers
SemVer uses MAJOR (breaking), MINOR (new features), and PATCH (bug fixes) numbers to signal change impact to consumers.
Question 2: Which deployment artifact format does AWS Lambda primarily execute?
- Docker images or ZIP archives containing function code and dependencies (Correct answer)
- Raw .js files pushed directly via the AWS CLI
- TAR archives uploaded to S3 and compiled in real time
- Git repositories cloned on invocation
Correct answer: Docker images or ZIP archives containing function code and dependencies
Lambda accepts either a ZIP package with code and dependencies or a container image stored in ECR.
Question 3: What problem does a container registry (like Docker Hub or ECR) solve?
- Running containers locally without Docker Desktop
- Storing, versioning, and distributing container images to deployment targets (Correct answer)
- Monitoring container CPU and memory usage in production
- Generating Dockerfiles from application source code automatically
Correct answer: Storing, versioning, and distributing container images to deployment targets
A container registry is a centralized store where teams push images and deployment systems pull them to run containers.
Question 4: What is a deployment pipeline's 'artifact' stage responsible for?
- Running integration tests against a live database
- Packaging the built application into a deployable unit (e.g., ZIP, image, tarball) (Correct answer)
- Notifying the team via Slack when a deploy is complete
- Rotating secrets and API keys before release
Correct answer: Packaging the built application into a deployable unit (e.g., ZIP, image, tarball)
The artifact stage compiles and packages the application so the same immutable bundle can be promoted through environments.
Question 5: Which strategy allows you to test a new feature with 10% of real users without a full deployment?
- Blue-green deployment
- Feature flags (Correct answer)
- Hotfix branch deployment
- Rolling restart
Correct answer: Feature flags
Feature flags let you toggle features on for a percentage of users without deploying new code for each change.
Question 6: What does `kubectl apply -f deployment.yaml` do?
- Validates the YAML syntax without making any changes to the cluster
- Creates or updates Kubernetes resources defined in the YAML file (Correct answer)
- Deletes all resources matching the YAML specification
- Runs the deployment in dry-run mode only
Correct answer: Creates or updates Kubernetes resources defined in the YAML file
`kubectl apply` is declarative — it creates resources that don't exist and updates those that do based on the YAML spec.
Question 7: What is the role of a CDN (Content Delivery Network) in web deployment?
- Replacing the origin server with a distributed database
- Caching and serving static assets from edge locations geographically closer to users (Correct answer)
- Compiling JavaScript bundles closer to the end user
- Managing SSL certificate renewal across all deployment regions
Correct answer: Caching and serving static assets from edge locations geographically closer to users
A CDN caches static content at edge nodes worldwide, reducing latency by serving assets from locations near the user.
What is the purpose of semantic versioning (SemVer) in deployments?