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 46–60 of 109 questions

46.Why use npm ci instead of npm install in CI?BeginnerGitLab CI/CD

npm ci installs exactly the versions in package-lock.json and fails if the lock file is out of date. npm install can quietly change versions. In CI you want every build to be the same.

47.What is the difference between Git and GitHub?BeginnerGitHub & GitHub Actions

Git is the tool on your computer that tracks versions of files. GitHub is a website that stores Git repositories online and adds sharing, pull requests, issues and automation.

48.What is a pull request?BeginnerGitHub & GitHub Actions

A request to merge your branch into another branch, usually main. It lets teammates review the changes and lets automatic checks run before the merge.

49.What are the main parts of a GitHub Actions workflow?BeginnerGitHub & GitHub Actions

An event that starts it, jobs that run on runners, and steps inside each job. A step either runs a command or uses a ready-made action.

50.Where do workflow files live?BeginnerGitHub & GitHub Actions

In the .github/workflows folder of the repo, as YAML files.

51.What is a runner?BeginnerGitHub & GitHub Actions

The machine that runs a job. GitHub-hosted runners are fresh virtual machines for each job. Self-hosted runners are machines you manage.

52.What is the difference between an image and a container?BeginnerDocker

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.

53.What is the difference between CMD and ENTRYPOINT?BeginnerDocker

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.

54.What is a Dockerfile, and what do FROM, RUN, COPY and EXPOSE do?BeginnerDocker

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).

55.What is the difference between docker stop and docker kill?BeginnerDocker

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.

56.How do you keep data when a container is removed?BeginnerDocker

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.

57.What does -p 8080:80 mean?BeginnerDocker

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

58.What is the difference between a Deployment, a ReplicaSet and a Pod?BeginnerKubernetes

A Pod runs one or more containers. A ReplicaSet keeps a number of identical Pods running. A Deployment manages ReplicaSets to give rolling updates and rollbacks; you normally only create Deployments.

59.How does a Service find its Pods?BeginnerKubernetes

Through its label selector. The endpoints controller lists ready Pods whose labels match, and kube-proxy (or the CNI) routes the Service's virtual IP to them.

60.What are the main parts of a Kubernetes cluster?BeginnerKubernetes

The control plane runs the API server, etcd (the database), the scheduler and the controller manager. Each worker node runs kubelet, a container runtime and kube-proxy (or a CNI that replaces it). You talk to the API server with kubectl.