GitLab CI/CD Engineer Interview: Pipeline Design (2027)

44 GitLab CI/CD engineer interview questions on pipeline design: needs, rules, child pipelines, components, runners, caching, OIDC and design scenarios.

Sep 17, 2025 - 14:21
Nov 6, 2026 - 18:06
 0  84
GitLab CI/CD Engineer Interview: Pipeline Design (2027)

GitLab CI/CD engineer interviews test pipeline design: how you structure .gitlab-ci.yml with stages, needs, rules and includes, how you split work into parent-child or multi-project pipelines, how you choose runners and executors, and how you make pipelines fast, secure and reusable across many projects. Expect "why would you choose this" questions, not only definitions.

This page is the design-focused set in our GitLab series. Definitions and concepts are in the main 90+ GitLab CI/CD interview questions, read-and-fix YAML tasks are in real-time GitLab CI/CD questions, and operational incidents are in scenario-based GitLab CI/CD questions. Keyword behaviour and limits here were checked against docs.gitlab.com in November 2026.

Key takeaways

  • An engineer is judged on trade-offs: stages versus a needs graph, cache versus artifacts, one big pipeline versus child pipelines.
  • Use rules and workflow:rules. only and except are deprecated keywords in GitLab's YAML reference.
  • Reuse comes from include, CI/CD components and the CI/CD Catalog, with versioned releases.
  • New runners use the runner authentication token workflow; registration tokens are disabled by default since GitLab 17.0.
  • Know the hard limits interviewers like to probe: needs up to 50 jobs, parallel 1 to 200, retry max 2.
  • Secrets belong in masked, protected variables or an external secrets manager, never in the YAML.

What each level is expected to design

LevelTypical design taskQuestions
Junior engineerBuild, test and deploy one service1 to 12
2 to 5 yearsFast pipelines for a monorepo or several services13 to 28
Senior / platformShared templates, runner fleet, compliance across groups29 to 38
Design scenariosWhiteboard a pipeline and defend it39 to 44

Junior engineer: single-service pipelines

1. What would a minimal pipeline for a web service contain?

Three stages: build, test and deploy. Build produces an artifact or image, test runs unit tests and linting, deploy runs only on the default branch and targets an environment.

stages: [build, test, deploy]

build:
  stage: build
  image: node:22
  script:
    - npm ci
    - npm run build
  artifacts:
    paths: [dist/]

test:
  stage: test
  image: node:22
  script:
    - npm ci
    - npm test

deploy:
  stage: deploy
  script: ./deploy.sh
  environment: production
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

2. Why use stages at all?

Stages give a simple ordering: every job in a stage starts after the previous stage finishes successfully. They are easy to read. When ordering by stage slows things down, you add needs.

3. When do you use artifacts and when cache?

Artifacts pass build output between jobs and can be downloaded; use them for things later jobs require. Cache speeds up repeated work such as dependency downloads and may be missing at any time, so jobs must still work without it.

4. How do you control when a job runs?

With rules. Each rule can test if, changes or exists and set when. The first matching rule decides. Avoid only/except in new code.

5. What does workflow:rules do?

It decides whether a whole pipeline is created. A common use is avoiding duplicate branch and merge request pipelines for the same push.

workflow:
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
    - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
      when: never
    - if: $CI_COMMIT_BRANCH

6. How do you pick the image a job runs in?

Set image per job or under default. Pin a specific tag (or digest) so builds are repeatable, and prefer small official images.

7. What are services in a job?

Extra containers, such as a database, that run alongside the job container on the Docker or Kubernetes executor, for integration tests.

8. How do you make a deploy job manual?

Add when: manual inside a rule. Combine it with a protected environment so only approved people can run it.

9. What is an environment in GitLab CI?

A named deployment target (staging, production) that GitLab tracks, with deployment history and the ability to roll back to an earlier deployment.

10. How do you pass a value from one job to a later one?

Write it to a dotenv file and publish it as artifacts:reports:dotenv. Later jobs that depend on that job receive the variables.

11. Where should a deploy token or cloud key live?

In a CI/CD variable marked masked and protected, scoped to the right environment, or fetched at runtime from a secrets manager. Never commit it to the repository.

12. How do you check a YAML change before pushing it?

Use the pipeline editor, which validates and visualises the configuration, or the CI Lint tool and API. There is no official standalone lint binary to install.

