Interview prep
Docker Interview Questions
Docker questions focus on image layering, build efficiency and the container/VM boundary.
Questions and answers
01How do containers differ from virtual machines?
Containers share the host kernel and isolate with namespaces and cgroups; VMs virtualise hardware and run their own kernel. Containers start faster and pack denser, VMs isolate more strongly.
02What is a multi-stage build and why use it?
It builds artefacts in a heavy toolchain stage and copies only the output into a slim runtime stage, cutting image size and attack surface dramatically.
03How does Docker layer caching work?
Each instruction produces a layer keyed by its inputs. Ordering matters: copy dependency manifests and install dependencies before copying source, so code edits don't invalidate the dependency layer.
04COPY vs ADD?
Use COPY. ADD additionally auto-extracts archives and fetches URLs, which is surprising behaviour you rarely want.
05How do you keep container images secure?
Pin minimal base images, run as a non-root user, scan for CVEs in CI, avoid baking secrets, and rebuild regularly to pick up base-image patches.
How to answer these well
Interviewers are not grading recall — they are checking whether you've hit the failure mode the question describes. Anchor every answer to something you actually shipped or debugged with Docker.
Say the trade-off out loud. "I'd use X here, but it costs Y under Z conditions" scores higher than a clean textbook definition every time.
Roles asking for Docker
- Build Engineer II / Senior Build Engineer IRocket Lab · Stennis Space Center, MSonsiteseniorQuick applyPosted 4 hours ago
- Senior DevOps Engineer IRocket Lab · Long Beach, CAonsiteseniorQuick applyPosted 4 hours ago
- Senior DevOps Engineer IRocket Lab · Littleton, COonsiteseniorQuick applyPosted 4 hours ago
- Lead, Platform EngineeringMongoDB · GurugramhybridleadQuick applyPosted 7 hours ago
- Manager, Client Platform EngineeringMongoDB · Palo Alto; San FranciscoonsitemidQuick applyPosted 7 hours ago
- Tier 3 Platform Engineer SMEPeraton · Chantilly, VAhybridmidfull-time$135k – $216kPosted 10 hours ago
- Tier 3 Platform EngineerPeraton · Chantilly, VAhybridmidfull-time$104k – $166kPosted 10 hours ago
- Senior Tier 3 Platform EngineerPeraton · Chantilly, VAhybridseniorfull-time$112k – $179kPosted 10 hours ago
- Principal Client Platform EngineerRoblox · San Mateo, CA, United StateshybridleadQuick applyPosted 13 hours ago
- Principal Machine Learning Platform Engineer, Foundation AIRoblox · San Mateo, CA, United StatesonsiteleadQuick applyPosted 13 hours ago
Related prep
- DevOps Engineer jobs
- DevOps Engineer career guide
- Software Engineer jobs
- Software Engineer career guide
- Python interview questions
- Java interview questions
- JavaScript interview questions
- React interview questions
- AWS interview questions
- Azure interview questions
- Kubernetes interview questions
- Terraform interview questions