MidDocker

How do containers actually work under the hood?

What they are really testing: Whether you know containers are built from Linux kernel primitives, namespaces, cgroups, and a union filesystem, not magic and not a VM. The depth marker for container knowledge.

A real interview question

How do containers actually work under the hood?

What most people say

drag me

Docker uses its own technology to isolate and run containers efficiently.

It treats containers as a black box. The expected answer names the actual Linux primitives, namespaces, cgroups, and overlay filesystem, which is what shows real understanding versus surface familiarity.

The follow-ups they ask next

  • Which primitive enforces a container memory limit, and what happens at the limit?

    cgroups enforce the memory limit; exceeding it triggers the kernel OOM killer, which kills the process (exit 137). cgroups also limit/account CPU and I/O.

  • Why can you not run a Windows container on a Linux host (or vice versa) natively?

    Containers share the host kernel, so the container OS must match the host kernel type. Running across kernels requires a VM (for example a Linux VM under the hood) to provide the right kernel.

What the interviewer is listening for

  • Names namespaces (isolation) and cgroups (limits)
  • Knows union/overlay filesystem for layers
  • Knows it shares the host kernel, not a VM

What sinks the answer

  • Treats it as a black box
  • Cannot name namespaces or cgroups
  • Thinks a container has its own kernel

If you genuinely do not know

Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.

A container is [a normal Linux process with kernel features applied]. [Namespaces isolate its view: PID, network, mount, UTS, IPC, user]. [cgroups limit its resources: CPU/memory/IO, and enforce the memory limit/OOM]. [A union/overlay filesystem stacks read-only image layers + a writable layer]. It [shares the host kernel, so it is light and needs a matching kernel].

Keep going with docker

All 336 cloud engineer questions

Knowing the answer is not the same as recalling it under pressure

Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.

Start free