AWS Compute Interview Questions: EC2, Lambda, ECS and Fargate

Reviewed by Mark Dickie · Last updated

5 questions on this page you can answer and see marked on the spot. Go to the first one

AWS compute is the set of services that runs your code, mainly EC2 virtual machines and Lambda functions, plus ECS and Fargate containers. Interviewers use it to check whether you can match a workload to the right service and state the trade-off. Expect questions on EC2 instance families and purchase options, Auto Scaling behavior, Lambda limits and cold starts, and container networking. The failure cases matter as much as the defaults: a Spot interruption, a Lambda timeout, or a task that cannot reach its image registry.

Which AWS compute service fits a given workload?

TopicWhat to be able to explain
EC2 instance familiesM for general purpose, C for compute-optimized, R for memory-optimized, T for burstable instances that run on CPU credits
Purchase optionsOn-Demand, Savings Plans, Reserved Instances, and Spot, which gets a two-minute interruption notice
Auto Scaling groupsLaunch templates, target tracking policies, and lifecycle hooks that hold an instance before it terminates
Lambda limitsA 15-minute maximum timeout, memory from 128 MB to 10,240 MB, and CPU allocated in proportion to memory
Lambda cold startsProvisioned concurrency keeps environments initialized; reserved concurrency caps how many run at once
ECS and FargateTask definitions, the difference between a service and a standalone task, and awsvpc mode, which gives each task its own network interface
Placement groupsCluster for low latency, spread for isolating instances across hardware, partition for large distributed systems

What hands-on exercises prepare you for AWS compute questions?

  1. Launch a t3 instance, push CPU past its baseline, and watch the CPU credit balance in CloudWatch.
  2. Read the instance metadata path for a Spot interruption notice from inside a running Spot instance, and decide what your app does in the two minutes it has.
  3. Set a Lambda timeout shorter than a downstream call, then find the "Task timed out" line and the REPORT line in CloudWatch Logs.
  4. Run a Fargate task in a private subnet with no NAT gateway and no VPC endpoints, and see why it fails to pull its image.

Key facts

  • Tarmac has 78 AWS interview questions on this topic, 10 of them on this page, at difficulty 1–4 of 5.
  • Tarmac tracked 2,755 job postings asking for AWS in November 2026.
  • Roles asking for AWS advertise a median base salary of £80,000, across 1,117 job postings as of November 2026.
  • Tarmac last reviewed these AWS interview questions on 23 November 2026.

At a glance

Questions10 shown · 78 in the bank
Difficulty1–4 of 5
FormatsMultiple answer, Design exercise, Short answer, True / false, Ordering, Multiple choice, Fill in the blank, Flashcard

What you'll review

  1. auto scaling
  2. ec2
  3. ecs fargate
  4. lambda

Practice questions

Try one before you open the answer. Pick an option and press Check; it's marked on the spot.

Which of the following can be used to determine when an Amazon EC2 Auto Scaling Group should scale out or scale in? (Select all that apply.)#

Options

Pick every one that applies.

Show answer

A CloudWatch alarm based on CPU utilization and Application Load Balancer metrics such as RequestCountPerTarget can both trigger an EC2 Auto Scaling Group to scale. Auto Scaling relies on CloudWatch alarms to drive scaling policies, and those alarms may use EC2 instance metrics or metrics from attached load balancers. S3 events and IAM password-policy changes are not scaling triggers.

Why:

EC2 Auto Scaling policies are driven by Amazon CloudWatch alarms, and those alarms can be based on EC2 instance metrics (like CPU utilization) or on metrics from integrated services such as an Application Load Balancer (e.g., RequestCountPerTarget). S3 events and IAM password-policy changes are not signals that an Auto Scaling Group listens to, and neither can directly trigger a scaling activity.

A small startup wants to host a simple web application on a single EC2 instance in AWS. The app serves a few hundred users per day, must be reachable from the public internet over HTTPS, and the team has no on-premises infrastructure. Design the EC2-based setup: which instance family and size you would choose and why, how you would configure networking so the instance is internet-accessible, how you would secure it, and what storage the instance would use. Cover each of these areas concretely.#

Show answer

I would launch a single t3.micro (or t3.small) EC2 instance in the us-east-1 region. The t3 family is burstable and cost-effective, which suits a workload with only a few hundred daily users and intermittent traffic spikes — the accumulated CPU credits cover short bursts without paying for sustained high performance.

