Scenario-Based GitLab CI/CD Interview Questions (2027)

44 scenario-based GitLab CI/CD interview questions by level: fork MRs, timeouts, runner disk, merge trains, rollbacks, runner security, compliance.

Sep 17, 2025 - 14:57
Nov 6, 2026 - 01:17
 0  137
Scenario-Based GitLab CI/CD Interview Questions (2027)

Scenario-based GitLab CI/CD interview questions describe a situation from day-to-day pipeline work, such as a stuck merge request, a runner fleet running out of disk, a release that must be rolled back or a leaked runner token, and ask what you would do. Good answers name the cause, the GitLab feature that fixes it and how you would stop it recurring. This page has 44 scenarios grouped by experience level, plus incident drills.

Feature names and behaviour were checked against docs.gitlab.com in November 2026. Several answers use features that need GitLab Premium or Ultimate; each one says so.

Key takeaways

  • Answer every scenario in the same order: symptom, likely cause, how you confirm it, fix, prevention.
  • Freshers get scenarios about their own merge requests and jobs: timeouts, truncated logs, fork pipelines, expired artifacts.
  • Engineers with 2 to 5 years get scenarios about runners, monorepos, rollbacks, merge trains and rate limits.
  • Senior scenarios are about the platform: runner security, compliance across hundreds of projects, upgrades and compute quotas.
  • Say which tier a feature needs when it matters. Interviewers notice when a candidate proposes a Premium feature for a Free-tier company without saying so.

How this page differs from our other GitLab guides

The 90+ GitLab CI/CD interview questions guide is our main reference. Its scenario section covers the classic configuration bugs: pending jobs, duplicate pipelines, cache misses and missing artifacts. The real-time GitLab CI/CD questions page gives you YAML to read and fix. This page covers the situations around the YAML: people, permissions, runners, releases and incidents.

LevelScenario focusQuestions
FreshersYour own MR, job and pipeline1 to 12
2 to 5 yearsRunners, releases, monorepos, merge flow13 to 28
SeniorPlatform, security, compliance, cost29 to 38
All levelsIncident drills39 to 44

Scenarios for freshers

1. You fixed a bug and clicked Retry on the failed deploy job, but production still has the bug. Why?

Retry reruns the job for the same commit as the original pipeline, so it deployed the old code again. Push the fix (or merge it) to start a new pipeline for the new commit and deploy from that pipeline. Check the commit SHA on the job page before retrying any deploy.

2. Your job is killed with "execution took longer than 1h0m0s seconds". What can you change?

The default project timeout is 60 minutes. A maintainer can raise it under Settings, CI/CD, General pipelines, or the job can set timeout: 90m. A runner can also enforce a maximum timeout that the job cannot exceed. Before raising it, check why the job got slower; a hanging test is more common than real growth.

3. The end of your job log is missing and says the log limit was exceeded. What do you do?

The runner stops sending output after its output_limit, which defaults to 4096 KB. Reduce noise (quiet flags, no debug output in loops), write large logs to a file and upload it as an artifact, or ask the runner administrator to raise output_limit in config.toml for runners you control.

4. You opened a merge request from your fork and the deploy-preview job fails because a variable is empty. Why?

By default, a merge request from a fork runs its pipeline in the fork, which does not have the parent project's CI/CD variables. That protects secrets from untrusted code. A maintainer of the parent project can review the changes and choose to run the pipeline in the parent project, where the variables exist.

5. The Merge button is greyed out with "Pipeline must succeed", but your change only touched docs and the pipeline was skipped. What now?

The project requires a successful pipeline before merge. A maintainer can enable "Skipped pipelines are considered successful" in the merge request settings, or the docs-only path can include a small job that always runs, so a pipeline exists and passes.

6. Your lead asks you to run the pipeline again with DEPLOY_REGION=eu-west-1. How?

Use Build, Pipelines, Run pipeline, choose the branch and add the variable. Newer GitLab versions restrict who can set pipeline variables through the project setting for the minimum role allowed to use pipeline variables, so you may need a maintainer. Prefer pipeline inputs when the project defines them, because they are typed and validated.

7. A job script clones another private project in the same group and fails with an authentication error. How do you fix it without a personal token?

Clone with the job token: git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.example.com/group/other.git. The other project must allow your project in its CI/CD job token allowlist (Settings, CI/CD, Job token permissions). A personal access token in a variable would work, but it ties the pipeline to one person and has wider scope.

