Lesson 13 of 30
Lambda scales for free because AWS owns the whole problem. An EC2 fleet scales because you built a control loop that watches a metric and acts on it — an Auto Scaling Group is that control loop, made explicit.
11 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
Traffic to a service hasn't changed at all, but one instance in its Auto Scaling Group fails a health check and is terminated. What does the ASG do?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
An Auto Scaling Group (ASG) manages a fleet of EC2 instances so it always has roughly the right number running — not too few to handle load, not too many wasting money. Three numbers define its bounds:
"Desired capacity" isn't a suggestion — it's a target the ASG continuously enforces. Terminate an instance manually, or one fails an EC2 health check, and the ASG launches a replacement to get back to the desired count, independent of whether traffic changed at all. That's self-healing, and it happens even with scaling never coming into play.
Scaling policies decide how desired capacity itself changes in response to demand:
A CloudWatch alarm — the same mechanism from the monitoring lesson — watches an ASG's average CPU utilization. It crosses 70% and stays there for the evaluation window. That alarm state change triggers a scaling policy, which raises desired capacity by a defined amount. The ASG launches new instances from its launch template (which defines the AMI, instance type, and configuration every new instance gets), and registers them with the load balancer once they pass their health checks.
"Would you use an Auto Scaling Group or just let Lambda handle it?" tests whether a candidate reasons about who owns the scaling logic — Lambda scaling being free and automatic in exchange for its execution constraints, versus an ASG requiring explicit policies and launch templates in exchange for long-running, fully controllable compute — rather than treating "auto-scaling" as one interchangeable feature everywhere.