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 316–330 of 475 questions
316.Someone applied from their laptop and broke prod. How do you stop it happening again?SeniorTerraform
Make CI the only path: the production write role can only be assumed by the pipeline through OIDC, the state bucket is locked down, and every change needs a reviewed merge request with a plan. Add drift detection so manual changes are spotted quickly.
317.What is Ansible and why is it called agentless?BeginnerAnsible
Ansible is a tool that configures servers from text files. It is agentless because it connects over SSH (or WinRM), runs small scripts and leaves. Nothing has to be installed on the managed servers except Python.
318.What is the difference between an inventory and a playbook?BeginnerAnsible
The inventory lists which servers exist and how they are grouped. The playbook says what to do on them.
319.What does idempotent mean, and why does it matter?BeginnerAnsible
Running a task again gives the same result and makes no change if the server is already correct. It makes playbooks safe to run many times.
320.What is an ad-hoc command?BeginnerAnsible
A single module run from the command line, such as ansible web -m ping. It is good for quick checks and one-off jobs.
321.What is a module?BeginnerAnsible
A small, ready-made tool for one job, such as installing a package or copying a file. Tasks call modules.
322.Why prefer modules over command or shell?MidAnsible
Modules check the current state and only change what is needed, and they report changed correctly. command and shell run blindly, so you must add creates or changed_when to make them safe.
323.How does variable precedence work in practice?MidAnsible
More specific or deliberate places win. Role defaults are lowest, then group_vars, host_vars and play vars, and extra vars passed with -e are strongest.
324.What are facts?MidAnsible
Data Ansible collects about each server at the start of a play, such as the OS name, IP addresses and memory. You can use them in conditions and templates.
325.What is a handler and when does it run?MidAnsible
A task that runs only when notified by a task that reported changed. It runs once at the end of the play, for example to restart a service after a config change.
326.What is a role?MidAnsible
A folder with a standard layout (tasks, handlers, templates, defaults and more) that packages one job so it can be reused and shared.
327.How do you manage secrets?MidAnsible
With Ansible Vault: encrypt files or single values, pass the password at run time, keep the password out of Git, and use no_log on tasks that handle secrets.
328.Why use a dynamic inventory?MidAnsible
In the cloud, servers come and go. A dynamic inventory plugin asks the provider for the current servers on each run and can build groups from tags.
329.How do you do a rolling update with no downtime?MidAnsible
Use serial to update in batches, often one server first and then larger groups, with max_fail_percentage to stop if too many fail, plus health checks and a load balancer.
330.How do block, rescue and always work?SeniorAnsible
block holds the normal tasks. If one fails, rescue runs, for example to roll back. always runs in either case, like finally.