Interview Q&A / AWS & Cloud

INTERVIEW Q&A · 60 QUESTIONS

AWS & Cloud interview questions

EC2, S3, Lambda, IAM and VPC basics, with when to pick which service.

  1. What is the difference between EC2 and Lambda, and when would you pick each?

    EC2 gives you a virtual server that you run and manage, billed while it is running. Lambda runs your function only when an event arrives, scales automatically and bills per request and execution time. Pick Lambda for short, spiky, event-driven work; pick EC2 for long-running, steady or highly customised workloads.

    BeginnerIn-depth4 min read
  2. How do an Auto Scaling group and a load balancer work together on AWS?

    An Auto Scaling group keeps the right number of healthy EC2 instances running, adding or removing them based on policies such as target CPU. A load balancer spreads incoming traffic across those instances in multiple AZs. The ASG registers new instances with the load balancer's target group and replaces any that fail health checks.

    AdvancedIn-depth4 min read
  3. How do you read an EC2 instance type name like m5.large or c7g.xlarge?

    The letter is the family (m general purpose, c compute, r memory, t burstable), the number is the generation, extra letters mark features such as g for Graviton, and the part after the dot is the size.

    BeginnerQuick answer1 min read
  4. What is an AMI and how is it used when launching EC2 instances?

    An Amazon Machine Image is a template holding the operating system, installed software and settings used to start an EC2 instance. You can launch many identical instances from one AMI, and copy it across Regions.

    BeginnerQuick answer1 min read
  5. What is an Elastic IP address and how is it different from a normal public IP on EC2?

    A normal public IP is assigned from AWS's pool and can change when the instance is stopped and started. An Elastic IP is a static public IPv4 address you own in your account until you release it and can remap to another instance.

    BeginnerQuick answer1 min read
  6. Why use an IAM role for an EC2 instance instead of storing access keys on it?

    A role gives the instance temporary credentials that AWS rotates automatically, so no long-lived secret sits on disk or in code. Access keys can leak through code repos, images or logs and stay valid until someone revokes them.

    BeginnerQuick answer1 min read
  7. What are EC2 placement groups and what are the three strategies?

    A placement group controls how instances sit on physical hardware. Cluster packs them close for low latency, spread puts each on separate hardware to limit correlated failure, and partition groups them in racks that do not share hardware.

    IntermediateQuick answer1 min read
  8. What is EC2 instance store and how is it different from EBS?

    Instance store is disk physically attached to the host computer, giving very fast but temporary storage. Its data is lost when the instance stops, terminates or the hardware fails. EBS is network-attached and persists independently of the instance.

    IntermediateQuick answer1 min read
  9. What is EC2 user data and how is it different from instance metadata?

    User data is a script or text you give an instance at launch, typically run once to install software. Instance metadata is information about the running instance, such as its ID, IP and IAM role credentials, which the instance reads from a local endpoint.

    IntermediateQuick answer1 min read
  10. What is the difference between target tracking, step and scheduled scaling in an Auto Scaling group?

    Target tracking holds a metric near a value you set, like 50% CPU. Step scaling adds or removes capacity in sized steps based on alarm thresholds. Scheduled scaling changes capacity at set times for predictable load.

    IntermediateQuick answer1 min read
  11. Can you use Spot Instances inside an Auto Scaling group, and how do you do it safely?

    Yes. A mixed instances policy lets an ASG combine On-Demand and Spot across several instance types. Keep a small On-Demand base, spread Spot across types and AZs, and make the app handle the two-minute interruption notice.

    AdvancedQuick answer1 min read