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 16–30 of 178 questions
16.How do you protect the main branch?SeniorGit
Use branch protection: no direct pushes, required pull request reviews (and CODEOWNERS), required passing CI checks, signed commits if needed, and no force pushes. Combine with secret scanning on push.
17.How does Git store data internally?SeniorGit
Git is a content-addressed store of objects: blobs (file content), trees (folders), commits (a tree plus parents and metadata) and tags. Each object is named by its hash. Branches are just files that point to a commit hash.
18.What is a paginator in boto3?SeniorPython for DevOps
A helper that follows the page tokens of an AWS API for you, so you get every result rather than only the first page.
19.How should a Python script get AWS credentials in production?SeniorPython for DevOps
From an IAM role attached to the compute (EC2, ECS, Lambda or an EKS service account). No long-lived keys in code or files.
20.load_kube_config or load_incluster_config?SeniorPython for DevOps
load_kube_config reads your local kubeconfig and suits laptops. load_incluster_config uses the pod's service account and suits code running in the cluster.
21.Threads, asyncio or processes?SeniorPython for DevOps
Threads for a moderate number of I/O waits, asyncio for very many connections with async libraries, processes for CPU-heavy work. Always limit concurrency.
22.How do you share an internal Python tool?SeniorPython for DevOps
Describe it in pyproject.toml with a script entry point, build with python -m build, publish to a private index, and install with pipx or pip.
23.What does a Kubernetes operator do?SeniorPython for DevOps
It watches a custom resource and runs a reconcile loop to make the real state match the wanted state. With kopf you write handlers for create, update and delete.
24.What makes an operator handler well written?SeniorPython for DevOps
It is idempotent, sets owner references on child objects, writes status, cleans up on delete, and runs with least-privilege RBAC.
25.What do FastAPI and pydantic give you?SeniorPython for DevOps
Typed request models with automatic validation (422 on bad input), generated interactive docs, and clear dependency injection for things like authentication.
26.How do you keep Python code quality high across many teams?SeniorPython for DevOps
Type hints with mypy, ruff for lint and format, pytest with coverage, pre-commit hooks, the same checks in CI as a required gate, dependency audits, and shared project templates.
27.How do you stop a script from hanging on a slow command or API?SeniorPython for DevOps
Set a timeout on every outside call: timeout= in requests and subprocess.run, and a limit on retries. Without one, a single stuck call can hang the whole job.
28.A user asks the API to start a 10-minute deploy. How do you design the endpoint?SeniorPython for DevOps
Check the input and the caller's permissions, put the job in a queue or background worker, and return 202 with a job id right away. Provide a status endpoint, log who started it, and make the job safe to run twice.
29.How do you make builds reproducible?SeniorMaven & Build Tools
Pin all plugin versions, set project.build.outputTimestamp, use the Maven Wrapper for the Maven version, enforce Java and Maven versions with the enforcer plugin, and verify with artifact:compare.
30.How do you stop builds from pulling dependencies straight from the internet?SeniorMaven & Build Tools
Point Maven at an internal repository manager (Artifactory or Nexus) using a mirror in settings.xml. It caches and controls what comes in, can block vulnerable or unapproved packages, and keeps builds working if public repos go down.