8. You need a test report from last month's pipeline, but the artifact link returns an error. What happened?

The artifact expired according to expire_in or the instance default and was deleted. It cannot be recovered. For reports that must be kept, upload them to the package registry or long-term storage, or set a longer expire_in for that job only.

9. You pushed a commit with [skip ci] in the message by mistake and now need a pipeline. What do you do?

Run a pipeline manually for the branch from the Pipelines page, or push another commit without the flag. When pushing from a terminal, git push -o ci.skip is the explicit way to skip, which avoids putting the flag in the history.

10. A teammate's job passes, yours fails on the same branch with "permission denied" pushing to the container registry. What is different?

Probably the role or the trigger. A job runs with the permissions of the user who triggered it, so a Reporter cannot push images where a Developer can. Check your role in the project and whether the job uses CI_REGISTRY_USER and CI_REGISTRY_PASSWORD rather than a hard-coded account.

11. On GitLab.com your first pipeline does not start on instance runners and asks you to verify your account. Is something broken?

No. GitLab.com may ask new users to verify their identity before they can use instance runners, as an abuse control. Complete the verification, or register your own project runner on a machine you control.

12. Your pipeline has a yellow "passed with warnings" status. Should you merge?

A job with allow_failure: true failed. Open it and decide whether the failure matters: a flaky optional lint might be fine, a security scan finding might not. If the team keeps ignoring that job, raise it with the team so the job is fixed or removed rather than left as noise.

Scenarios for 2 to 5 years of experience

13. Docker executor runners keep failing with "no space left on device". What do you do?

Old images, volumes and build caches fill the host disk. Clean them on a schedule with docker system prune filters or the runner's clear-docker-cache script, set disable_cache or a cache volume policy that suits you, and alert on disk usage. For long-term fixes, move to autoscaled ephemeral runners so each job gets a fresh machine.

14. Your autoscaled runner costs doubled because machines stay up all weekend. What settings do you check?

The idle settings of the autoscaler: idle count, idle time and the schedule-based policies. With the docker-autoscaler or instance executor (which use fleeting plugins), set idle capacity to zero outside working hours with a policy, and check that the maximum instance count is sensible.

15. A monorepo has 30 services and every merge request runs all 30 test suites. How do you fix it?

Generate or define one child pipeline per service and trigger each one only when its folder changes.

payments:
  trigger:
    include: services/payments/.gitlab-ci.yml
    strategy: depend
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
      changes:
        - services/payments/**/*
        - libs/common/**/*

Include shared library paths in each service's changes, so a change to common code still tests everything that uses it.

16. Every merge request passed, but main is broken after two merged on the same afternoon. How do you stop this?

Each MR was tested against an old main. Enable merged results pipelines so tests run on the result of merging, and merge trains so queued MRs are tested together in order before merging. Both need GitLab Premium or Ultimate.

17. Production broke after a deploy and you need the previous version back in minutes. What does GitLab offer?

Open Operate, Environments, choose production and use the rollback action on the last good deployment. It reruns that deployment job with its original commit and artifacts. This only works if deploy jobs are idempotent and do not depend on state from later commits, such as forward-only database migrations.

18. Image pulls from Docker Hub fail with rate-limit errors during busy hours. What do you do?

Use the GitLab Dependency Proxy, which caches upstream images at group level. Reference images through ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/node:20, or mirror the base images you need into your own container registry and pin them.

19. A library team wants their merge requests to also run the test suites of three consumer projects. How?

Add multi-project trigger jobs to the library pipeline that start each consumer's pipeline with the new library version as a variable, and use strategy: depend so the library MR fails if a consumer fails. The consumers need to accept that variable and allow the trigger.

20. Two people from different teams must approve each production deploy. How do you set that up?

Protect the production environment and configure deployment approvals with required approval rules for each group. Deploy jobs that target it wait for approvals. Protected environments with approvals are Premium features; on Free, the closest option is a manual job limited by protected branches and a written process.

21. A hotfix must go to the 4.2 release while main is already on 5.0. How do you handle pipelines for that?

Create or use a release/4.2 branch, cherry-pick the fix (the MR page has a Cherry-pick action), and make sure rules include release branches so build and deploy jobs run there. Tag the result v4.2.x so tag-based release jobs pick it up. Then confirm the fix also exists on main.

22. Concurrent merge request pipelines corrupt each other's data in a shared test database. What are the options?

