Here are 10 high-level EC2 scenario-based questions to challenge your AWS & DevOps skills
1. Your EC2 instance is running but you can’t connect via SSH. What troubleshooting steps will you take?
Check Security Group inbound rules (port 22 open to your IP).
Verify Network ACLs (NACLs not blocking inbound/outbound).
Confirm instance’s Public IP / Elastic IP.
Validate Key Pair and correct permissions on .pem.
Ensure SSM Agent is installed (Session Manager can help).
Check system logs on the console for OS-level issues.
2. You terminated an EC2 instance by mistake. How can you prevent this in the future?
Enable Termination Protection in EC2 settings.
Use IAM permissions to restrict TerminateInstances.
Tag critical instances and set resource policies.
3. Your EC2 instance needs to access an S3 bucket securely. What’s the best way to configure this?
Best practice: Attach an IAM Role with least privilege policy to the EC2 instance.
Avoid hardcoding credentials or using access keys.
4. An application hosted on EC2 needs to be highly available across AZs. How will you achieve it?
Use an Auto Scaling Group (ASG) spanning multiple AZs.
Place EC2 instances behind an Elastic Load Balancer (ALB/NLB).
Store shared data in EFS, S3, or RDS Multi-AZ.
5. You need to run scheduled scripts on EC2 daily. What approaches are available?
Use cron jobs inside EC2 for OS-level scheduling.
Or AWS Systems Manager Automation Documents.
Or trigger scripts from EventBridge / CloudWatch Events to call SSM Run Command.
6. How will you enable auto-scaling for EC2 based on CPU utilization?
Create an Auto Scaling Group with a Launch Template.
Define a CloudWatch alarm on CPUUtilization.
Attach a scaling policy (step or target tracking).
7. You’re seeing high latency between EC2 and RDS in the same region. What might be wrong?
Verify EC2 and RDS are in the same VPC and AZ.
Check security groups and subnet routing.
Ensure DNS resolution is correct (use private endpoint).
Check instance type & network performance (Enhanced Networking for EC2).
8. You need to move an EC2 instance to another region. What are your options?
Create an AMI of the instance and copy AMI to the target region, then launch.
Or take an EBS snapshot and copy to the other region, then create a volume.
For full migration, use AWS MGN or third-party tools.
9. Your EC2 disk space keeps filling up. How do you investigate and fix this?
SSH into the instance, run df -h and du -sh /* to find large directories.
Rotate or offload logs to CloudWatch Logs or S3.
Expand EBS volume size or use EBS Elastic Volumes.
Automate cleanup (logrotate, tmp cleaner).
10. You have to reduce EC2 costs without affecting performance. Which AWS features can you use?
Use Right Sizing (smaller instance types).
Spot Instances or Savings Plans for predictable workloads.
Turn off non-production EC2 during off-hours (use Instance Scheduler).
Consider Graviton-based instances for better price/performance.
Comments
Post a Comment