GitLab Interview Questions for DevOps Engineers (2027)
40 GitLab interview questions for experienced DevOps engineers: protected branches, CODEOWNERS, environments, tokens, OIDC, backups and upgrades.
GitLab interview questions for experienced DevOps engineers go beyond writing a .gitlab-ci.yml. They test how you run GitLab as a platform: branch protection and code review rules, environments and deployments, registries, tokens and access, Kubernetes and Terraform integration, and self-managed administration such as backups and upgrades. This page has 40 questions for engineers with three or more years of experience.
CI/CD syntax is covered in depth elsewhere on the site, so this page stays on the rest of the platform. Start with the 90+ GitLab CI/CD interview questions if you need pipeline basics, use GitLab CI/CD questions for freshers for definitions, advanced GitLab questions for pipeline architecture and runners, real-time GitLab CI/CD questions for YAML reading and writing, and scenario-based GitLab CI/CD questions for incident drills.
Key takeaways
- Experienced rounds ask about the whole GitLab workflow: protected branches, merge request approvals, CODEOWNERS, environments and registries.
- Know which tokens exist (personal, project, group, deploy tokens, CI/CD job token) and which one to use for automation.
- Some features, such as merge request approval rules beyond the basics, merge trains and Geo, need a paid tier. Check the GitLab feature page for the tier before claiming one in an interview.
- Self-managed questions cover
gitlab.rb,gitlab-ctl reconfigure,gitlab-backup createand planned upgrade paths with required stops. - Cloud access from pipelines should use OIDC ID tokens rather than long-lived keys stored in variables.
Topics experienced candidates are asked about
| Area | Typical question | Questions |
|---|---|---|
| Source control and review | How do you protect main and enforce reviews? | 1 to 9 |
| Environments and delivery | How do you track and control deployments? | 10 to 17 |
| Security and access | Which token or credential should automation use? | 18 to 25 |
| Integrations | Kubernetes, Terraform, registries | 26 to 30 |
| Administration | Backups, upgrades, scaling, availability | 31 to 35 |
| Scenarios | Design and troubleshooting cases | 36 to 40 |
Source control and code review
1. How do you protect the main branch in GitLab?
Set it as a protected branch: choose who can merge and who can push (often "No one" can push directly), block force pushes, and require changes to go through merge requests with passing pipelines. Protection can also be applied with wildcards such as release/*.
2. How does CODEOWNERS work in GitLab?
A CODEOWNERS file maps paths to users or groups. GitLab shows code owners on merge requests and, on tiers that support it, can require their approval when a protected branch has "Require approval from code owners" enabled. Sections let you set different approval counts for different parts of the code.
[Backend][2]
/app/ @backend-team
[Infrastructure]
/terraform/ @platform-team
/.gitlab-ci.yml @platform-team
3. What merge request settings would you set for a production repository?
Pipelines must succeed, all threads must be resolved, approvals are required (with rules per area), approvals reset when new commits are pushed, and the author cannot approve their own change. Choose a merge method (merge commit, merge commit with semi-linear history, or fast-forward) that matches how the team reads history.
4. What is a merge train and when is it useful?
A merge train queues merge requests and runs each one's pipeline against the target branch plus the merge requests ahead of it. It stops main from breaking when several changes that pass alone fail together, which matters in busy repositories.
5. What are merged results pipelines?
Pipelines that run on the result of merging the source branch into the target branch, rather than on the source branch alone. They catch conflicts with recent changes on main before merge.
6. How do you handle large binary files in GitLab repositories?
Use Git LFS, which stores large files outside the Git history and keeps pointers in the repository. Set file size limits and, on tiers that have them, push rules to block accidental large commits.
7. A repository is very large and clones are slow. What can you do?
Use shallow clones in CI (GIT_DEPTH), move large files to LFS, run repository housekeeping, and consider removing old large blobs with history rewriting after agreement with the team, since it changes commit IDs.
8. How do you keep a repository in sync with another Git server?
Use repository mirroring: push mirroring sends changes from GitLab to another server, and pull mirroring (on supported tiers) brings changes into GitLab on a schedule.
9. How would you structure groups and subgroups for a large company?
Mirror ownership: a top-level group per business unit, subgroups per team or product, projects inside them. Set permissions, CI/CD variables, runners and compliance settings at group level so new projects inherit them.
Environments and delivery
10. What are environments in GitLab?
Environments represent deploy targets such as staging and production. Jobs that set environment: record deployments, so GitLab shows what version runs where, links to it, and lets you roll back by rerunning an earlier deployment.
11. How do you restrict who can deploy to production?
Make production a protected environment and choose which users or groups can deploy. On supported tiers you can also require deployment approvals before the job runs.
12. What are review apps?
Temporary environments created per merge request with a dynamic environment name, such as review/$CI_COMMIT_REF_SLUG, plus a stop job that removes them when the merge request closes or after auto_stop_in.
13. How do you stop deployments during a release freeze?
Define deploy freeze periods in the project's CI/CD settings. GitLab sets CI_DEPLOY_FREEZE during the window, and deploy jobs can use a rule to skip or fail when it is present.
14. How do you deploy safely to many servers or clusters?
Use incremental rollouts or a canary: deploy to a small share first, watch metrics, then continue. In GitLab this is usually a set of manual or timed jobs, or a GitOps tool that GitLab triggers.
15. What does GitLab offer for releases?
Releases tie a Git tag to release notes, assets and evidence. You can create them from a pipeline with the release keyword or the release-cli, so every tagged build gets a release page.
16. How do you measure delivery performance in GitLab?
Value stream analytics shows time spent in each stage from issue to production. DORA metrics (deployment frequency, lead time for changes, time to restore service, change failure rate) are available on supported tiers and depend on environments and deployment data being recorded correctly.
17. How do feature flags fit in GitLab?
GitLab includes feature flags compatible with the Unleash client libraries. They let you merge code early and turn features on per environment or per user group, which separates deploy from release.
Security and access
18. Which token should a script use to call the GitLab API?
Prefer a project or group access token with the smallest scope and an expiry date, owned by a bot user rather than a person. Personal access tokens break when the owner leaves and usually carry too much access.
19. What is a deploy token used for?
Deploy tokens give read (or write) access to a repository, container registry or package registry without a user account. They suit external systems like a Kubernetes cluster pulling images.
20. What can the CI/CD job token do?
CI_JOB_TOKEN is created per job and expires when the job ends. It can access the registries and some API endpoints of the same project and, if allowed in the job token allowlist, of other projects. Restrict the allowlist instead of sharing long-lived tokens.
21. How do pipelines get cloud credentials without stored keys?
Use id_tokens to request an OIDC token in the job, and configure the cloud provider (AWS, Google Cloud, Azure) or HashiCorp Vault to trust GitLab and issue short-lived credentials based on claims such as project path and branch.
deploy:
stage: deploy
id_tokens:
AWS_ID_TOKEN:
aud: https://gitlab.example.com
script:
- aws sts assume-role-with-web-identity --role-arn "$ROLE_ARN" --role-session-name gitlab-$CI_JOB_ID --web-identity-token "$AWS_ID_TOKEN" --duration-seconds 3600
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
22. How do you protect CI/CD variables?
Mark sensitive ones as masked so they are hidden in logs, and protected so they are only available on protected branches and tags. Keep production secrets out of variables available to merge request pipelines from forks.
23. Which security scanners does GitLab provide?
GitLab provides templates for SAST, secret detection, dependency scanning, container scanning, DAST and infrastructure as code scanning. Some run on all tiers, while the security dashboard and merge request approval policies need higher tiers. See our post on GitLab secrets used by DevOps experts for related practices.
24. How do you see who changed a project setting?
Audit events record actions such as permission changes, protected branch updates and token creation. Retention and streaming of audit events depend on tier and instance settings.
25. How do you enforce single sign-on for users?
On self-managed instances, configure SAML, OIDC or LDAP and disable password sign-in where policy allows. On GitLab.com, groups on supported tiers can enforce SAML SSO and SCIM provisioning.
Integrations
26. How does GitLab connect to Kubernetes?
Through the GitLab agent for Kubernetes, installed in the cluster. It connects outward to GitLab, supports GitOps-style pull deployments and lets CI/CD jobs use a Kubernetes context without storing cluster credentials. The older certificate-based integration is deprecated.
27. Can GitLab store Terraform state?
Yes. GitLab provides a Terraform state backend over HTTP, with locking, so pipelines and engineers share state stored in the project. It also has a Terraform module registry.
28. What registries does GitLab include?
A container registry per project and a package registry supporting formats such as Maven, npm, PyPI, NuGet and generic packages. Cleanup policies stop old images from filling storage.
29. How do you connect GitLab to an issue tracker like Jira?
Use the Jira integration so commits and merge requests that mention issue keys link to the Jira issue, and optionally transition issues on merge.
30. How do you use GitLab with an external CI system?
Keep code and merge requests in GitLab and let the external system report status through the commit status API, so merge checks still require a passing build.
Self-managed administration
31. How do you change configuration on a Linux package (Omnibus) install?
Edit /etc/gitlab/gitlab.rb and run sudo gitlab-ctl reconfigure. Check services with gitlab-ctl status and logs with gitlab-ctl tail.
32. How do you back up GitLab and what does the backup not include?
Run sudo gitlab-backup create for repositories, database and uploads. The backup does not include /etc/gitlab/gitlab-secrets.json and gitlab.rb, which you must back up separately; without the secrets file, encrypted data such as CI variables cannot be restored.
33. How do you plan a GitLab upgrade?
Check the upgrade path tool for required stops between your version and the target, read the release notes for deprecations and removals, take a backup, upgrade staging first, and let background migrations finish before the next step.
34. How do you scale a self-managed instance?
Follow GitLab's reference architectures for your user count, which separate components such as Gitaly, PostgreSQL, Redis and Sidekiq. Run runners on separate machines or Kubernetes, never on the GitLab server itself.
35. How do you provide disaster recovery for GitLab?
Regular backups stored off-site cover basic recovery. GitLab Geo, on supported tiers, replicates data to a secondary site that can be promoted if the primary fails, and also gives distant teams a closer read copy.
Design and troubleshooting scenarios
36. Developers push directly to main and break production. How do you fix the process?
Protect main so no one can push, require merge requests with passing pipelines and at least one approval, add CODEOWNERS for critical paths, and make production deploy only from main through a protected environment.
37. A leaked personal access token was found in a public repository. What do you do?
Revoke the token immediately, review audit events and API logs for its use, rotate any secrets it could read, turn on secret detection in pipelines and move automation to scoped project or group tokens with expiry.
38. Container registry storage keeps growing. How do you control it?
Set cleanup policies to keep only recent tags and tags matching release patterns, run registry garbage collection on self-managed instances, and stop pipelines from pushing an image for every branch commit unless needed.
39. After an upgrade, some pages show errors and background jobs are stuck. Where do you look?
Check that database and background migrations completed, review Sidekiq and Puma logs, confirm all nodes run the same version, and verify you did not skip a required upgrade stop.
40. A team wants to move from Jenkins and GitHub to GitLab. How do you plan it?
Import repositories with the GitHub importer, map users, translate Jenkins pipelines to .gitlab-ci.yml one service at a time, set up runners and group-level settings first, and run both systems in parallel until each team signs off. Our comparison of GitLab CI and Jenkins helps frame the discussion.
How to prepare
Create a group with two projects on GitLab.com or a local instance, protect main, add CODEOWNERS and approval rules, deploy to a protected environment and use an OIDC ID token to reach a cloud account. Then practise explaining each choice. Our GitLab training in Pune covers these topics in the Kharadi classroom and live online, and 15 GitLab CI/CD pipeline examples gives real pipelines to study.
Frequently asked questions
What GitLab topics do experienced DevOps interviews cover?
Protected branches, merge request approvals, CODEOWNERS, environments, tokens, OIDC, Kubernetes and Terraform integration, registries, backups and upgrades, in addition to CI/CD pipelines.
Which GitLab token should automation use?
A project or group access token with minimal scope and an expiry date, or the CI/CD job token inside pipelines. Avoid personal access tokens for shared automation.
How do you back up a self-managed GitLab instance?
Run gitlab-backup create and separately back up /etc/gitlab/gitlab-secrets.json and gitlab.rb.
What is a merge train?
A queue of merge requests where each pipeline runs against the target branch plus the changes ahead of it, so main stays green.
How does GitLab deploy to Kubernetes?
Through the GitLab agent for Kubernetes, which supports pull-based GitOps and gives CI/CD jobs cluster access without stored credentials.
Are all these features in the free tier?
No. Several, including advanced approval rules, merge trains and Geo, need a paid tier. Check the GitLab feature comparison before you describe them.
Official references
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0