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 31–45 of 108 questions
31.What is a GitLab runner?BeginnerGitLab CI/CD
A program that runs the jobs. It connects out to GitLab, asks for work, runs each job (usually in a Docker container or a Kubernetes pod) and sends back the log and artifacts. GitLab.com gives you shared runners; companies often run their own for speed, cost, special hardware or access to private networks.
32.What is the difference between artifacts and cache?BeginnerGitLab CI/CD
Artifacts pass a job's results (like a dist/ folder or a test report) to later jobs, and they must be there. Cache keeps downloaded packages (like .npm/) between pipelines to save time, and it may be missing. If a job would be wrong without the files, use artifacts; if it would only be slower, use cache.
33.How do you keep secrets out of your pipeline code?BeginnerGitLab CI/CD
Store them as CI/CD variables in Settings, marked masked (hidden in logs) and protected (only given to protected branches). Never commit them. For cloud access, prefer short-lived OIDC tokens (id_tokens) or a secret manager like Vault, so nothing long-lived is stored at all.
34.What is a merge request, and what happens when you write 'Closes #12' in one?BeginnerGitLab CI/CD
A merge request asks to merge one branch into another. It shows the changes, the pipeline result, approvals and security findings. 'Closes #12' links issue #12 and closes it automatically when the MR is merged into the default branch.
35.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.
36.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.
37.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.
38.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.
39.Where do workflow files live?BeginnerGitHub & GitHub Actions
In the .github/workflows folder of the repo, as YAML files.
40.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.
41.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.
42.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.
43.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).
44.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.
45.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.