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 46–60 of 190 questions
46.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.
47.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.
48.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.
49.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.
50.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.
51.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.
52.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.
53.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.
54.How do you secure container images in a pipeline?SeniorDocker
Pin base images by digest, run as non-root, drop capabilities, scan with Trivy or Grype and fail on critical CVEs, generate an SBOM, sign images with cosign and verify signatures at deploy time.
55.What actually isolates a container from the host?SeniorDocker
Linux namespaces (PID, network, mount, UTS, IPC, user) isolate what it sees; cgroups limit what it uses; seccomp, capabilities and AppArmor/SELinux limit what it can do. It shares the host kernel, so kernel exploits can escape; gVisor or Kata add a stronger boundary.
56.Why should a container run one main process, and what is PID 1's job?SeniorDocker
Docker watches PID 1: when it exits, the container stops. PID 1 must handle signals and reap zombie processes; many apps don't, so use exec in entrypoint scripts or --init (tini). One process per container also keeps logs, scaling and restarts simple.
57.What are cgroups and namespaces?SeniorDocker
Namespaces give a container its own view of processes, network, mounts, hostname and users. Cgroups limit and measure its CPU, memory and I/O. Together they make a container: an isolated, limited process on a shared kernel.
58.How do you choose a base image?SeniorDocker
Prefer small, maintained images: distroless or -slim variants, or Alpine if musl is fine for your app. Pin versions or digests, rebuild often to pick up security fixes, and scan images in CI.
59.What is the difference between Docker and containerd, and why did Kubernetes drop dockershim?SeniorDocker
containerd is the container runtime that actually runs containers; Docker Engine adds a CLI, builds and more on top of it. Kubernetes talks to runtimes through CRI, which containerd and CRI-O support directly, so the extra Docker layer (dockershim) was removed in 1.24. Images built with Docker still run unchanged.
60.How do you upgrade a cluster without downtime?SeniorKubernetes
Upgrade the control plane first, then node pools one at a time; cordon and drain nodes, with PodDisruptionBudgets, multiple replicas and anti-affinity so apps stay available. Check deprecated APIs before upgrading.