Sample questions
Question 1Easy
What do PersistentVolumeClaims (PVCs) do?
- Limit CPU usage
- Request storage that outlives individual Pods
- Store container images
- Define network policies that control traffic between namespaces
Answer: B. Request storage that outlives individual Pods
Explanation
A Pod mounts a PVC; the claim binds to a PersistentVolume, often provisioned dynamically by a StorageClass.
Step-by-step solution
- A Pod's own storage is lost when the Pod goes away unless it uses a claim.
- A PersistentVolumeClaim asks for storage that is kept separate from the Pod.
- The correct answer is option B, request storage that outlives individual Pods.
Why the other options are wrong
- A. CPU limits are set on the container, not by a PVC.
- C. Container images are stored in a registry, not in a PVC.
- D. Network policies control traffic and are unrelated to storage claims.
Tip: A PVC is a request for storage; the Pod mounts it.
Question 2Easy
kubectl apply -f deploy.yaml is called declarative because:
- It applies only to a single Pod at a time, never to a whole set of resources
- You state the desired state; controllers reconcile it
- It runs commands one by one in order
- It always deletes and recreates everything
Answer: B. You state the desired state; controllers reconcile it
Explanation
Re-applying the same file is safe; controllers converge the cluster to match the manifest.
Step-by-step solution
- A declarative manifest describes the desired end state.
- Controllers keep comparing the actual state with that description and fix any difference.
- The correct answer is option B, you state the desired state and controllers reconcile it.
Why the other options are wrong
- A. Kubectl apply can handle many resources in one file, not just one Pod.
- C. Declarative tools describe the end state, not a list of commands run in order.
- D. Apply updates resources in place; it does not delete and recreate everything.
Tip: Declarative = describe the result, not the steps.
Question 3Easy
Which object runs a batch task until it completes successfully?
- Deployment
- Job
- Service
- Ingress
Answer: B. Job
Explanation
A Job creates Pods that run to completion; a CronJob creates Jobs on a schedule.
Step-by-step solution
- A Job runs Pods until the task completes.
- It retries failures.
- Deployments keep Pods running forever.
Why the other options are wrong
- A. Deployment is for long-running apps.
- C. Service exposes Pods.
- D. Ingress routes traffic.
Tip: Batch = Job.
Question 4Easy
How do Deployments, ReplicaSets and Pods relate?
- A Deployment manages ReplicaSets, which manage Pods
- A ReplicaSet manages Deployments
- They are independent objects that only share a naming convention in kubectl output
- A Pod manages Deployments
Answer: A. A Deployment manages ReplicaSets, which manage Pods
Explanation
Each rollout creates a new ReplicaSet; the Deployment shifts replicas between old and new ReplicaSets.
Step-by-step solution
- A Deployment manages ReplicaSets.
- ReplicaSets manage Pods.
- Rolling updates create new ReplicaSets.
Why the other options are wrong
- B. The direction is reversed.
- C. They are related.
- D. Pods do not manage others.
Tip: Deployment, ReplicaSet, Pod.
Question 5Medium
Which workload object is designed for databases needing stable network names and per-replica storage?
- Deployment
- Job
- StatefulSet
- DaemonSet
Answer: C. StatefulSet
Explanation
StatefulSet pods get stable identities (db-0, db-1) and their own persistent volume claims, created in order.
Step-by-step solution
- A database needs stable pod names and its own storage for each replica.
- A StatefulSet gives pods stable identities and a separate volume claim for each pod.
- The correct answer is option C, StatefulSet.
Why the other options are wrong
- A. A Deployment suits stateless apps whose pods are interchangeable.
- B. A Job runs pods until they complete; it is not for a long-running database.
- D. A DaemonSet runs one pod per node, not one pod per replica with stable storage.
Tip: Stateful = StatefulSet; stateless = Deployment.
Question 6Medium
What happens when a container exceeds its memory limit?
- The node reboots
- Kubernetes adds more memory automatically
- It is OOMKilled and restarted
- It is throttled but keeps running
Answer: C. It is OOMKilled and restarted
Explanation
Memory cannot be throttled, so the kernel kills the process; CPU over the limit is throttled instead.
Step-by-step solution
- Memory limit reached triggers OOM Killer.
- OOMKiller terminates the container's process.
- Container gets restarted by Kubernetes.
- Final state is OOMKilled and restarted.
- Answer: It is OOMKilled and restarted.
Why the other options are wrong
- A. A container exceeding its memory limit does not reboot the node; only the container is affected.
- B. Kubernetes does not add memory when a limit is hit; the limit is a cap that stays fixed.
- D. Going over a memory limit is not throttling; throttling is for CPU, and memory overuse ends in OOMKilled.
Tip: Remember OOMKiller kills containers over memory limits in Kubernetes.
Question 7Medium
What happens when a container tries to use more CPU than its limit?
- It is moved to another node
- Its memory limit is raised
- It is killed immediately
- It is throttled
Answer: D. It is throttled
Explanation
CPU is compressible; the container gets less CPU time but keeps running, which can raise latency.
Step-by-step solution
- CPU is a compressible resource.
- When a container reaches its CPU limit, it is throttled and gets less CPU time.
- It keeps running, which can raise latency. The correct answer is option D, it is throttled.
Why the other options are wrong
- A. The container is not moved to another node because of CPU use.
- B. The memory limit is not raised when CPU is capped.
- C. Containers are killed for exceeding memory limits, not CPU limits.
Tip: CPU over limit = throttled; memory over limit = the container is killed.
Question 8Medium
A ConfigMap is injected into a Pod as environment variables, then the ConfigMap is edited. What happens?
- Running Pods keep old values until they restart
- Env vars update instantly in running containers
- The Pod is deleted automatically
- The ConfigMap edit is rejected while Pods use it
Answer: A. Running Pods keep old values until they restart
Explanation
Environment variables are set at container start; mounted ConfigMap files update eventually, but env vars do not.
Step-by-step solution
- Environment variables are set when the Pod starts.
- Editing the ConfigMap after startup does not change existing environment variables.
- Running Pods retain old values until they restart.
- The edit is applied to new Pods only.
- Final answer: Running Pods keep old values until they restart.
Why the other options are wrong
- B. Environment variables are fixed at container start, so an edit does not reach running containers instantly.
- C. Editing a ConfigMap does not delete Pods; they keep running with their existing environment.
- D. The ConfigMap edit is allowed; Kubernetes does not block changes because Pods are using it.
Tip: Env vars stay as set; edits affect new Pods only.
Question 9Hard
A headless Service (clusterIP: None) is used when:
- You want to disable the Service's selector
- You want an external cloud load balancer in front of the Pods
- Clients need individual Pod IPs via DNS
- You want to hide all Pods from DNS
Answer: C. Clients need individual Pod IPs via DNS
Explanation
DNS returns Pod addresses directly instead of one virtual IP, letting clients reach specific replicas.
Step-by-step solution
- A normal Service gives one virtual IP and load-balances across its pods.
- A headless Service sets clusterIP to None.
- DNS then returns the individual pod addresses, so clients can reach specific replicas.
- The correct answer is option C, clients need individual Pod IPs via DNS.
Why the other options are wrong
- A. A headless Service still uses its selector to find the pods.
- B. An external cloud load balancer comes from a LoadBalancer Service, not a headless one.
- D. A headless Service does not hide pods; DNS lists their addresses.
Tip: ClusterIP: None means DNS returns the pod IPs.
Question 10Hard
Why must containers declare CPU requests for an HPA scaling on CPU utilisation?
- Requests are needed to pull the image
- The HPA reads requests to choose which node each new replica should be placed on
- Without requests, Pods cannot get IP addresses
- Utilisation is a percentage of the request
Answer: D. Utilisation is a percentage of the request
Explanation
With no request, there is no baseline to compute a percentage from, so the HPA cannot act.
Step-by-step solution
- CPU utilisation is measured as a percentage.
- The percentage is of the container's CPU request.
- Without a request there is no base.
Why the other options are wrong
- A. Pulling images is unrelated.
- B. The scheduler uses requests for placement, not the HPA for this.
- C. IPs are unrelated.
Tip: HPA utilisation = usage / request.
Practise all 27 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →