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 121–135 of 490 questions
121.How do you share CI configuration across many projects?MidGitLab CI/CD
Put shared jobs in a central project and include them with include: project, pinned to a tag. Better for new work: CI/CD components with typed inputs, published in the CI/CD Catalog. Inside a file, use hidden jobs with extends and !reference. Check the result with glab ci config compile.
122.A pipeline takes 25 minutes. How would you make it faster and cheaper?SeniorGitLab CI/CD
Measure first: wall time (what people wait) and total job time (what you pay), per job, from CI/CD analytics or the API. Then: needs to remove waiting, a dependency cache keyed on the lock file with pull policy for readers, smaller images, rules: changes to skip unneeded jobs, parallel for long test suites, Docker layer caching, interruptible plus auto-cancel for old commits, artifact expiry, and right-sized or spot autoscaled runners.
123.How would you make sure every project in the company runs secret detection, even if a team removes it?SeniorGitLab CI/CD
Use security policies from a security policy project linked to the top group. A scan execution policy forces secret detection in every pipeline, and projects can't turn it off. A merge request approval policy blocks merges with new critical or high findings until the security team approves. Pipeline execution policies can add other required jobs. Scope policies to compliance frameworks where needed.
124.How do you protect production in GitLab end to end?SeniorGitLab CI/CD
Several layers: protected main and tags; merge checks (pipeline must pass, threads resolved) and approval rules with CODEOWNERS; protected variables for production secrets; protected runners or a protected-branch-only Kubernetes agent; protected environments with deployment approvals; resource_group for one deploy at a time; and audit events streamed to a SIEM.
125.What must a self-managed GitLab backup include, and how do you restore it?SeniorGitLab CI/CD
gitlab-backup create saves the database, repositories, uploads, artifacts, packages and more. It does not include /etc/gitlab/gitlab.rb and gitlab-secrets.json; copy those separately and keep them safe, because without gitlab-secrets.json encrypted data like CI/CD variables and runner tokens can't be read. To restore: same GitLab version, stop puma and sidekiq, gitlab-backup restore BACKUP=ID, put back the config files, reconfigure, restart, and run gitlab-rake gitlab:check. Practise restores regularly.
126.How do you upgrade a self-managed GitLab safely?SeniorGitLab CI/CD
Read the release notes, take a backup and copy the config files, and follow the upgrade path with its required stops (x.2, x.5, x.8, x.11), waiting for background migrations to finish between steps. Test on a staging instance first. Multi-node setups can do zero-downtime upgrades node by node. Afterwards, run gitlab:check. You can't downgrade a package; going back means restoring a backup.
127.What is the difference between HA and Geo in GitLab?SeniorGitLab CI/CD
HA runs several copies of each part in one site (several Rails nodes behind a load balancer, PostgreSQL with Patroni, Redis Sentinel, Gitaly Cluster, object storage), so one server can fail without downtime. Geo keeps a live, read-only copy of the whole site in another region, for disaster recovery and faster clones for far-away teams. If the primary site is lost, you promote the secondary and switch DNS. You still need backups, because both copy mistakes too.
128.What is the difference between Git and GitHub?BeginnerGitHub & GitHub Actions
Git is the tool on your computer that tracks versions of files. GitHub is a website that stores Git repositories online and adds sharing, pull requests, issues and automation.
129.What is a pull request?BeginnerGitHub & GitHub Actions
A request to merge your branch into another branch, usually main. It lets teammates review the changes and lets automatic checks run before the merge.
130.What are the main parts of a GitHub Actions workflow?BeginnerGitHub & GitHub Actions
An event that starts it, jobs that run on runners, and steps inside each job. A step either runs a command or uses a ready-made action.
131.Where do workflow files live?BeginnerGitHub & GitHub Actions
In the .github/workflows folder of the repo, as YAML files.
132.What is a runner?BeginnerGitHub & GitHub Actions
The machine that runs a job. GitHub-hosted runners are fresh virtual machines for each job. Self-hosted runners are machines you manage.
133.How do you make jobs run in order?MidGitHub & GitHub Actions
Use needs. A job with needs waits for the listed jobs to pass. Without it, jobs run in parallel.
134.How do you pass data between jobs?MidGitHub & GitHub Actions
Declare outputs on the producing job, write them to $GITHUB_OUTPUT in a step, and read them in the next job with needs.<job>.outputs.<name>. For files, use artifacts.
135.What is the difference between secrets and variables?MidGitHub & GitHub Actions
Secrets hold private values, are masked in logs and cannot be read back. Variables hold ordinary settings and are visible.