Kubernetes · kubectl interview questions

21 real Kubernetes · kubectl questions from the MLOps & Integration bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What does kubectl get pods -n ml do?

Junior
  1. A.list all Pods in the ml namespace
  2. B.show detailed state and recent events for the Pod named api
  3. C.create or update resources to match the declared YAML manifest
  4. D.stream logs from a Pod managed by the api Deployment
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.kubectl get pods -n ml — list all Pods in the ml namespace
  2. B.kubectl get pods -n ml — show detailed state and recent events for the Pod named api
  3. C.kubectl get pods -n ml — trigger a rolling restart of the api Deployment's Pods
  4. D.kubectl get pods -n ml — create or update resources to match the declared YAML manifest
Reveal the answer + AI explanation — free account

4. What does kubectl describe pod api do?

Junior
  1. A.stream logs from a Pod managed by the api Deployment
  2. B.list all Pods in the ml namespace
  3. C.show detailed state and recent events for the Pod named api
  4. D.change the api Deployment to run five Pod replicas
Reveal the answer + AI explanation — free account

5. Which command will show detailed state and recent events for the Pod named api?

Junior
  1. A.kubectl apply -f manifest.yaml
  2. B.kubectl rollout restart deploy/api
  3. C.kubectl port-forward svc/api 8080:80
  4. D.kubectl describe pod api
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Junior
  1. A.kubectl describe pod api — show detailed state and recent events for the Pod named api
  2. B.kubectl describe pod api — create or update resources to match the declared YAML manifest
  3. C.kubectl describe pod api — change the api Deployment to run five Pod replicas
  4. D.kubectl describe pod api — stream logs from a Pod managed by the api Deployment
Reveal the answer + AI explanation — free account

7. What does kubectl logs -f deploy/api do?

Junior
  1. A.list all Pods in the ml namespace
  2. B.create or update resources to match the declared YAML manifest
  3. C.change the api Deployment to run five Pod replicas
  4. D.stream logs from a Pod managed by the api Deployment
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Junior
  1. A.kubectl logs -f deploy/api — tunnel local port 8080 to port 80 of the api Service for debugging
  2. B.kubectl logs -f deploy/api — stream logs from a Pod managed by the api Deployment
  3. C.kubectl logs -f deploy/api — list all Pods in the ml namespace
  4. D.kubectl logs -f deploy/api — create or update resources to match the declared YAML manifest
Reveal the answer + AI explanation — free account

10. What does kubectl apply -f manifest.yaml do?

Mid
  1. A.create or update resources to match the declared YAML manifest
  2. B.show detailed state and recent events for the Pod named api
  3. C.stream logs from a Pod managed by the api Deployment
  4. D.tunnel local port 8080 to port 80 of the api Service for debugging
Reveal the answer + AI explanation — free account

11. Which command will create or update resources to match the declared YAML manifest?

Mid
  1. A.kubectl port-forward svc/api 8080:80
  2. B.kubectl apply -f manifest.yaml
  3. C.kubectl rollout restart deploy/api
  4. D.kubectl logs -f deploy/api
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.kubectl apply -f manifest.yaml — trigger a rolling restart of the api Deployment's Pods
  2. B.kubectl apply -f manifest.yaml — tunnel local port 8080 to port 80 of the api Service for debugging
  3. C.kubectl apply -f manifest.yaml — change the api Deployment to run five Pod replicas
  4. D.kubectl apply -f manifest.yaml — create or update resources to match the declared YAML manifest
Reveal the answer + AI explanation — free account

13. What does kubectl rollout restart deploy/api do?

Mid
  1. A.tunnel local port 8080 to port 80 of the api Service for debugging
  2. B.trigger a rolling restart of the api Deployment's Pods
  3. C.change the api Deployment to run five Pod replicas
  4. D.show detailed state and recent events for the Pod named api
Reveal the answer + AI explanation — free account

14. Which command will trigger a rolling restart of the api Deployment's Pods?

Mid
  1. A.kubectl rollout restart deploy/api
  2. B.kubectl apply -f manifest.yaml
  3. C.kubectl logs -f deploy/api
  4. D.kubectl port-forward svc/api 8080:80
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Mid
  1. A.kubectl rollout restart deploy/api — stream logs from a Pod managed by the api Deployment
  2. B.kubectl rollout restart deploy/api — show detailed state and recent events for the Pod named api
  3. C.kubectl rollout restart deploy/api — create or update resources to match the declared YAML manifest
  4. D.kubectl rollout restart deploy/api — trigger a rolling restart of the api Deployment's Pods
Reveal the answer + AI explanation — free account

16. What does kubectl scale deploy/api --replicas=5 do?

Mid
  1. A.list all Pods in the ml namespace
  2. B.tunnel local port 8080 to port 80 of the api Service for debugging
  3. C.change the api Deployment to run five Pod replicas
  4. D.trigger a rolling restart of the api Deployment's Pods
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Mid
  1. A.kubectl scale deploy/api --replicas=5 — trigger a rolling restart of the api Deployment's Pods
  2. B.kubectl scale deploy/api --replicas=5 — tunnel local port 8080 to port 80 of the api Service for debugging
  3. C.kubectl scale deploy/api --replicas=5 — change the api Deployment to run five Pod replicas
  4. D.kubectl scale deploy/api --replicas=5 — list all Pods in the ml namespace
Reveal the answer + AI explanation — free account

19. What does kubectl port-forward svc/api 8080:80 do?

Senior
  1. A.list all Pods in the ml namespace
  2. B.tunnel local port 8080 to port 80 of the api Service for debugging
  3. C.create or update resources to match the declared YAML manifest
  4. D.change the api Deployment to run five Pod replicas
Reveal the answer + AI explanation — free account

20. Which command will tunnel local port 8080 to port 80 of the api Service for debugging?

Senior
  1. A.kubectl apply -f manifest.yaml
  2. B.kubectl port-forward svc/api 8080:80
  3. C.kubectl rollout restart deploy/api
  4. D.kubectl scale deploy/api --replicas=5
Reveal the answer + AI explanation — free account

21. Which statement is correct?

Senior
  1. A.kubectl port-forward svc/api 8080:80 — stream logs from a Pod managed by the api Deployment
  2. B.kubectl port-forward svc/api 8080:80 — create or update resources to match the declared YAML manifest
  3. C.kubectl port-forward svc/api 8080:80 — tunnel local port 8080 to port 80 of the api Service for debugging
  4. D.kubectl port-forward svc/api 8080:80 — change the api Deployment to run five Pod replicas
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice Kubernetes · kubectl free