"Docker vs Kubernetes" is a category error worth correcting cleanly. This unit gives you just enough deployment vocabulary to sound credible without going down an ops rabbit hole.
A container packages your app with its dependencies into a portable, isolated unit that runs identically on any host — fixing "works on my machine." Docker is the common tool to build and run them. Containers are lightweight (they share the host kernel) so you can pack many per machine and start them in seconds.
Once you have dozens of containers across many machines, you need something to manage them. Kubernetes (and managed options like EKS/GKE) provides:
| Capability | What it does |
|---|---|
| Scheduling / bin-packing | Places containers on nodes with capacity. |
| Self-healing | Restarts crashed containers; reschedules off dead nodes. |
| Horizontal autoscaling | Adds/removes replicas based on CPU/custom metrics (ties to Unit 09). |
| Service discovery + LB | Stable virtual addresses; spreads traffic across replicas. |
| Rolling deploys / rollback | Ship new versions gradually; revert on failure — zero downtime. |
| Config & secrets | Inject environment per deployment without rebaking images. |
Kubernetes is powerful and complex. For a small service or early stage, a managed platform (a PaaS, serverless functions, or a simple container service like ECS Fargate / Cloud Run) gets you autoscaling and rollouts with far less operational burden. The mature answer in an interview isn't "Kubernetes everything" — it's matching the tool to the scale.
"Each service is containerized with Docker and runs on Kubernetes (managed, e.g., EKS). I declare desired replicas; the cluster schedules them across nodes, restarts failures, and autoscales on load. Deploys are rolling with automatic rollback. A load balancer / ingress fronts the API pods, and stateless services let me scale horizontally. Stateful pieces (databases, caches) run as managed services or carefully-managed stateful sets."
In two sentences, describe how you'd host the photo app: what's containerized, how it autoscales under a traffic spike, how you deploy a new version safely, and which components you'd run as managed services instead of self-hosting on Kubernetes.