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 61–75 of 178 questions
61.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.
62.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.
63.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.
64.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.
65.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.
66.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.
67.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.
68.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.
69.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.
70.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.
71.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.
72.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.
73.How would you secure a multi-tenant cluster?SeniorKubernetes
Namespace per team with RBAC least privilege, NetworkPolicies default-deny, Pod Security Admission (restricted), ResourceQuotas and LimitRanges, admission policies (Kyverno or Gatekeeper), image signing, and secrets from an external store.
74.How does RBAC work in Kubernetes?SeniorKubernetes
A Role (or ClusterRole) lists allowed verbs on resources; a RoleBinding (or ClusterRoleBinding) gives it to users, groups or ServiceAccounts. Give least privilege, avoid cluster-admin, and test with kubectl auth can-i.
75.What happens when you run kubectl apply -f deployment.yaml?SeniorKubernetes
kubectl sends the object to the API server, which authenticates, authorizes, runs admission controllers and stores it in etcd. The Deployment controller creates a ReplicaSet, which creates Pods; the scheduler picks nodes; kubelet on each node starts the containers through the runtime.