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 106–120 of 192 questions
106.How do you roll back a Terraform change?MidTerraform
There is no rollback button. Revert the commit and apply again so the code puts things back. If the state file itself is broken, restore an earlier version from the backend's versioning (for example S3 versioning).
107.Why does my plan show a change every time even though nothing changed?MidTerraform
Something differs on every run: a value like timestamp() in tags, another tool editing the same field, or the provider formatting a value differently (common with JSON policies). Fix the code, use jsonencode, or add ignore_changes for fields another system owns.
108.terraform apply says the resource already exists. Why?MidTerraform
The resource exists in the cloud but not in state, because it was created by hand or the state was lost. Import it with an import block instead of creating it again.
109.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.
110.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.
111.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.
112.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.
113.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.
114.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.
115.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.
116.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.
117.ECS or EKS?MidAWS
ECS is simpler and AWS-only, so it is a good start. EKS runs Kubernetes, which is more work but more portable and has a bigger ecosystem. With Fargate, neither needs you to manage servers.
118.When should you use SQS and when SNS?MidAWS
SQS is a queue: one consumer takes each message, and the queue holds it until it is handled. SNS is publish and subscribe: one message goes to many subscribers. They are often combined, with SNS sending to several SQS queues.
119.What is the difference between a task role and a task execution role in ECS?MidAWS
The execution role lets ECS pull the image and write logs. The task role is what your own code uses to call AWS services, such as reading an S3 bucket.
120.How can you get a shell on an EC2 instance without opening port 22?MidAWS
Use Systems Manager Session Manager. The instance needs the SSM Agent and an IAM role with SSM permissions. The session goes over outbound HTTPS and is logged.