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–22 of 22 questions
Learn Ansible →16.How do you test a role?Senior
With Molecule: start a disposable container, converge the role, run it again to check idempotence, run verify checks, and destroy the container. Run it in CI on every change.
17.How do you run Ansible safely in CI/CD?Senior
Lint and dry-run (--check --diff) on merge requests, deploy from the main branch with a manual gate, keep SSH keys and the vault password in protected variables, and pin versions.
18.What is a collection, and why pin versions?Senior
A package of modules, roles and plugins named namespace.collection. Pinning versions in requirements.yml keeps runs the same and stops upstream updates from changing behaviour.
19.When would you write a custom module?Senior
Only when no existing module or collection can do the job, such as for an internal API. It must be idempotent, support check mode, return correct JSON and be documented.
20.What does AWX or Ansible Automation Platform add?Senior
A web page and API with role-based access, stored credentials, job templates, workflows with approvals, schedules, notifications and an audit trail. Jobs run in execution environments, which are container images with a fixed Ansible and libraries.
21.What are the limits of --check mode?Senior
Modules that support it report what they would change, but command, shell and some other tasks are skipped because Ansible cannot predict them. Later tasks that depend on skipped results can also look wrong. Treat a dry run as a good preview, not a guarantee.
22.What do run_once, delegate_to and throttle do?Senior
run_once runs a task on only one server of the group, for example a database migration. delegate_to runs a task on a different machine, for example to take a server out of a load balancer. throttle limits how many servers run that one task at the same time.