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 31–45 of 67 questions

31.What is infrastructure as code, and why use it?BeginnerTerraform

It means describing servers, networks and other cloud things in files instead of clicking in a console. The files live in Git, so changes are reviewed, repeatable and have history. You can build the same setup again for dev, prod or disaster recovery.

32.What do terraform init, plan and apply each do?BeginnerTerraform

init downloads providers and sets up the backend. plan compares your code with the state and shows what would change, without changing anything. apply makes those changes. Saving the plan with -out and applying that file makes sure you apply exactly what was reviewed.

33.What is a provider?BeginnerTerraform

A plugin that knows how to talk to one platform's API, such as AWS, Azure, GitLab or Kubernetes. You choose it and its version in required_providers, and init downloads it.

34.What is the difference between a variable, a local and an output?BeginnerTerraform

A variable is an input from outside. A local is a named value worked out inside the code. An output is a result shown to you or read by other code.

35.What is the state file, and why does it matter?BeginnerTerraform

State records which real resource each block in your code manages, plus its settings. Terraform compares it with your code and the real cloud to decide what to change. Losing it means Terraform no longer knows what it owns.

36.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.

37.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.

38.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.

39.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.

40.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.

41.What is the difference between a Region and an Availability Zone?BeginnerAWS

A Region is a geographic area, such as eu-west-1. It has several Availability Zones, which are separate data centers a short distance apart with their own power and network. Spreading across zones keeps your app up if one zone fails.

42.What is the shared responsibility model?BeginnerAWS

AWS secures the cloud itself: buildings, hardware and the base services. You secure what you put in it: your data, access rules, operating system settings and network rules.

43.Why should you not use the root user for daily work?BeginnerAWS

It can do everything and cannot be limited. Protect it with MFA, lock away its keys, and use an IAM Identity Center or IAM user with limited rights every day.

44.What is an IAM role and when do you use it?BeginnerAWS

A role is a set of permissions that something can take on for a short time, without a password or long-term key. Use roles for EC2, Lambda and containers, and for people through SSO.

45.How do S3 storage classes differ?BeginnerAWS

Standard is for frequent access. Infrequent Access is cheaper to store but charges to read. Glacier classes are very cheap for archives but take minutes to hours to get data back. Intelligent-Tiering moves objects for you.