All jobs / DevOps / SRE / cloud / Containers
DevOps / SRE / cloud interview question · 0–1 years
A container can take all the memory on the node. What do you set?
The strongest answer
Requests and limits (or the platform equivalent) so a leak kills the one container, not the neighbours
Why it works
Exactly. Isolate the blast. Restart-always on a leak is a flap.
What a good answer covers
- Set requests and limits.
- A leak should evict one container.
- Do not “fix” with swap.
- Do not rely on always-restart.
Answers that fall short
- Close, but not the strongest: Restart=always so it comes back after the node dies
A flap is not a limit. - Weak: More swap so it can grow
Swap hides the leak until the disk and the node suffer. - Red flag: Nothing; cgroups will guess
Guessing is how a noisy neighbour wins.
Who gets asked this
More Containers questions
- In the team’s Docker Compose stack, Postgres loses all its data every time the container is recreated. Why…
- CI rebuilds a 12-minute Docker image on every commit. What do you change first?
- A production image is 1.8 GB and includes a compiler. What do you do?
- The app container connects to `localhost:5432` and gets connection refused, though the database container is…
- The Dockerfile has no USER line, so the app runs as root. Does that matter inside a container?
- The container registry has grown to terabytes, pulls from the cluster are slow, and a public registry started…
- What is the difference between an image and a container?
- A Dockerfile says `FROM node:latest`. What is wrong?