Skip to content
$ lynuxpro

INTERVIEW PREP

Interview questions

570 questions from real DevOps, SRE, platform engineering and MLOps interviews, with the answer an interviewer wants to hear. Try answering out loud first, then open the model answer.

Showing 1–6 of 6 questions

Learn Docker →
1.How do you secure container images in a pipeline?Senior

Pin base images by digest, run as non-root, drop capabilities, scan with Trivy or Grype and fail on critical CVEs, generate an SBOM, sign images with cosign and verify signatures at deploy time.

2.What actually isolates a container from the host?Senior

Linux namespaces (PID, network, mount, UTS, IPC, user) isolate what it sees; cgroups limit what it uses; seccomp, capabilities and AppArmor/SELinux limit what it can do. It shares the host kernel, so kernel exploits can escape; gVisor or Kata add a stronger boundary.

3.Why should a container run one main process, and what is PID 1's job?Senior

Docker watches PID 1: when it exits, the container stops. PID 1 must handle signals and reap zombie processes; many apps don't, so use exec in entrypoint scripts or --init (tini). One process per container also keeps logs, scaling and restarts simple.

4.What are cgroups and namespaces?Senior

Namespaces give a container its own view of processes, network, mounts, hostname and users. Cgroups limit and measure its CPU, memory and I/O. Together they make a container: an isolated, limited process on a shared kernel.

5.How do you choose a base image?Senior

Prefer small, maintained images: distroless or -slim variants, or Alpine if musl is fine for your app. Pin versions or digests, rebuild often to pick up security fixes, and scan images in CI.

6.What is the difference between Docker and containerd, and why did Kubernetes drop dockershim?Senior

containerd is the container runtime that actually runs containers; Docker Engine adds a CLI, builds and more on top of it. Kubernetes talks to runtimes through CRI, which containerd and CRI-O support directly, so the extra Docker layer (dockershim) was removed in 1.24. Images built with Docker still run unchanged.