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 1–8 of 8 questions

Learn Ansible →
1.Why prefer modules over command or shell?Mid

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.

2.How does variable precedence work in practice?Mid

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.

3.What are facts?Mid

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.

4.What is a handler and when does it run?Mid

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.

5.What is a role?Mid

A folder with a standard layout (tasks, handlers, templates, defaults and more) that packages one job so it can be reused and shared.

6.How do you manage secrets?Mid

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.

7.Why use a dynamic inventory?Mid

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.

8.How do you do a rolling update with no downtime?Mid

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.