Sample questions
Question 1Easy
Which probe mechanisms does Kubernetes support?
- HTTP GET, TCP socket, exec and gRPC
- Only ping (ICMP)
- SSH login and FTP transfer of a health file
- Only HTTP GET
Answer: A. HTTP GET, TCP socket, exec and gRPC
Explanation
Exec probes run a command in the container and succeed on exit code 0.
Step-by-step solution
- Kubernetes supports HTTP GET, TCP socket, exec, and gRPC for probe mechanisms.
- These are the standard methods used to check container health.
- Exec probes run a command in the container and succeed on exit code 0.
- GRPC is also supported as a probe mechanism.
- TCP socket checks if the port is open.
- The correct answer is HTTP GET, TCP socket, exec and gRPC.
Why the other options are wrong
- B. ICMP ping is not a probe mechanism Kubernetes uses; the supported types are HTTP, TCP, exec and gRPC.
- C. SSH and FTP are not probe types; Kubernetes does not log in to the container to check health.
- D. HTTP GET is only one of the supported probe types; TCP socket, exec and gRPC are also available.
Tip: Remember the main probe types: HTTP GET, TCP socket, exec, and gRPC.
Question 2Easy
Which probe should decide whether a Pod receives user traffic?
- No probe; traffic always flows
- Readiness probe
- Startup probe
- Liveness probe
Answer: B. Readiness probe
Explanation
Readiness gates Service endpoints; liveness only decides restarts.
Step-by-step solution
- A readiness probe checks whether a pod can serve requests.
- A failing readiness probe removes the pod from Service endpoints, so it gets no traffic.
- Option B decides whether traffic flows, so it is correct.
Why the other options are wrong
- A. Traffic is gated by the readiness probe, so it does not always flow.
- C. A startup probe holds off other probes while the app boots.
- D. A liveness probe decides restarts, not traffic.
Tip: Readiness = traffic; liveness = restart; startup = slow boot.
Question 3Easy
A container's process is still running but deadlocked, so it serves nothing. What does a failing liveness probe cause?
- The kubelet restarts the container
- The Pod only stops receiving traffic
- The Deployment is rolled back
- Nothing happens
Answer: A. The kubelet restarts the container
Explanation
Liveness detects a stuck process and restarts it.
Step-by-step solution
- Liveness probe checks if the container is alive.
- If it fails, kubelet restarts the container.
- This ensures the process is not deadlocked.
- Container gets restarted to resolve deadlock.
- Final answer: The kubelet restarts the container.
Why the other options are wrong
- B. Only traffic stops with a readiness failure; a liveness failure is what makes kubelet restart the container.
- C. A failing liveness probe does not roll back the Deployment; the kubelet restarts the container instead.
- D. Nothing happening is wrong: a failed liveness probe is exactly what makes the kubelet restart a stuck container.
Tip: Failing liveness probe triggers container restart.
Question 4Easy
Which result counts as success for an HTTP GET probe?
- Only a 204 No Content
- Any response at all, including a 500 error
- Only exactly 200
- A status code from 200 to 399
Answer: D. A status code from 200 to 399
Explanation
Kubernetes treats 2xx and 3xx as success; anything else, or a timeout, is a failure.
Step-by-step solution
- HTTP GET probe checks the status code.
- Status codes 200 to 399 are considered success.
- 2xx and 3xx are treated as success by Kubernetes.
- So, a status code from 200 to 399 counts as success.
- Final answer: A status code from 200 to 399.
Why the other options are wrong
- A. Only 204 is not the rule; any 2xx or 3xx status counts as success for an HTTP GET probe.
- B. A 500 error is a failure; success needs a status from 200 to 399, not any response.
- C. Exactly 200 is too strict; 201, 204 and 3xx redirects also count as success.
Tip: Remember 2xx and 3xx are success for HTTP probes.
Question 5Medium
A liveness probe has periodSeconds: 10 and failureThreshold: 3. Roughly how long after the app hangs is it restarted?
- About 10 seconds
- About 13 seconds
- About 3 seconds
- About 30 seconds
Answer: D. About 30 seconds
Explanation
Three consecutive failures 10 seconds apart are needed: about 30 seconds.
Step-by-step solution
- PeriodSeconds 10 means the probe runs every 10 seconds.
- FailureThreshold 3 means three failures in a row are needed before a restart.
- Failures at about 10, 20 and 30 seconds lead to a restart at about 30 seconds. The correct answer is option D.
Why the other options are wrong
- A. One failed probe, about 10 seconds in, is not enough; three in a row are needed.
- B. The answer ignores the 10-second gap between the three failed probes.
- C. 3 is the failure count, not a number of seconds.
Tip: Time to restart is roughly periodSeconds times failureThreshold.
Question 6Medium
One of three replicas behind a Service starts failing its readiness probe. What do users experience?
- About one third of requests fail with errors until it recovers
- The Service is deleted and recreated
- Requests go only to the two ready replicas
- Every request fails until all three replicas are ready again
Answer: C. Requests go only to the two ready replicas
Explanation
Unready Pods are removed from the Service's endpoints, so traffic shifts to healthy replicas.
Step-by-step solution
- Unready Pods are removed from the Service's endpoints.
- Traffic is redirected to the remaining ready replicas.
- Only two replicas are available, so requests go only to them.
- The failing replica does not receive any traffic.
- Final answer: Requests go only to the two ready replicas.
Why the other options are wrong
- A. Requests do not fail one-third of the time, because the unready replica gets no traffic.
- B. The Service is not deleted; it keeps running and simply removes the unready Pod from endpoints.
- D. Requests do not all fail; the ready replicas keep serving, and the unready Pod gets no traffic.
Tip: Remember: Kubernetes routes traffic only to ready replicas.
Question 7Medium
During a rolling update, why do readiness probes matter?
- They delete old ReplicaSets
- They skip health checks during deploys so the rollout completes sooner
- New Pods get traffic only once ready
- They make images download faster
Answer: C. New Pods get traffic only once ready
Explanation
A new version that never becomes ready stalls the rollout instead of taking traffic.
Step-by-step solution
- Readiness probes ensure new Pods are healthy before getting traffic.
- If a Pod isn't ready, it doesn't receive any requests.
- This prevents unready Pods from handling user traffic.
- Only once a Pod passes readiness checks does it start receiving traffic.
- New Pods get traffic only once ready.
Why the other options are wrong
- A. Old ReplicaSets are removed by the Deployment controller, not by readiness probes.
- B. Readiness probes do not skip health checks; they are what checks a new Pod before it gets traffic.
- D. Readiness probes do not speed up image downloads; image pulls happen before any probe runs.
Question 8Medium
What is a startup probe for?
- Checking readiness after every request the container serves
- Pulling the image faster
- Holding off liveness checks until a slow app starts
- Running database migrations
Answer: C. Holding off liveness checks until a slow app starts
Explanation
Until the startup probe succeeds, liveness and readiness are disabled, so slow starters are not killed early.
Step-by-step solution
- Startup probe tells Kubernetes to wait until app is ready.
- Liveness and readiness checks are paused during this time.
- This stops the app from being killed before it starts properly.
- Slow apps need more time to initialize.
- Startup probe delays liveness checks until app is running.
- Final answer: Holding off liveness checks until a slow app starts.
Why the other options are wrong
- A. Readiness is checked by readiness probes on a schedule, not per request; a startup probe is only for slow starts.
- B. Image pulls are not sped up by a startup probe; that is a registry or node matter.
- D. Migrations are run by Jobs or init containers; a startup probe only checks whether the app has started.
Tip: Use startup probe for apps that take time to initialize.
Question 9Hard
A liveness probe checks whether the shared database is reachable. The database has a brief outage. What happens?
- Every Pod restarts at once, worsening the outage
- Traffic is routed to the database replica automatically by the kubelet
- Nothing; liveness ignores dependencies
- Only one Pod restarts
Answer: A. Every Pod restarts at once, worsening the outage
Explanation
Liveness should check only the process itself; dependency checks belong (carefully) in readiness.
Step-by-step solution
- A failing liveness probe makes the kubelet restart the container.
- This probe checks the shared database, so every Pod fails at the same time during the outage.
- All Pods restart together, adding load and worsening the outage.
- The correct answer is option A, every Pod restarts at once.
Why the other options are wrong
- B. A liveness probe restarts containers; it does not route traffic to a database replica.
- C. A liveness probe acts on whatever it checks, so a database check makes it fail.
- D. All Pods run the same check and fail together, so not just one restarts.
Tip: Liveness checks the process itself; put dependency checks in readiness.
Question 10Hard
During shutdown, why might an app deliberately start failing its readiness probe after receiving SIGTERM?
- To trigger a restart
- To stop new traffic while it finishes in-flight work
- To force a rollback of the Deployment to its previous revision
- To make Kubernetes skip the grace period
Answer: B. To stop new traffic while it finishes in-flight work
Explanation
Becoming unready drains new traffic so the Pod can exit cleanly within the grace period.
Step-by-step solution
- SIGTERM tells the app to shut down gracefully.
- Failing the readiness probe stops new traffic from entering the Pod.
- This lets the app finish existing tasks before exiting.
- The app can then terminate cleanly within the grace period.
- This ensures no new work starts during shutdown.
Why the other options are wrong
- A. Failing readiness does not trigger a restart; restarts are caused by liveness probe failures.
- C. A readiness failure does not roll back the Deployment; it only stops new traffic to this Pod.
- D. Readiness does not change the grace period; the period is set by terminationGracePeriodSeconds, not by probes.
Tip: Readiness probe failure during shutdown blocks new traffic for clean exit.
Practise all 13 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 →