2 to 5 years: fast pipelines for real codebases

13. What does needs change about execution?

needs builds a directed acyclic graph: a job starts as soon as the jobs it needs finish, regardless of stage. A job can need up to 50 other jobs. It also controls which artifacts are downloaded.

14. How would you design a pipeline for a monorepo with several services?

Give each service its own jobs with rules:changes on its directory, connect them with needs, and consider a child pipeline per service so each one has a readable graph. Shared steps go in included templates.

15. When are parent-child pipelines the right choice?

When one configuration is too large to read, when parts of the pipeline should only exist under some conditions, or when you want to generate configuration dynamically. The parent triggers the child with trigger:include.

16. What are multi-project pipelines?

A job in one project triggers a pipeline in another project with trigger:project. They fit cases such as a library change triggering an integration test in a consuming application.

17. How should the parent reflect the child's result?

Set trigger:strategy. GitLab now documents strategy: mirror (18.2 and later) to mirror the downstream status; depend still exists but is not recommended.

18. How do you split a slow test suite?

Use parallel: N (1 to 200) and let the test runner shard by CI_NODE_INDEX and CI_NODE_TOTAL. For a matrix of versions or platforms, use parallel:matrix.

19. How do you design caching so it actually helps?

Key the cache on the lock file (cache:key:files), cache only dependency directories, and use policy: pull on jobs that only read it. Use fallback keys for new branches.

20. How would you build container images in CI?

Docker-in-Docker on a runner that allows it, or a daemonless builder such as Buildah. GitLab's documentation no longer recommends Kaniko, whose original repository was archived in 2025. Push to the project's container registry using the predefined job token variables.

21. How do you avoid wasting runners on outdated pipelines?

Mark jobs interruptible: true and enable auto-cancel of redundant pipelines, so a new push cancels the old run.

22. What is a merge train and why use one?

It queues merge requests and tests each one with the changes ahead of it merged, so main stays green when many people merge at once. GitLab runs up to 20 merge train pipelines in parallel.

23. How do you share YAML between jobs in one file?

With extends and hidden jobs (names starting with a dot), or !reference tags to reuse specific sections. YAML anchors also work but do not cross included files.

24. How do you retry flaky jobs without hiding real failures?

Use retry with when limited to infrastructure failures such as runner_system_failure or stuck_or_timeout_failure. The maximum is 2 retries. Fix flaky tests rather than retrying script failures.

25. How do you deploy review apps per merge request?

Create a dynamic environment named after the branch, with environment:on_stop pointing to a cleanup job and auto_stop_in to remove idle ones.

26. How would you deploy to Kubernetes from GitLab?

Either push-based, with the GitLab agent for Kubernetes and a CI job running Helm or kubectl, or pull-based, with Flux or Argo CD watching a manifests repository. For the GitOps option, see our GitOps principles and Argo CD questions.

27. How do you add security scanning?

Include GitLab's templates or components for SAST, secret detection, dependency scanning and container scanning. Some features and dashboards depend on the GitLab tier, so check the docs for your subscription.

28. How do you keep pipelines readable as they grow?

Split by concern into included files, keep job names consistent, put defaults under default, and move complex shell into scripts in the repository that can be tested locally.

Senior and platform engineers: pipelines across many projects

29. How would you provide shared pipeline building blocks to 100 projects?

Publish CI/CD components in a dedicated project, release them with semantic versions, list them in the CI/CD Catalog and have projects include them with a pinned version. Teams upgrade deliberately instead of breaking on every change.

include:
  - component: $CI_SERVER_FQDN/platform/ci-components/[email protected]
    inputs:
      node_version: "22"

30. What are spec:inputs?

Typed parameters declared in an included file or component header. They are validated when the pipeline is created, unlike plain variables, which makes shared templates safer.

31. How do you enforce mandatory jobs, such as security scans, across a group?

With pipeline execution policies (Ultimate), which inject required jobs into projects' pipelines. They replace the deprecated compliance pipelines.

32. How do you design a runner fleet?

Instance or group runners for common workloads, project runners for special hardware or network access, tags to route jobs, autoscaling (for example the Kubernetes executor or a fleeting-based autoscaler) for load, and separate protected runners for production deploys.

33. How are runners created today?

