DevOps

GitLab CI/CD

.gitlab-ci.yml, stages, jobs, runners, artifacts, cache, environments, deployments, troubleshooting pipelines

22 interview questions·
Mid-Level
1

What is the name of the configuration file to define GitLab CI/CD pipelines?

Answer

.gitlab-ci.yml file located at the repository root defines all pipelines, stages, jobs and CI/CD configurations. GitLab automatically detects this file and executes pipelines on every push or merge request. The YAML format provides declarative syntax for defining pipeline infrastructure as code.

2

What does a 'stage' represent in GitLab CI/CD?

Answer

A stage is a logical pipeline phase that groups multiple jobs executed in parallel. Stages run sequentially in the defined order (e.g., build → test → deploy). Jobs within the same stage can run in parallel if multiple runners are available. If a job fails in a stage, the pipeline stops by default.

3

What is the main difference between 'artifacts' and 'cache' in GitLab CI?

Answer

Artifacts are files generated by a job and passed to subsequent jobs or downloadable (e.g., compiled binaries, test reports). Cache stores dependencies to speed up builds (e.g., node_modules, .m2). Artifacts are guaranteed between jobs, cache is best-effort. Cache uses a key for sharing between pipelines, artifacts are per-pipeline.

4

Which keyword controls when a job executes in GitLab CI?

5

What is a GitLab Runner?

+19 interview questions

Master DevOps for your next interview

Access all questions, flashcards, technical tests, code review exercises and interview simulators.

Start for free