AWS EC2 Interview Questions (Top 100 Questions with Answers)
Master AWS EC2 Interview Questions with production-oriented questions covering EC2 architecture, instance types, AMIs, EBS, Security Groups, Auto Scaling, Load Balancers, networking, monitoring, pricing models, troubleshooting, and real-world production scenarios.
Module Navigation
Previous: AWS Global Infrastructure QA | Parent: AWS Learning Path | Next: AWS S3 QA
Introduction
Amazon Elastic Compute Cloud (EC2) is AWS's virtual server service that allows you to run applications on demand with complete control over compute resources.
EC2 is one of the most frequently asked AWS interview topics because almost every production application uses it.
This guide contains the Top 100 AWS EC2 Interview Questions asked in
- AWS Solution Architect
- Cloud Engineer
- Java Developer
- DevOps Engineer
- Platform Engineer
- Site Reliability Engineer
EC2 Learning Roadmap
EC2 Basics
│
▼
AMI
│
▼
Instance Types
│
▼
Storage (EBS)
│
▼
Networking
│
▼
Security
│
▼
Load Balancer
│
▼
Auto Scaling
│
▼
Production Architecture
EC2 Fundamentals
1. What is Amazon EC2?
Amazon EC2 (Elastic Compute Cloud) is a web service that provides secure, resizable virtual servers in the cloud.
2. Why use EC2?
- On-demand compute
- Full OS control
- Elastic scaling
- Pay-as-you-go pricing
- High availability
3. What is an EC2 Instance?
A virtual machine running inside AWS.
4. What is virtualization?
Technology that allows multiple virtual machines to share physical hardware.
5. What is a Hypervisor?
Software that creates and manages virtual machines.
AWS primarily uses the Nitro Hypervisor.
EC2 Architecture
6. EC2 Architecture
Application
│
▼
Load Balancer
│
▼
Auto Scaling Group
│
▼
EC2 Instance
│
▼
EBS Volume
7. What is the AWS Nitro System?
AWS Nitro is the hardware and software platform powering modern EC2 instances with improved security, performance, and virtualization.
8. What operating systems are supported?
- Linux
- Windows
- Ubuntu
- Red Hat
- SUSE
- Amazon Linux
9. Can EC2 run containers?
Yes.
Using
- Docker
- ECS
- Kubernetes (EKS)
10. Can multiple applications run on one EC2?
Yes.
AMI
11. What is AMI?
Amazon Machine Image.
Template used to launch EC2 instances.
12. AMI contains?
- Operating System
- Software
- Configuration
- Startup Scripts
13. Types of AMIs?
- AWS Managed
- Marketplace
- Custom AMIs
14. Why create Custom AMI?
Reusable application deployments.
15. Can AMIs be copied across Regions?
Yes.
Instance Types
16. What are EC2 Instance Types?
Hardware configurations optimized for different workloads.
17. General Purpose Instances?
Example
T3
M6i
18. Compute Optimized?
Example
C6i
19. Memory Optimized?
Example
R6i
X2idn
20. Storage Optimized?
Example
I4i
D3
21. GPU Instances?
Used for
- AI
- ML
- Graphics
22. Burstable Instances?
T-series.
CPU credits.
23. Which instance for Java APIs?
Typically M-series or C-series depending on workload.
24. Which instance for databases?
Memory Optimized.
25. Which instance for machine learning?
GPU Instances.
Storage
26. What is EBS?
Elastic Block Store.
Persistent storage for EC2.
27. EBS vs Instance Store?
| EBS | Instance Store |
|---|---|
| Persistent | Temporary |
| Network Attached | Local Disk |
| Snapshots | No Snapshots |
28. Can EBS survive EC2 termination?
Yes, if configured not to delete on termination.
29. What are EBS Snapshots?
Point-in-time backups stored in Amazon S3.
30. Can EBS volume be resized?
Yes.
Networking
31. Public IP?
Accessible over the internet.
32. Private IP?
Used inside the VPC.
33. Elastic IP?
Static public IPv4 address.
34. ENI?
Elastic Network Interface.
35. Security Group?
Virtual firewall for EC2.
36. Network ACL?
Subnet-level firewall.
37. Difference between Security Group and NACL?
| Security Group | NACL |
|---|---|
| Instance Level | Subnet Level |
| Stateful | Stateless |
38. Can EC2 exist without VPC?
New EC2 instances are launched inside a VPC.
39. How do you connect to Linux EC2?
SSH.
40. How do you connect to Windows EC2?
RDP.
Security
41. Key Pair?
Public/private key authentication.
42. Security Group Best Practices?
- Least privilege
- Avoid opening all ports
- Restrict SSH access
43. IAM Role for EC2?
Allows EC2 to access AWS services without storing credentials.
44. Why not store AWS keys on EC2?
Security risk.
Use IAM Roles instead.
45. Can Security Groups deny traffic?
No.
Only allow rules are supported.
Auto Scaling
46. What is Auto Scaling?
Automatically launches or terminates EC2 instances based on demand.
47. Benefits?
- High Availability
- Cost Optimization
- Elastic Scaling
48. Scaling Policies?
- Target Tracking
- Step Scaling
- Scheduled Scaling
49. Minimum Capacity?
Minimum running instances.
50. Desired Capacity?
Target number of running instances.
Load Balancer
51. Why Load Balancer?
Distributes traffic across EC2 instances.
52. Types of ELB?
- Application Load Balancer
- Network Load Balancer
- Gateway Load Balancer
- Classic Load Balancer (legacy)
53. ALB?
Layer 7.
HTTP/HTTPS.
54. NLB?
Layer 4.
TCP/UDP.
55. Health Checks?
Automatically remove unhealthy instances.
Monitoring
56. EC2 Monitoring?
CloudWatch.
57. Default Monitoring?
5-minute metrics.
58. Detailed Monitoring?
1-minute metrics.
59. CloudWatch Agent?
Collects OS-level metrics such as memory, disk, and processes.
60. CloudTrail?
Tracks AWS API calls.
Pricing
61. On-Demand Instances?
Pay by usage.
62. Reserved Instances?
Long-term discounted pricing.
63. Savings Plans?
Flexible pricing model.
64. Spot Instances?
Use unused AWS capacity at large discounts.
65. Dedicated Hosts?
Dedicated physical servers.
Production Scenarios
66. EC2 CPU reaches 100%.
Scale out using Auto Scaling.
67. Instance becomes unhealthy.
Replace automatically through Auto Scaling.
68. Disk becomes full.
Resize EBS volume.
69. Users cannot access application.
Check
- Security Groups
- Load Balancer
- Health Checks
- Route Tables
70. SSH connection fails.
Check
- Security Group
- Key Pair
- Instance Status
- Network ACL
- Route
71. High memory usage.
Use Memory Optimized instances or tune application.
72. Need zero downtime deployment.
Use
Rolling Deployment
or
Blue-Green Deployment.
73. Instance accidentally terminated.
Launch replacement from AMI.
74. Need static public IP.
Use Elastic IP.
75. Application traffic suddenly increases.
Use
ALB
Auto Scaling Group.
Architect-Level Questions
76. Design highly available EC2 architecture.
Deploy across multiple Availability Zones.
77. Multi-AZ Architecture?
ALB
↓
Auto Scaling
↓
EC2 Instances in multiple AZs.
78. Stateless EC2?
Store sessions in Redis or DynamoDB.
79. How do you deploy microservices?
EC2
Docker
or ECS/EKS.
80. Session management?
Use
Redis
or
ElastiCache.
Senior Interview Questions
81. EC2 vs Lambda?
| EC2 | Lambda |
|---|---|
| Server Management | Serverless |
| Long Running | Short Running |
| Full Control | Managed Runtime |
82. EC2 vs ECS?
EC2 provides virtual machines.
ECS manages containers.
83. EC2 vs EKS?
EKS provides managed Kubernetes.
84. EC2 vs Beanstalk?
Elastic Beanstalk automates EC2 deployment and management.
85. EC2 vs Fargate?
Fargate eliminates server management.
86. Common production issues?
- CPU spikes
- Memory leaks
- Disk full
- Security Group misconfiguration
- Auto Scaling failures
87. Best practices?
- Multi-AZ
- Auto Scaling
- IAM Roles
- Monitoring
- Backups
88. Common interview mistakes?
- Confusing Security Groups with NACLs
- Storing AWS keys on EC2
- Ignoring Auto Scaling
89. What do interviewers expect?
- Architecture knowledge
- Troubleshooting skills
- Production experience
90. Cost optimization?
- Spot Instances
- Savings Plans
- Auto Scaling
- Right Sizing
91. Blue-Green Deployment?
Deploy a new environment, validate it, then switch traffic.
92. Rolling Deployment?
Update instances gradually while serving traffic.
93. Immutable Infrastructure?
Replace instances instead of modifying them.
94. Bastion Host?
Secure EC2 instance used to access private instances.
95. Session Manager vs SSH?
AWS Systems Manager Session Manager provides secure shell access without opening SSH ports.
96. How do you secure production EC2?
- IAM Roles
- Security Groups
- Encryption
- Patch Management
- Monitoring
97. What should be monitored?
- CPU
- Memory
- Disk
- Network
- Status Checks
- Application Logs
98. Disaster Recovery?
- AMIs
- EBS Snapshots
- Auto Scaling
- Multi-AZ
- Cross-Region Backup
99. Production Readiness Checklist?
- Auto Scaling
- ALB
- IAM Role
- Monitoring
- Backup
- Logging
- Security
100. How should you prepare for EC2 interviews?
- Launch EC2 instances
- Configure Security Groups
- Practice Auto Scaling
- Use Load Balancers
- Build Multi-AZ architectures
Production EC2 Architecture
Internet
│
▼
Route 53 (DNS)
│
▼
Application Load Balancer
│
┌───────────┴───────────┐
▼ ▼
EC2 (AZ-1) EC2 (AZ-2)
│ │
└───────────┬───────────┘
▼
Auto Scaling Group
│
▼
EBS Volumes
│
▼
CloudWatch Logs
Quick Revision
| Topic | Key Point |
|---|---|
| EC2 | Virtual Machine |
| AMI | Machine Template |
| EBS | Persistent Storage |
| Security Group | Instance Firewall |
| Elastic IP | Static Public IP |
| Auto Scaling | Automatic Scaling |
| ALB | Layer 7 Load Balancer |
| NLB | Layer 4 Load Balancer |
| IAM Role | Secure AWS Access |
| CloudWatch | Monitoring |
Interview Tips
During AWS EC2 interviews:
- Explain EC2 architecture before discussing features.
- Understand the difference between AMI, Instance, and EBS.
- Be able to compare Security Groups and Network ACLs.
- Know when to use ALB, NLB, Auto Scaling, and Elastic IP.
- Discuss IAM Roles instead of storing AWS credentials.
- Relate answers to production scenarios such as high traffic, failures, and zero-downtime deployments.
- Mention cost optimization using Spot Instances, Savings Plans, and Auto Scaling.
Summary
Amazon EC2 is the foundation of many AWS workloads and remains one of the most important services for cloud engineers. Strong EC2 interview performance requires understanding instances, AMIs, EBS, networking, security, Auto Scaling, Load Balancers, monitoring, pricing models, and production best practices.
Mastering these 100 AWS EC2 interview questions prepares you for AWS Cloud Engineer, DevOps Engineer, Java Developer, Platform Engineer, Site Reliability Engineer, and Solution Architect interviews.