Web Development Deployment 5 — Questions and Answers
Question 1: What is a 'smoke test' in the context of deployment?
- A performance test that pushes a server to its CPU limits
- A quick set of basic checks to verify a deployment didn't break core functionality (Correct answer)
- A security scan run before code reaches production
- A test that simulates real user load on the new deployment
Correct answer: A quick set of basic checks to verify a deployment didn't break core functionality
Smoke tests are lightweight sanity checks run immediately after deployment to confirm the application starts and core paths work.
Question 2: What is the purpose of environment-specific .env files in deployment?
- To version control all secrets alongside source code
- To provide environment-specific configuration values without hardcoding them in source (Correct answer)
- To define which npm scripts run during the build step
- To configure which Node.js version is used in each environment
Correct answer: To provide environment-specific configuration values without hardcoding them in source
.env files store configuration like database URLs and API keys per environment, keeping them out of source code.
Question 3: In Kubernetes, what is a 'Pod'?
- A persistent storage volume attached to a node
- The smallest deployable unit, consisting of one or more containers sharing network and storage (Correct answer)
- A load balancer that routes traffic to deployments
- A YAML file that describes a desired deployment state
Correct answer: The smallest deployable unit, consisting of one or more containers sharing network and storage
A Pod is the atomic unit in Kubernetes, wrapping one or more tightly coupled containers that share an IP address and volumes.
Question 4: What does 'immutable infrastructure' mean in deployment?
- Servers that cannot be restarted once deployed
- Infrastructure components are never modified after deployment; they are replaced with new instances (Correct answer)
- Deployment configurations that require admin approval to change
- Containers that mount read-only filesystems only
Correct answer: Infrastructure components are never modified after deployment; they are replaced with new instances
Immutable infrastructure replaces rather than patches servers, ensuring consistency and eliminating configuration drift.
Question 5: Which tool is used to define and provision multi-cloud infrastructure as code?
- Webpack
- Terraform (Correct answer)
- PM2
- Ansible
Correct answer: Terraform
Terraform is a provider-agnostic IaC tool that manages cloud resources across AWS, GCP, Azure, and others via declarative config files.
Question 6: What happens when a Kubernetes Deployment's replica count is set to 3?
- The cluster creates one pod and mirrors it to two read replicas
- Kubernetes ensures exactly 3 identical pod instances are running at all times (Correct answer)
- The deployment runs 3 times before requiring manual restart
- Three separate deployments are created in different namespaces
Correct answer: Kubernetes ensures exactly 3 identical pod instances are running at all times
Setting replicas: 3 tells the ReplicaSet controller to maintain exactly three running pods, restarting any that fail.
Question 7: What is the main advantage of using a managed platform like Vercel or Heroku over self-managed servers?
- They provide dedicated CPU cores not available on bare metal
- They abstract infrastructure management, handling scaling, SSL, and deployments automatically (Correct answer)
- They offer lower latency than self-hosted solutions in all cases
- They allow direct SSH access to the underlying virtual machine
Correct answer: They abstract infrastructure management, handling scaling, SSL, and deployments automatically
Managed platforms handle provisioning, scaling, and operations so developers focus on code rather than infrastructure.
What is a 'smoke test' in the context of deployment?