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 61–75 of 126 questions

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

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

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

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

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

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

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

68.What is the difference between a security group and a NACL?MidAWS

A security group belongs to an instance, is stateful and only has allow rules. A NACL belongs to a subnet, is stateless, and has numbered allow and deny rules. Most control is done with security groups.

69.How does a private subnet reach the internet?MidAWS

Through a NAT gateway in a public subnet. The private route table sends 0.0.0.0/0 to the NAT gateway, which sends it on through the internet gateway. Nothing from outside can start a connection in.

70.What is the difference between RDS Multi-AZ and read replicas?MidAWS

Multi-AZ keeps a standby copy in another zone for failover and is about availability. Read replicas are extra copies that serve reads and are about performance. They can be used together.

71.How does a DynamoDB table choose its keys?MidAWS

The partition key spreads data and finds items quickly. An optional sort key orders items inside one partition key. Design keys for your queries, because you cannot query well by other attributes without an index.

72.What is the difference between an ALB and an NLB?MidAWS

An Application Load Balancer works at layer 7, understands HTTP, and routes by path or host. A Network Load Balancer works at layer 4, is very fast, and keeps a fixed IP address.

73.How does Auto Scaling decide to add servers?MidAWS

A scaling policy watches a metric, such as average CPU or requests per target. Target tracking adds or removes instances to hold the metric near your target, within the minimum and maximum you set.

74.What does CloudTrail record, and how is it different from CloudWatch?MidAWS

CloudTrail records who called which AWS API and when. CloudWatch collects metrics and logs about how things are running. Use CloudTrail to audit, CloudWatch to watch health.

75.How do you reach a server without opening SSH?MidAWS

Use Systems Manager Session Manager. The instance has a role and the SSM agent, and you get a shell through AWS with IAM control and logging, with no inbound port open.