Questions 7 to 9

Explanations for questions 7 to 9

We'll cover the following

Question 7

An e-commerce website runs on Amazon EC2 instances behind an Application Load Balancer (ALB). The application is stateless and elastic and scales from a minimum of 10 instances up to a maximum of 200 instances. For at least 80% of the time, at least 40 instances are required.

Which solution should be used to minimize costs?

  1. Purchase Reserved Instances to cover 200 instances.
  2. Purchase Reserved Instances to cover 80 instances. Use Spot Instances to cover the remaining instances.
  3. Purchase On-Demand Instances to cover 40 instances. Use Spot Instances to cover the remaining instances.
  4. Purchase Reserved Instances to cover 40 instances. Use On-Demand and Spot Instances to cover the remaining instances.

Correct Answer: 4

Explanation: In this case, at least 40 instances are required 80% of the time, for which Reserved Instances are a good option. Reserved Instances also provide discounts of up to 72% as compared to On-Demand Instances. For the remainder, On-Demand and Spot Instances should be used. Spot can be used as the application is stateless and it will minimize costs, and On-Demand can be used when Spot Instances aren’t available or when the price is excessive.

INCORRECT: “Purchase Reserved Instances to cover 200 instances.” is incorrect as the extra instances above 40 instances are only used less than 20% of the time. It would be better to reserve 40 instances only.

INCORRECT: “Purchase Reserved Instances to cover 80 instances. Use Spot Instances to cover the remaining instances.” is incorrect as only 40 instances should be reserved as these are used 80% of the time. The remainder should be Spot Instances.

INCORRECT: “Purchase On-Demand Instances to cover 40 instances. Use Spot Instances to cover the remaining instances.” is incorrect as on-demand instances will not minimize costs. For the instances that will be required at a minimum, Reserved Instances should be used.

CORRECT: “Purchase Reserved Instances to cover 40 instances. Use On-Demand and Spot Instances to cover the remaining instances.” is the correct answer.

References: https://aws.amazon.com/ec2/pricing/reserved-instances/

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.