Interview Q&A / Docker & Kubernetes

INTERVIEW Q&A · 67 QUESTIONS

Docker & Kubernetes interview questions

Images, containers, Dockerfiles, pods and deployments, from first principles.

  1. A Kubernetes Service is not routing traffic to your Pods. How do you debug it?

    Check kubectl get endpoints for the Service. If it is empty, the Service selector does not match the Pod labels, or the Pods are not ready. Also verify targetPort matches the container port.

    IntermediateQuick answer1 min read
  2. How can you see what is making up the size of a Docker image?

    docker history lists every layer with its command and size. For file-level detail, the open-source tool dive shows what each layer adds or wastes, which helps you spot big leftovers.

    IntermediateQuick answer1 min read
  3. You created an Ingress but nothing works. What could be missing?

    Usually no Ingress controller is installed, so no one reads the rules. Also check ingressClassName, that the backend Service and port exist, DNS pointing to the controller's address, and that Pods are ready.

    IntermediateQuick answer1 min read