You create the runner in the GitLab UI or API, which returns a runner authentication token starting with glrt-, and pass it to gitlab-runner register. The older registration token workflow is disabled by default from GitLab 17.0.

34. Which executor would you choose and why?

ExecutorGood forWatch out for
DockerClean, repeatable job containers on VMsPrivileged mode for Docker-in-Docker
KubernetesElastic capacity on an existing clusterPod resource limits, image pull time
ShellSimple builds needing host toolsNo isolation between jobs (maintenance mode per docs)
Instance / Docker AutoscalerAutoscaling VMs in a cloudStartup latency and cloud cost

35. How do you secure production deployments?

Protected branches and environments, required approvals on the environment, protected variables visible only to protected refs, dedicated runners, and OIDC ID tokens (id_tokens) to get short-lived cloud credentials instead of static keys.

36. How would you reduce pipeline cost at scale?

Measure first using pipeline and job duration data, then remove redundant pipelines, cache dependencies, skip unaffected jobs with rules:changes, right-size runner machines and autoscale to zero when idle. Our GitLab Runner optimization tips go into detail.

37. How do you roll out a breaking change to a shared template?

Release a new major version of the component, keep the old one available, announce the change with a migration note, and track adoption before retiring the old version.

38. How do you limit include sprawl?

GitLab allows up to 150 includes per pipeline. Keep a small number of curated components, avoid nested chains of includes, and document which component owns which job.

Design scenarios

39. Design a pipeline that takes a merge request from commit to production.

Merge request pipeline: lint, unit tests, build image, SAST and secret detection, review app. After merge to main: build a tagged image, deploy to staging automatically, run smoke tests, then a manual, approval-protected job deploys to production. Use needs so tests and scans run in parallel.

40. A pipeline takes 40 minutes. Where do you look first?

The job timeline to find the critical path. Typical fixes: replace stage ordering with needs, cache dependencies, split tests with parallel, avoid rebuilding unchanged images, and skip unaffected services.

41. Two teams share a repository but deploy independently. How do you structure CI?

A small parent pipeline that triggers a child pipeline per team, each with its own rules:changes, environments and protected deploy jobs. Shared steps come from versioned components.

42. Security asks that no long-lived cloud keys exist in GitLab. How?

Configure the cloud provider to trust GitLab's OIDC issuer, request an ID token in the job with id_tokens, and exchange it for a short-lived role. Remove the stored keys afterwards.

43. A library change must be tested against three consuming apps before release.

Add multi-project trigger jobs from the library pipeline to each app's integration test pipeline, passing the library version as a variable, and mirror their status so the library release waits for them.

44. How would you migrate a Jenkins pipeline to GitLab CI?

Map stages and steps to jobs, credentials to masked variables or OIDC, agents to runner tags, and shared libraries to CI/CD components. Migrate one service at a time and run both systems in parallel until results match. Our 15 GitLab CI/CD pipeline examples are a good source of target patterns.

How to practise

Build one project from question 1, then evolve it: add needs, a child pipeline, a component in a separate project and a protected production environment. Being able to show that history in an interview is worth more than memorised answers. Our GitLab training in Pune (Kharadi classroom or live online) works through these pipeline designs on real projects.

FAQ

What is the difference between a GitLab CI/CD engineer and a DevOps engineer interview?

A CI/CD engineer round goes deeper into pipeline design, runners and reuse. A DevOps round spreads across Linux, cloud, containers and monitoring as well.

Are only and except still allowed?

They still work but are listed as deprecated keywords. Use rules in new configuration and expect interviewers to ask why.

What is the limit on needs?

A job can list up to 50 jobs in needs, per the GitLab YAML reference.

Should I learn CI/CD components?

Yes. Components and the CI/CD Catalog are GitLab's recommended way to share pipeline configuration, and senior interviews often ask how you would version them.

How do runners register now?

Create the runner in GitLab first to get a glrt- authentication token, then register with that token. Registration tokens are disabled by default since 17.0.

Is Kaniko still recommended for image builds?

No. GitLab's documentation points to alternatives such as Buildah or Docker-in-Docker since the original Kaniko repository was archived.

Do I need GitLab Ultimate to answer senior questions?

No, but know which features need it, such as pipeline execution policies, so you can propose a design that fits the customer's tier.

References

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.