What are the main EC2 instance families, and how do you choose one?
AWS · Basic level
Answer
EC2 families include general purpose, compute optimized, memory optimized, storage optimized, accelerated computing, and burstable. I pick based on the bottleneck: CPU, memory, disk, network, GPU, latency, and cost per unit of work.
Technical explanation
Instance selection should consider Graviton compatibility, EBS bandwidth, ENA/network performance, and price-performance, not just vCPU and RAM.
Compute design should balance availability, scaling speed, startup time, instance limits, health checks, and deployment rollback, not just raw instance size.
Autoscaling and load balancing only work well when health checks reflect readiness and when applications externalize state.
Cost optimization should be tied to utilization data and workload tolerance for interruption, commitment, and architecture changes.
Hands-on example
1. Build a launch template or workload definition with IAM role, security groups, user data/bootstrap, health endpoint, and CloudWatch metrics.
2. Place compute behind an ALB/NLB or scaling group and run a controlled load test to observe scaling and health behavior.
3. Tune scaling policy, warmup/cooldown, target group health checks, and rollback procedure.
4. Compare cost and reliability after the test, then promote the configuration through IaC.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More AWS interview questions
- What is the AWS shared responsibility model, and where is the line between AWS and the customer?
- Explain the difference between a Region, an Availability Zone, and an Edge Location.
- What is a VPC, and what are its core components (subnets, route tables, IGW, NAT)?
- Difference between a public and a private subnet, and how does each reach the internet?
- What is the difference between a Security Group and a Network ACL?
- Are Security Groups stateful or stateless? What about NACLs?
- What is an Internet Gateway versus a NAT Gateway, and when do you need each?
- How does a NAT Gateway differ from a NAT instance?