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 16–24 of 24 questions

Learn Python for DevOps →
16.How do you share an internal Python tool?Senior

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.

17.What does a Kubernetes operator do?Senior

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.

18.What makes an operator handler well written?Senior

It is idempotent, sets owner references on child objects, writes status, cleans up on delete, and runs with least-privilege RBAC.

19.What do FastAPI and pydantic give you?Senior

Typed request models with automatic validation (422 on bad input), generated interactive docs, and clear dependency injection for things like authentication.

20.How do you keep Python code quality high across many teams?Senior

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.

21.What is the difference between a function and a module?Beginner

A function is a named block of steps you can call again and again. A module is a .py file that holds functions and other code, so you can import and share them.

22.What does a --dry-run flag do, and why add it?Mid

It shows what the tool would change without changing anything. People can check the result first, so a mistake costs nothing.

23.How do you stop a script from hanging on a slow command or API?Senior

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.

24.A user asks the API to start a 10-minute deploy. How do you design the endpoint?Senior

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.