For networking, I would create a VPC (or use the default VPC) with at least one public subnet in an Availability Zone. I would attach an Internet Gateway to the VPC and ensure the public subnet's route table has a default route (0.0.0.0/0) pointing to that IGW. The EC2 instance would be launched into the public subnet with a public IPv4 address (auto-assigned or via an Elastic IP) so it is reachable from the internet.

For security, I would attach a Security Group to the instance allowing inbound TCP 443 (HTTPS) from 0.0.0.0/0 so users can reach the app securely, and inbound TCP 22 (SSH) restricted to the team's office or VPN CIDR for administration. All other inbound traffic would be denied by default. I would also place a Network ACL on the subnet as a stateless secondary layer, though the Security Group is the primary control.

For storage, the instance would use an EBS-backed root volume — a gp3 general-purpose SSD of around 8–30 GB — to hold the operating system, application code, and any local data. EBS volumes persist independently of the instance lifecycle, so data survives a stop/start. I would also enable EBS snapshots for basic backup.

Why:

This design exercise tests foundational EC2 knowledge at a junior level: selecting an appropriate burstable instance family for a low-traffic workload, configuring VPC networking with a public subnet and Internet Gateway for internet accessibility, applying Security Group rules to restrict inbound traffic, and identifying EBS as the storage layer. The rubric awards points for each concrete design element, and the sample answer covers all four criteria.

When running Amazon ECS tasks on AWS Fargate, what infrastructure component does AWS Fargate eliminate the need for you to provision and manage?#

Show answer

EC2 instances. With Fargate, AWS provisions and manages the underlying compute (the servers or EC2 instances that host the containers), so you only define the task's container CPU and memory requirements.

Why:

AWS Fargate is a serverless compute engine for containers. When you launch an ECS task on Fargate, AWS provisions and manages the underlying compute infrastructure on your behalf, so the component you no longer provision, patch, or scale is the EC2 instance (server) that hosts the containers. You specify the container-level CPU and memory requirements for the task, and Fargate handles the rest. This is the core distinction from the EC2 launch type, where you own and manage the cluster's EC2 instances directly.

True or false: With AWS Fargate, you specify the CPU and memory required for your Amazon ECS task, and AWS provisions the underlying compute resources automatically, so you never have to manage EC2 instances.#

Options

Show answer

True. AWS Fargate removes the need to manage EC2 instances when running Amazon ECS tasks. You specify the CPU and memory each task needs, and Fargate provisions and runs the underlying compute automatically. This serverless model is what distinguishes Fargate from the ECS EC2 launch type.

Why:

This statement is true. AWS Fargate is a serverless compute engine for containers that works with Amazon ECS. You define each task's CPU and memory requirements, and Fargate allocates the necessary compute capacity and runs the task without you provisioning, patching, or scaling any EC2 instances. This serverless model is the defining difference between Fargate and the ECS EC2 launch type, where you manage the container instances yourself.

An EC2 instance managed by an Auto Scaling Group moves through a defined set of core lifecycle states from the moment it is first launched to the moment it is fully gone. Place these four core lifecycle states in the correct chronological order, from earliest to latest.#

Put these in order

Show answer

The core lifecycle states of an EC2 instance in an Auto Scaling Group, in chronological order, are: Pending → InService → Terminating → Terminated. An instance starts in Pending while it boots and registers, becomes InService once healthy, enters Terminating when the ASG removes it, and reaches Terminated once the EC2 instance is fully deleted. Each state strictly precedes the next.

Why:

Every EC2 instance in an Auto Scaling Group follows the same core lifecycle: it begins in Pending while booting, transitions to InService once healthy and registered with the load balancer (if any), moves to Terminating when the ASG decides to replace or retire it, and finally reaches Terminated once the underlying EC2 instance is fully deleted. Each state is a strict prerequisite for the next; an instance cannot skip or reorder them.

You stop a general-purpose EC2 instance that has an attached EBS-backed root volume. While the instance remains in the stopped state, which billing statement is correct?#

Options

Show answer

When an EC2 instance is stopped, you are no longer billed for instance compute hours, but you continue to be billed for any attached EBS volume storage. The EBS volume persists independently of the instance and accrues charges until it is explicitly deleted.

Why:

When an EC2 instance is stopped, AWS releases the underlying host capacity, so you stop paying for compute (the instance type's per-hour/per-second charge). However, the EBS volume's storage persists independently and continues to accrue charges at the normal GB-month rate until the volume is deleted. Therefore the statement that you are not billed for the instance's compute hours but continue to be billed for the attached EBS volume is correct and the other options either over-bill (billing for both compute and storage, or billing for compute but not storage) or under-bill (billing for nothing) what you are actually charged for.

What is a Lambda cold start, and name at least two ways to reduce its impact on latency-sensitive requests.#

Show answer

A cold start is the extra latency incurred when Lambda has to create a fresh execution environment for an invocation — downloading/unpacking the code, starting the runtime, and running your initialization (init phase) — because no warm environment is available to reuse. Subsequent invocations reuse the warm environment and skip that cost. Ways to reduce the impact: configure Provisioned Concurrency to keep N environments pre-initialized and warm; use SnapStart (e.g. for Java) to restore from a snapshot; trim the deployment package and dependencies so init is faster; move heavy setup (SDK clients, DB connections) into the init phase so it's reused and out of the request path; right-size memory (more memory = more CPU = faster init); and avoid unnecessary VPC attachment. The init phase is also billed, so cold starts cost money as well as latency.

Why:

Cold start = the one-time cost of spinning up a new execution environment (init phase) when none is warm to reuse. The signal is whether the candidate knows the real levers: Provisioned Concurrency / SnapStart to pre-warm, slimmer packages and right-sized memory to shorten init, and moving reusable setup into the init phase. Naming Provisioned Concurrency as the only answer is shallow — it costs money around the clock, so the better engineers weigh it against optimizing the function itself.

An EC2 Auto Scaling _____ is a pool of pre-initialized instances that sits alongside an Auto Scaling group, is not counted toward the group's desired capacity, and is used to reduce scale-out latency. In the default configuration, the warm pool's PoolState setting is _____, meaning instances are kept powered off in the pool and are moved to InService when the group scales out.#

Show answer

An EC2 Auto Scaling warm pool is a pool of pre-initialized instances that sits alongside an Auto Scaling group, is not counted toward the group's desired capacity, and is used to reduce scale-out latency. In the default configuration, the warm pool's PoolState setting is Stopped, meaning instances are kept powered off in the pool and are moved to InService when the group scales out.

Why:

An Auto Scaling warm pool is a set of pre-initialized instances maintained alongside an Auto Scaling group to reduce scale-out latency, and its instances are not counted toward the group's desired capacity. The warm pool's PoolState setting defaults to Stopped, which keeps instances powered off so only EBS volume charges apply. The lifecycle state Warmed:Stopped is a different concept, describing an instance's state inside the pool rather than the PoolState setting, so the blank is pinned to the PoolState value. Alternative PoolState values Running and Hibernated are non-default, so the default answer is Stopped.

When running an Amazon ECS task on the AWS Fargate launch type, which two of the following are required or enforced by the platform? Select two.#

Options

Pick every one that applies.

Show answer

On AWS Fargate, ECS tasks must use the awsvpc network mode, the only mode Fargate supports, and each task gets its own elastic network interface with a private IP address. Bridge mode with dynamic host port mapping and host network mode are not available on Fargate because each task runs in an isolated network namespace.

Why:

Fargate supports only the awsvpc network mode, so every task gets a dedicated elastic network interface (ENI) with its own private IP address and attachable security groups. Because of this, bridge mode with dynamic host port mapping does not apply, since that is an EC2-launch-type networking concept. host network mode is not supported on Fargate at all, because each task runs in its own isolated network namespace.

For an EC2 instance store (ephemeral) volume, which lifecycle actions cause the data on the volume to be lost, and which action preserves it?#

Show answer

Data is lost when the instance is stopped, hibernated, or terminated, or when the underlying host fails. Rebooting the instance preserves the data.

Why:

Instance store volumes are physically attached to the host, so their contents survive only a reboot. Stop and hibernate move the instance off its host (and hibernate also saves RAM state to the EBS root volume, not the instance store), terminate deletes the instance, and a host failure ends the physical storage. This is why instance store data must be treated as a cache or replicated copy, not durable state.

Related interview questions

Job market

See aws salaries and hiring demand from live job postings.

The other 68 questions

This page shows 10 and marks what you pick. That's as far as a page can go. A free account opens the other 68 and keeps every answer. What you miss comes back until it's right: after a day, then at longer gaps.

Start with this topic

Free · the whole bank · 100 answers per 30 days, each marked with written feedback

Interview booked? Practise the job ad instead

What moved, monthly

One email a month when the bulletin comes out: what moved in the markets we track, and the new question topics we published. Confirm your address to join. Unsubscribe any time.