Give each pipeline its own database, for example a service container (services: [postgres:16]) per job, or a schema named after CI_PIPELINE_ID. If the shared resource cannot be duplicated, serialise access with resource_group, accepting slower pipelines.

23. A clone takes four minutes on every job. What do you look at?

Repository size and Git settings: use GIT_DEPTH for shallow clones, GIT_STRATEGY: fetch on runners that keep a working copy, and check for large binaries that belong in Git LFS or the package registry. Jobs that do not need the code at all can set GIT_STRATEGY: none.

24. Security asks for SAST and secret detection on every project without each team editing YAML much. What do you suggest?

Include the GitLab templates or the matching CI/CD components from a shared file that all projects already include. For enforcement that teams cannot remove, Ultimate offers security policies, including scan execution policies and pipeline execution policies set at group level.

25. A scheduled nightly pipeline stopped running after an engineer left the company. Why?

Scheduled pipelines run as the schedule owner. When that user is blocked or loses access, the schedule becomes inactive or fails. Another maintainer should take ownership of the schedule. Service accounts avoid this problem for long-lived automation.

26. Developers complain that a pipeline asks for five manual clicks to reach staging. How would you redesign it?

Make build, test and staging deploy automatic on main, keep one manual or approval gate before production, and use review apps for merge requests. Manual jobs earlier in the flow usually exist because tests are not trusted, so fix the tests rather than keeping the clicks.

27. A Kubernetes deploy job needs cluster credentials. The team stored a kubeconfig as a file variable. What would you improve?

Use the GitLab agent for Kubernetes, which connects from the cluster to GitLab, so no cluster credentials live in CI/CD variables. Authorise the agent only for the projects or groups that deploy, and use Kubernetes RBAC to limit what the agent's identity can do.

28. The team wants deploy notifications in their chat with the commit and environment. How?

Use the project's integrations for the chat tool (for example Slack notifications or Mattermost), which can send deployment and pipeline events, or a small final job that posts to a webhook with CI_ENVIRONMENT_NAME, CI_COMMIT_SHORT_SHA and CI_PIPELINE_URL. Keep the webhook URL in a masked variable.

Scenarios for senior engineers

29. A runner authentication token was pasted into a public issue. What do you do?

Reset the token from the runner's settings so the old one stops working, update config.toml on the runner host, and check runner job history for unexpected jobs. Runner authentication tokens start with glrt-, which helps secret detection catch them. Then review who can see runner settings.

30. Anyone who can push a branch can run code on the runner that deploys to production. How do you fix it?

Mark the production runner as protected so it only runs jobs on protected branches and tags, give it a tag that only deploy jobs use, and protect those branches and tags so only maintainers can push. Untrusted merge requests then run on separate, unprivileged runners.

31. Auditors ask who changed a production CI/CD variable last Tuesday. Where do you look?

Audit events record changes to CI/CD variables, protected branches, runners and member permissions. Audit events at group and instance level are Premium or Ultimate features. On Free, you have limited history, which is a good argument for keeping secrets in an external secrets manager that logs access.

32. Every project must run a compliance job that teams cannot skip, even if they rewrite their YAML. How?

On Ultimate, use pipeline execution policies at group level. They inject required jobs into project pipelines, and GitLab is moving users to them from the older compliance pipelines feature. Without Ultimate, you can only rely on shared includes plus review, which teams can bypass.

33. You plan to upgrade self-managed GitLab across two major versions this weekend. What do you check for CI?

The required upgrade path (GitLab defines upgrade stops you cannot skip), removed or changed CI keywords in the release notes, deprecated runner registration methods, and runner compatibility. GitLab recommends runner major and minor versions that match the GitLab version. Test a copy of busy projects' pipelines on a staging instance first.

34. Your GitLab.com group used its monthly compute minutes by the 20th and jobs on instance runners stopped. What now, and what next month?

Short term, buy additional compute minutes or move critical projects to self-managed project or group runners, which do not use the quota. Next month, find the heaviest projects in the usage quotas page, cut waste (duplicate pipelines, no interruptible, large runners for small jobs) and set expectations per team.

35. You must move 200 projects from copied YAML to shared CI/CD components without breaking them. What is the plan?

Publish components with semantic versions in the CI/CD catalog, migrate a few pilot projects, then roll out by team with merge requests that pin a version. Provide a changelog and a deprecation window for old templates, and track adoption by searching for the old includes.

36. An air-gapped self-managed instance cannot run the default security templates. Why, and how do you fix it?

