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 GitLab CI/CD →1.What is the difference between a pipeline, a stage and a job?Beginner
A job is a list of commands that runs in a fresh environment and passes or fails. A stage is a group of jobs that run at the same time. A pipeline is one run of all the jobs for one commit. Stages run in order, and the next stage starts only when every job in the stage before it passed.
2.What is a GitLab runner?Beginner
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.
3.What is the difference between artifacts and cache?Beginner
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.
4.How do you keep secrets out of your pipeline code?Beginner
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.
5.What is a merge request, and what happens when you write 'Closes #12' in one?Beginner
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.
6.Why use npm ci instead of npm install in CI?Beginner
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.