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
- Senior Staff Engineer - Tax Platform EngineeringGusto · Denver, CO;San Francisco, CA;New York, NY;Chicago, ILhybridstaffQuick applyPosted 4 hours ago
- Senior AI DevOps EngineerRoku · Austin, TexashybridseniorQuick applyPosted 5 hours ago
- Lead, Platform EngineeringMongoDB · GurugramhybridleadQuick applyPosted 10 hours ago
- Senior Platform EngineerMongoDB · GurugramhybridseniorQuick applyPosted 10 hours ago
- Platform Engineer, Battlespace AwarenessAnduril · Fort Collins, Colorado, United StatesonsitemidQuick applyPosted 13 hours ago
- Senior Software Engineer, Platform EngineeringKlaviyo · Boston, MAonsiteseniorQuick applyPosted 1 day ago
- Lead Software Engineer, Platform EngineeringKlaviyo · Boston, MAonsiteleadQuick applyPosted 1 day ago
- Software Engineer-Platform Engineering (L3)Twilio · Remote - US · RemoteremotemidQuick applyPosted 1 day ago
- Senior Software Architect, Platform EngineeringZscaler · San Jose, California, USAhybridstaffQuick applyPosted 1 day ago
- Executive Director, Digital Transformation & Platform EngineeringCVS · CT - HartfordonsiteleadPosted 2 days 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