yoklainterview sim

DevOps / Cloud Aws Compute Ec2 Lambda Interview Questions

75 verified DevOps / Cloud Aws Compute Ec2 Lambda interview questions — solve with answers, learn from explanations, test yourself in a real simulation.

Try the real simulation →

Sample questions

Aws Compute Ec2 LambdaDifficulty 1
A team needs to run a batch job that mostly does heavy numeric computation with little RAM use. Which EC2 instance family is designed for this?
  • aMemory-optimized (R family) — extra RAM per vCPU for in-memory datasets
  • bCompute-optimized (C family) — high vCPU-to-RAM ratio for CPU-bound workloads
  • cStorage-optimized (I family) — high-IOPS local NVMe disks for I/O-bound workloads
  • dGeneral purpose (M family) — balanced vCPU/RAM for mixed workloads
Explanation:Compute-optimized (C family) instances offer a high vCPU-to-memory ratio, matching a CPU-bound batch job with light RAM needs. Memory-optimized (a) targets workloads needing lots of RAM per vCPU; storage-optimized (c) targets high local disk throughput; general purpose (d) is a balanced middle ground, not tuned for this CPU-heavy case.
Aws Compute Ec2 LambdaDifficulty 1
What is an AMI (Amazon Machine Image) used for when launching an EC2 instance?
  • aIt defines the network route table and security group rules for the instance
  • bIt is a billing template that determines the hourly price of the instance
  • cIt is a template containing the OS, pre-installed software, and configuration used to boot the instance
  • dIt is a monitoring agent that must be installed after the instance is launched
Explanation:An AMI is the launch template: root volume snapshot with OS + any pre-installed software/configuration, plus launch permissions and block device mapping. Networking (a) is configured separately via VPC/security groups; pricing (b) depends on instance type and purchasing option, not the AMI; monitoring agents (d) are optional software, not what defines an AMI.
Aws Compute Ec2 LambdaDifficulty 1
What is the primary purpose of an Auto Scaling Group (ASG) health check?
  • aTo detect unhealthy instances and automatically terminate + replace them to maintain the desired capacity
  • bTo measure the CPU utilization of instances for billing purposes
  • cTo validate that the AMI used still exists in the region
  • dTo enforce a minimum uptime requirement before an instance can be terminated
Explanation:ASG health checks (EC2 status checks and/or ELB health checks) continuously monitor instances; an instance marked unhealthy is terminated and replaced so the group stays at its desired capacity. It has nothing to do with billing (b), AMI existence checks (c), or a minimum-uptime rule (d) — none of those are what health checks measure.
Aws Compute Ec2 LambdaDifficulty 2
An ASG lifecycle hook is added with state PENDING:WAIT on instance launch. What does this hook let you do?
  • aForce the ASG to skip the health check for that instance
  • bPermanently pause the ASG from launching any further instances of any kind going forward
  • cChange the instance's AMI after it has already booted
  • dPause the instance in a wait state so custom actions can run before InService
Explanation:A launch lifecycle hook holds the instance in Pending:Wait until you complete the hook (or a timeout elapses), giving time for bootstrap actions — install agents, register with external systems — before the instance is put InService. It doesn't skip health checks (a), doesn't pause the whole ASG (b), and doesn't let you swap the AMI post-boot (c) — the AMI is fixed at launch.
Aws Compute Ec2 LambdaDifficulty 1
A Spot instance is being used to save cost on a fault-tolerant batch workload. What is the key tradeoff of Spot compared to On-Demand?
  • aSpot instances cannot be attached to an Auto Scaling Group at all
  • bAWS can interrupt a Spot instance with short notice when it needs the capacity back
  • cSpot instances always run on older, slower hardware generations than On-Demand, regardless of instance family chosen
  • dSpot instances require a 1-year minimum commitment, unlike On-Demand
Explanation:Spot instances draw from spare EC2 capacity at a discount, but AWS can reclaim that capacity with a short interruption notice — the workload must tolerate being stopped/terminated. Spot instances CAN be used in an ASG (a is wrong), run the same hardware as On-Demand for that instance type (c is wrong), and have no minimum commitment — that describes Reserved Instances / Savings Plans (d is wrong).
Aws Compute Ec2 LambdaDifficulty 2
A team launches a fleet of Spot instances for a stateless web-crawling job. Shortly before EC2 interrupts one instance, what signal can the workload monitor?
  • aA Spot interruption notice via instance metadata or EventBridge, generally about two minutes before termination
  • bNothing — Spot instances are terminated with zero warning, by design
  • cA guaranteed 24-hour grace period before any Spot instance can be reclaimed
  • dAn automatic migration of the workload to an On-Demand instance with no code changes required
Explanation:EC2 publishes a Spot interruption notice roughly two minutes before reclaiming a Spot instance (pollable from instance metadata, or delivered as an EventBridge event), giving the workload a short window to checkpoint or drain gracefully. There is no zero-warning design (b), no 24-hour grace guarantee (c), and no automatic transparent migration to On-Demand (d) — the application itself must react to the notice.

Test yourself against the 3375-question DevOps / Cloud bank.

Start interview