What is Docker and what problem do containers solve?
Take a moment.
Say your answer out loud or write it down first — retrieval is what makes it stick. Reveal when you're ready.
Short answer
Docker packages an app with everything it needs into a lightweight, isolated container so it runs identically on any machine. It removes “works on my machine” conflicts over language versions, OS packages, and pre-installed dependencies.
Detailed explanation
Without containers, every developer, CI runner, and production host must independently install matching Node, Python, Postgres, and system libraries — versions drift and they fight with whatever is already on the machine. Docker makes the container the unit of distribution: each app component (React frontend, Python API, Postgres) ships self-contained with its binaries, libraries, and config, isolated from the host and from other containers. The payoff the docs emphasize: develop with containers, test that same container, then deploy that same container to a laptop, data center, VM, or cloud unchanged. That is why Docker streamlines CI/CD — developers share containers, push them to a test environment, fix bugs in the dev environment, and promote the updated image to production. Containers are also portable and dense: many share one kernel, so you run more workloads on the same hardware than with VMs.
Official docs:Docker docs: Docker overview
Example
# Same container on your laptop and in production:
docker run -d -p 8080:80 docker/welcome-to-docker
# Teammate, CI, and prod all get the identical filesystem + configInterview tip
Name the three adjectives from the docs — self-contained, isolated, portable — then give the concrete drift scenario (three devs, three Python versions). That grounds the definition.
Common mistakes
- Calling Docker a VM or saying containers virtualize hardware.
- Describing images without explaining the consistency problem they solve.