Interview Q&A / Docker & Kubernetes

INTERVIEW Q&A · 67 QUESTIONS

Docker & Kubernetes interview questions

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

  1. Explain the main parts of a Kubernetes Deployment YAML.

    apiVersion and kind identify the object, metadata names it, spec.replicas sets the count, spec.selector says which Pods it owns, and spec.template is the Pod blueprint whose labels must match the selector.

    BeginnerQuick answer1 min read
  2. What is a ReplicaSet and how does it relate to a Deployment?

    A ReplicaSet keeps a specified number of identical Pods running, replacing any that die. A Deployment manages ReplicaSets, creating a new one for each version to enable rolling updates and rollbacks.

    BeginnerQuick answer1 min read
  3. What is the difference between RollingUpdate and Recreate deployment strategies?

    RollingUpdate replaces Pods gradually so the app stays available. Recreate kills all old Pods first and then starts new ones, causing downtime but guaranteeing two versions never run together.

    IntermediateQuick answer1 min read