Skip to content
$ lynuxpro

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 181–195 of 570 questions

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

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

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

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

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

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

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

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

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

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

191.What is the difference between an image and a container?BeginnerDocker

An image is a read-only template made of layers. A container is a running instance of an image with its own writable layer, process namespace and network.

192.What is the difference between CMD and ENTRYPOINT?BeginnerDocker

ENTRYPOINT sets the executable; CMD supplies default arguments (or the default command if there is no ENTRYPOINT). docker run image args replaces CMD but not ENTRYPOINT.

193.What is a Dockerfile, and what do FROM, RUN, COPY and EXPOSE do?BeginnerDocker

A Dockerfile is the recipe for an image. FROM picks the base image, RUN runs a command at build time and saves the result as a layer, COPY adds files from the build context, and EXPOSE documents the port the app listens on (it doesn't publish it).

194.What is the difference between docker stop and docker kill?BeginnerDocker

docker stop sends SIGTERM, waits (10 seconds by default) for a clean shutdown, then sends SIGKILL. docker kill sends SIGKILL right away, so the app can't clean up.

195.How do you keep data when a container is removed?BeginnerDocker

Store it in a volume (-v data:/var/lib/postgresql/data) or a bind mount to a host folder. The container's own writable layer is deleted with the container.