DevOps MCQs - Kubernetes and CI/CD (Set 2)

DevOps MCQs - Kubernetes and CI/CD (Set 2) - CodingHumans

Once you know Docker, the next interview questions are usually about running containers at scale and taking code from a commit to production. This second DevOps set covers the main Kubernetes objects, health probes and autoscaling, and then CI/CD terms, deployment strategies and GitHub Actions basics.

How to practise: read each question and tap the option you think is correct. You will see right away whether you got it, along with a short explanation, and your score is tracked at the bottom of the screen. This set has 15 questions.

DevOps MCQ series: | Interview Preparation Hub

Topics covered in this set

  • Pods, Deployments and ReplicaSets
  • Services: ClusterIP, NodePort, LoadBalancer and Ingress
  • ConfigMaps and Secrets
  • Liveness and readiness probes, HPA
  • Rolling updates, blue-green and canary releases
  • CI, continuous delivery and GitHub Actions

DevOps MCQs with answers and explanations

Q1. What is a Pod in Kubernetes?

a) A physical server in the cluster

b) The smallest deployable unit, made of one or more containers that share a network namespace and storage volumes

c) A group of nodes

d) A Docker image registry

Q2. A pod managed by a Deployment with replicas: 3 is deleted manually. What happens?

a) The Deployment is deleted too

b) The application stays at 2 pods until someone redeploys

c) Its ReplicaSet notices only 2 pods are running and creates a new one

d) The whole node restarts

Q3. Which Service type exposes an app only inside the cluster on a stable virtual IP?

a) ClusterIP

b) ExternalName

c) LoadBalancer

d) NodePort

Q4. What does a NodePort Service do?

a) Opens the same port, by default in the range 30000–32767, on every node and forwards traffic to the Service

b) Assigns a public DNS name

c) Runs the pod on a specific node

d) Creates a cloud load balancer automatically

Q5. Ten HTTP services must be exposed under one domain with path-based routing and TLS. What is the usual Kubernetes choice?

a) An Ingress resource handled by an ingress controller such as NGINX or Traefik

b) A ConfigMap with routing rules

c) One LoadBalancer Service per app

d) A NodePort for each app

Q6. Which statement about Kubernetes Secrets is correct?

a) Secrets are always encrypted with a key only the pod knows

b) Secrets cannot be mounted as files

c) By default Secret values are only base64-encoded in etcd, so encryption at rest and RBAC should be configured

d) Secrets and ConfigMaps are stored in different databases

Q7. What happens when a container's liveness probe keeps failing?

a) Nothing, it is only logged

b) The kubelet kills and restarts the container

c) The node is drained

d) The pod is removed from Service endpoints but keeps running

Q8. What happens when a pod's readiness probe fails?

a) The pod is deleted

b) The container is restarted

c) The Deployment is rolled back

d) The pod stops receiving traffic from Services until the probe passes again

Q9. A Horizontal Pod Autoscaler targets 50% average CPU. Three pods are running at 80% average CPU. About how many replicas will it ask for?

a) 3

b) 8

c) 5

d) 4

Q10. During a rolling update of a Deployment, what do maxSurge and maxUnavailable control?

a) How many extra pods may be created and how many pods may be unavailable at a time while old pods are replaced

b) Memory and CPU limits

c) How long logs are kept

d) The number of nodes added

Q11. What is the difference between continuous delivery and continuous deployment?

a) Continuous delivery only builds code and never deploys

b) In continuous delivery every change is kept ready to release but production deploys need a manual approval; in continuous deployment passing changes go to production automatically

c) They are the same

d) Continuous deployment skips automated tests

Q12. How does a blue-green deployment work?

a) Old pods are replaced one by one

b) Traffic is shifted to the new version one user at a time over a week

c) The new version is tested only on developers' laptops

d) Two full environments run side by side, and traffic is switched from the old (blue) to the new (green) all at once, with a quick switch back if needed

Q13. What is a canary release?

a) Running tests in a separate CI job

b) Deleting the old version before deploying the new one

c) Sending a small percentage of real traffic to the new version, watching metrics, then increasing the share if it is healthy

d) Deploying only on Fridays

Q14. In GitHub Actions, where are workflow files stored, and how do jobs in a workflow run by default?

a) In .github/actions; jobs run only on the main branch

b) In a separate repository; jobs run only manually

c) In the repository root as actions.json; jobs always run one after another

d) In .github/workflows as YAML files; jobs run in parallel unless needs: sets a dependency

Q15. How should a GitHub Actions workflow use a deployment API key?

a) Write it in the workflow YAML file

b) Commit it in a .env file

c) Store it as a repository or environment secret and reference it with ${{ secrets.DEPLOY_KEY }}

d) Print it in a step so it can be copied later

Quick revision notes

  • Pod = smallest unit; Deployment → ReplicaSet → Pods, reconciled to the desired count.
  • ClusterIP is internal; NodePort opens a port on every node; LoadBalancer gets a cloud LB; Ingress routes HTTP by host and path.
  • By default Secrets are only base64, not encrypted. Turn on encryption at rest and RBAC.
  • Liveness failure restarts the container; readiness failure removes it from traffic.
  • HPA: ceil(replicas × current ÷ target). Blue-green switches all traffic; canary shifts a small share first.

Frequently asked questions

Do I need to know Kubernetes for a developer role?

Know the basics: pods, Deployments, Services, ConfigMaps, probes, and how to read logs with kubectl. Running and tuning the cluster itself is usually the platform or DevOps team's job.

What does a typical CI pipeline for a Node.js app include?

Install dependencies (with a cache), lint, run tests and build. Then build and scan a Docker image, push it to a registry, and deploy to staging and then production.

Rolling update, blue-green or canary: which should I use?

Rolling updates are the Kubernetes default and work for most apps. Blue-green gives instant rollback, but costs double while both run. Canary keeps risk low for busy services, as long as you have good metrics to watch.

Comments

Answered 0/0Correct 0