Docker and Kubernetes knowledge has moved from 'DevOps specialist' territory to mainstream SDE expectation at Indian product companies. In 2026, most mid-level and senior backend engineers at companies like Razorpay, Swiggy, and Meesho are expected to understand containerisation and basic orchestration. This guide covers the container and Kubernetes questions you will encounter across backend and DevOps roles at Indian product companies.
Docker Fundamentals
Docker packages an application and its dependencies into a container: a lightweight, isolated environment that runs consistently across different machines. The key problem Docker solves: 'it works on my machine': containers include everything needed to run the application (OS libraries, runtime, dependencies) in a portable format. Core concepts: Image: a read-only template for creating containers (like a class in OOP). Container: a running instance of an image (like an object). Dockerfile: a set of instructions for building an image (FROM, RUN, COPY, EXPOSE, CMD). Docker Hub / registry: public repository for sharing images. Docker Compose: tool for defining and running multi-container applications via a YAML file: your app, database, and Redis cache as separate containers that start together. Key Dockerfile instructions: FROM (base image), RUN (execute command during build: creates a new layer), COPY (copy files from host to image), EXPOSE (document which port the container listens on: does not actually publish the port), ENV (set environment variables), CMD (default command when container starts: can be overridden), ENTRYPOINT (non-overridable command). Docker layer caching: each RUN/COPY/FROM creates a layer; unchanged layers are cached. Put frequently changing layers (COPY source code) AFTER rarely changing layers (RUN npm install) for faster builds.
Containers vs Virtual Machines
The containers vs VMs question appears in almost every DevOps and backend interview. Virtual machines: each VM runs a complete OS on top of a hypervisor. Heavy (GBs of disk, minutes to start). Strong isolation: each VM has its own kernel. Containers: share the host OS kernel. Lightweight (MBs of disk, seconds to start). Process-level isolation via namespaces and cgroups. Containers are not as isolated as VMs: a kernel vulnerability can potentially escape a container. When to use which: containers for microservices, CI/CD environments, and horizontal scaling. VMs for workloads requiring strong security isolation, different OS requirements, or legacy software. In Indian product companies: containers (via Docker + Kubernetes) are the dominant deployment pattern for microservices; VMs are used for databases and stateful infrastructure.
Kubernetes Fundamentals
Kubernetes (K8s) is a container orchestration platform: it manages deploying, scaling, and running containers across a cluster of machines. Core concepts: Pod: the smallest deployable unit in Kubernetes: one or more containers that share network and storage. Pods are ephemeral (they can be created and destroyed). Deployment: manages a set of replica Pods, handles rolling updates and rollbacks. Service: a stable network endpoint for accessing Pods: provides load balancing across Pods. Pods have dynamic IPs; Services provide a fixed DNS name. ConfigMap: stores non-sensitive configuration data as key-value pairs. Secret: stores sensitive data (passwords, tokens): base64 encoded (not encrypted). Namespace: logical isolation within a cluster: separate dev, staging, prod environments in the same cluster. Ingress: manages external HTTP/HTTPS traffic routing to Services. Node: a worker machine in the cluster. Control Plane (formerly Master): manages the cluster state: API server, scheduler, controller manager, etcd.
DevOps and containerisation questions are increasingly common in backend interviews. Practise explaining container architecture clearly with HireStepX's AI mock interviewer.
Practice freeKubernetes Interview Questions
Common K8s questions at Indian product companies: (1) 'What is the difference between a Deployment and a StatefulSet?' Deployment manages stateless replicas (web servers, APIs): Pods are interchangeable. StatefulSet manages stateful applications (databases, Kafka, ZooKeeper): each Pod has a stable identity and persistent storage. (2) 'How does Kubernetes handle high availability?' Multiple replicas via Deployment, distributed across nodes. Liveness probes (is the container alive?) and readiness probes (is the container ready to receive traffic?) detect unhealthy Pods. K8s automatically restarts failed Pods and removes them from load balancer rotation. (3) 'What is a rolling update?' Kubernetes replaces old Pods with new ones incrementally: typically replacing 1 Pod at a time, ensuring some Pods always serve traffic during the update. Configure with maxUnavailable and maxSurge. (4) 'Explain horizontal vs vertical pod autoscaling.' HPA (Horizontal Pod Autoscaler) adds more Pod replicas when CPU/memory exceeds a threshold. VPA (Vertical Pod Autoscaler) increases the resource requests/limits of existing Pods.
Frequently asked questions
Practice these questions on HireStepX