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 136–150 of 490 questions
136.What does branch protection do and why does it matter?MidGitHub & GitHub Actions
It sets rules for important branches: pull requests, approvals, passing checks and no force pushes. It keeps main safe and enforces your review process.
137.How does caching speed up a workflow?MidGitHub & GitHub Actions
Dependencies are saved under a key, usually a hash of the lock file. When the key matches, they are restored instead of downloaded again.
138.When do you use a matrix?MidGitHub & GitHub Actions
When the same job must run with several settings, like Node versions or operating systems. It creates one job per combination, running in parallel.
139.What is the difference between artifacts and cache?MidGitHub & GitHub Actions
A cache speeds up repeated downloads and may be evicted. Artifacts are files from a run that you pass to other jobs or keep for download.
140.Reusable workflow or composite action?SeniorGitHub & GitHub Actions
A reusable workflow shares whole jobs and is called at job level. A composite action shares a few steps and is used like a single step inside a job.
141.Why use OIDC to deploy to a cloud?SeniorGitHub & GitHub Actions
The job exchanges a short-lived signed token for temporary cloud credentials, so no long-lived key is stored in GitHub. A trust policy limits it to a specific repo and branch.
142.How do you secure a workflow?SeniorGitHub & GitHub Actions
Set minimal permissions, pin third-party actions to a commit SHA, avoid untrusted input in run steps, use environments with approvals, prefer OIDC to stored keys, and enable Dependabot, CodeQL and secret scanning.
143.Why be careful with pull_request_target?SeniorGitHub & GitHub Actions
It runs with access to secrets in the base repository. If it also checks out and runs code from a fork, an attacker can steal secrets. Use pull_request for untrusted code.
144.What are the risks of self-hosted runners?SeniorGitHub & GitHub Actions
Jobs run on your own network, so malicious code from a pull request could reach internal systems. Use them for private repos, make them ephemeral, and give them minimal access.
145.How would you debug a failing workflow?SeniorGitHub & GitHub Actions
Check it started, then read the first error in the failing step with gh run view --log-failed, enable debug logging if needed, check permissions and secrets, change one thing at a time and re-run only the failed jobs.
146.How do you manage GitHub for a large company?SeniorGitHub & GitHub Actions
Use enterprise and organization structure with teams, SSO and SCIM, org-wide rulesets, an allowed-actions policy, runner groups and spending limits, audit log streaming and artifact attestations.
147.What is an artifact attestation?SeniorGitHub & GitHub Actions
A signed statement of where, when and how an artifact was built. Consumers can verify provenance, which supports supply chain security.
148.What is a merge conflict and how do you fix it?MidGitHub & GitHub Actions
It happens when two branches changed the same lines, so Git cannot choose. Git marks the lines in the file. You keep the right version, remove the marker lines, then add and commit.
149.Why does an OIDC trust policy fail when the job uses an environment?SeniorGitHub & GitHub Actions
The token's sub claim changes. A job on a branch has repo:ORG/REPO:ref:refs/heads/main. A job that uses an environment has repo:ORG/REPO:environment:NAME. The trust policy must match the form your job really produces.
150.How do you stop two deployments from running at the same time?SeniorGitHub & GitHub Actions
Use a concurrency group, for example group: deploy-production. A second run waits, or cancels the first if you set cancel-in-progress. For deployments, waiting is usually safer than cancelling.