Top 4 Containers Interview Questions
Browse 4 real-world technical and behavioral interview questions about Containers. Review scenarios, edge cases, and architectural best practices.
Your .NET service keeps getting OOM-killed in its container while the GC reports a small heap. Where has the memory gone?
The kernel kills you on everything in the cgroup, while the GC only reports the managed heap. Committed-but-empty heap, per-core Server GC heaps, thread stacks, native buffers and loaded code all count against the limit and none of them appear in a heap size figure.
Two replicas of the same deployment are running different code, and both were started from the same image tag. How did that happen and what do you change?
A tag is a mutable pointer in the registry, so re-pushing it makes the same reference resolve to different content over time. Nodes that already cached the old digest keep serving it, so the fix is to deploy by digest and let the tag be a human label rather than the deployed identity.
What happens when a container hits its CPU limit, and what happens when it hits its memory limit?
Container CPU and memory limits fail differently: CPU limits throttle work, while memory limits can trigger OOMKilled restarts. Debug by comparing requests, limits, actual usage and runtime-specific memory settings. Use this containers answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects cgroups to the point an interviewer is testing.
What is a container image, and why is a container not a virtual machine?
A container image is layered filesystem content plus runtime config, while a container is a host process isolated by namespaces and cgroups. A virtual machine boots its own guest kernel, so the isolation boundary and startup model are different.