The templates pull analyser images and vulnerability data from the internet. Mirror the required images into the internal registry, point the templates at it with the documented variables, and update the mirrors on a schedule. GitLab documents offline environment setup for each scanner.

37. Leadership wants to know whether CI/CD changes improved delivery. What do you report?

DORA metrics: deployment frequency, lead time for changes, time to restore service and change failure rate. GitLab shows them in value stream analytics on Ultimate, based on deployments to production environments. On other tiers, compute them from the deployments API.

38. A team wants to give contractors access to run pipelines but not see production secrets. How?

Give contractors the Developer role, keep production variables protected and environment-scoped to production, protect the production environment so only certain groups can deploy, and keep production runners protected. Contractors can then run and debug non-production pipelines without access to production values.

Incident drills for all levels

Interviewers often finish with one drill and watch how you organise the response. Say what you do in the first five minutes, then the follow-up.

39. All pipelines in the company fail at once with "image pull" errors. What is your first move?

Check whether one base image or registry is the common factor: a deleted tag, an expired registry credential or a registry outage. Post in the incident channel, pin jobs to the last known good image digest if one exists, and afterwards keep base images in your own registry with immutable tags.

40. A deploy job ran on a feature branch and changed production. How did it happen and what do you change?

The job's rules allowed non-default branches, and the production variables were not protected. Roll back first, then restrict the job with rules to protected refs, mark production variables as protected and environment-scoped, and protect the production environment.

41. A malicious dependency was published under a package name your build uses. Your pipeline pulled it overnight. What do you do?

Stop deploys, find which pipelines and artifacts used the bad version from the job logs and dependency lock files, rebuild from a pinned safe version, and rotate any secrets the affected jobs could reach. Prevent recurrence with lock files, dependency scanning and a proxy such as the package registry that controls which packages are allowed.

42. The GitLab instance is down and a critical fix must ship. What are the options?

Follow the documented break-glass process if one exists: a pre-approved manual deploy from a signed build artifact, recorded afterwards. If none exists, escalate rather than improvising from a laptop. After the incident, write the break-glass procedure and test it.

43. A job log shows a cloud key that was not masked. What do you do?

Revoke the key at the cloud provider first, then erase the job log (users with permission can erase a job, which removes its log and artifacts), and replace the key. Find out why masking failed, often because the value did not meet masking requirements or was transformed by the script, and move to OIDC with id_tokens so there is no long-lived key.

44. Pipelines are green but customers report errors after each release. What is missing in the pipeline?

Checks after deploy. Add smoke tests against the deployed environment, a canary or incremental rollout with automatic checks of error rate, and a rollback path. Also check that the tests that pass in CI use production-like configuration.

How to practise these scenarios

  1. Pick five scenarios and write a short answer for each: symptom, cause, confirm, fix, prevent.
  2. Recreate three in a free GitLab.com project: fork MR variables, a job timeout, a protected variable on an unprotected branch.
  3. Run your own runner with the Docker executor and fill its disk on purpose to see the failure.
  4. Read the release notes of the last two GitLab versions for CI changes.

Related reading: 15 GitLab Runner optimization tips, 10 GitLab CI/CD secrets used by DevOps experts, 15 GitLab CI/CD pipeline examples and what GitOps is. For hands-on labs, see the GitLab training course, run in our Kharadi, Pune classroom and live online.

FAQs

How should I structure an answer to a GitLab scenario question?

State the likely cause, how you would confirm it in GitLab (job log, pipeline graph, settings page), the fix, and one change that prevents a repeat. Keep each part to a sentence or two.

Why do fork merge requests not get my CI/CD variables?

Pipelines for fork MRs run in the fork by default, which has no access to the parent project's variables. A parent maintainer can choose to run the pipeline in the parent project after reviewing the code.

What is the default job timeout in GitLab?

60 minutes at project level. You can change it in project settings or per job with timeout, within any maximum the runner sets.

Which GitLab features in these answers need a paid tier?

Merged results pipelines, merge trains, protected environment approvals and group audit events need Premium or above. Pipeline execution policies, scan execution policies and value stream DORA metrics need Ultimate.

How do I roll back a deployment in GitLab?

From the environment's deployment list, run the rollback on an earlier successful deployment. It reruns that deployment job with its original commit.

What should I do if a runner token leaks?

Reset the runner authentication token in GitLab, update the runner configuration with the new token and review recent jobs on that runner.

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