Skip to content
$ lynuxpro

INTERVIEW PREP

Interview questions

570 questions from real DevOps, SRE, platform engineering and MLOps interviews, with the answer an interviewer wants to hear. Try answering out loud first, then open the model answer.

Showing 1–6 of 6 questions

Learn Docker →
1.What is the difference between an image and a container?Beginner

An image is a read-only template made of layers. A container is a running instance of an image with its own writable layer, process namespace and network.

2.What is the difference between CMD and ENTRYPOINT?Beginner

ENTRYPOINT sets the executable; CMD supplies default arguments (or the default command if there is no ENTRYPOINT). docker run image args replaces CMD but not ENTRYPOINT.

3.What is a Dockerfile, and what do FROM, RUN, COPY and EXPOSE do?Beginner

A Dockerfile is the recipe for an image. FROM picks the base image, RUN runs a command at build time and saves the result as a layer, COPY adds files from the build context, and EXPOSE documents the port the app listens on (it doesn't publish it).

4.What is the difference between docker stop and docker kill?Beginner

docker stop sends SIGTERM, waits (10 seconds by default) for a clean shutdown, then sends SIGKILL. docker kill sends SIGKILL right away, so the app can't clean up.

5.How do you keep data when a container is removed?Beginner

Store it in a volume (-v data:/var/lib/postgresql/data) or a bind mount to a host folder. The container's own writable layer is deleted with the container.

6.What does -p 8080:80 mean?Beginner

Publish port 80 inside the container on port 8080 of the host, so http://localhost:8080 reaches the app.