Skip to content

AWS Engineer interview questions

100 real questions with model answers and explanations for Cloud Engineer candidates.

See a AWS Engineer resume example

Practice with flashcards

Spaced repetition · Hunter Pass

Questions

networkingavailability

I would give each Availability Zone separate public, private application, and isolated data subnets from a nonoverlapping CIDR.

  • A /16 VPC can reserve one /20 per subnet tier and AZ, leaving address space for growth without renumbering.
  • Internet-facing load balancers use the public subnets, workloads use private subnets, and databases stay in isolated subnets with no default internet route.
  • Each private subnet routes through a NAT gateway in the same AZ so an AZ failure does not create a cross-AZ egress dependency.

Why interviewers ask this: The interviewer is evaluating whether you can turn availability, address capacity, and traffic isolation requirements into a concrete subnet plan.

AWS first selects the most specific matching prefix, then applies route priority rules when prefixes are identical.

  • A route for 10.20.4.0/24 wins over 10.20.0.0/16 regardless of whether its target is a Transit Gateway, peering connection, or network interface.
  • For the same prefix, a static route normally wins over a propagated route, while the local VPC route cannot be removed or overridden by a less specific entry.
  • I validate both forward and return route tables because stateful security groups do not repair asymmetric routing through a stateful appliance.

Why interviewers ask this: A strong answer distinguishes longest-prefix matching from same-prefix priority and accounts for the return path.

gatewaynetworkingendpoints

I use gateway endpoints for private S3 or DynamoDB access and interface endpoints for services exposed through AWS PrivateLink.

  • A gateway endpoint adds prefix-list routes to selected route tables and has no hourly endpoint charge.
  • An interface endpoint creates private IP addresses in chosen subnets, uses security groups, private DNS, and incurs hourly plus data-processing charges.
  • Endpoint policies restrict which resources callers can reach, but IAM and resource policies still decide whether each API call is authorized.

Why interviewers ask this: The interviewer checks whether you understand endpoint mechanics, cost, DNS, and the separation between network reachability and authorization.

private-connectivity

I would place the provider service behind a Network Load Balancer and publish a VPC endpoint service for approved consumers.

  • Consumers create interface endpoints in their own subnets, so neither side needs routable CIDRs, VPC peering, or broad network access.
  • I require explicit endpoint connection acceptance unless an allow list safely automates it, and I restrict the service with IAM principals where supported.
  • Private DNS needs ownership verification and consumer-side private DNS enablement so the service name resolves to endpoint IPs.

Why interviewers ask this: This tests whether you can design a narrowly scoped private service connection rather than treating PrivateLink as generic VPC routing.

gatewaynetworking

I would separate routing domains with multiple Transit Gateway route tables and associate each attachment with the table for its trust zone.

  • Spoke attachments propagate to a shared-services table only where connectivity is required, rather than using one fully meshed route table.
  • A production table can route shared-service prefixes to their attachment while omitting routes to development spokes, creating isolation by absence of a route.
  • I plan symmetric paths through inspection VPC appliances and enable appliance mode when flows must remain on the same zonal firewall path.

Why interviewers ask this: A strong answer shows control of associations, propagations, and inspection paths without drifting into organization-wide governance.

dnslatency

I choose the policy from the traffic decision the application actually needs, not from the number of endpoints.

  • Weighted records split traffic by configured ratios for canaries, while latency records choose the AWS Region with the lowest measured network latency.
  • Failover records combine primary and secondary targets with health evaluation, whereas geolocation records choose by the requester's geographic origin and need a default.
  • DNS TTL controls how quickly clients observe a change, but recursive resolver caching means Route 53 routing is not an instant connection drain.

Why interviewers ask this: The interviewer is looking for accurate policy semantics and awareness that DNS caching limits traffic-control precision.

designdnsnetworking

I would use Route 53 Resolver inbound and outbound endpoints with conditional forwarding rules over Direct Connect or VPN.

  • On-premises DNS forwards private AWS zones to inbound endpoint IPs placed in at least two Availability Zones.
  • VPCs associate outbound rules such as corp.example.com with outbound endpoints that forward queries to on-premises DNS servers.
  • Security groups allow UDP and TCP port 53 as appropriate, while stateless network ACLs must also allow DNS queries to destination port 53 and return traffic to ephemeral client ports in the reverse direction.

Why interviewers ask this: This checks whether you can describe both resolution directions and the network details required for reliable hybrid DNS.

tls

I choose an ALB for HTTP-aware routing and an NLB for layer-four performance, static IP needs, or protocols beyond HTTP.

  • An ALB can route by host, path, header, or query string and integrates with WAF, while an NLB forwards TCP, TLS, UDP, or TCP_UDP flows.
  • Terminating TLS at the load balancer centralizes ACM certificates and policy, but re-encryption to HTTPS targets protects the load balancer-to-workload hop.
  • TLS passthrough on an NLB preserves end-to-end termination at the application but gives up ALB request inspection and managed HTTP routing.

Why interviewers ask this: A strong answer connects load balancer capabilities to protocol, address, inspection, and certificate requirements.

iam

A trust policy defines who may assume the role, while permissions policies define what an assumed role session may do.

  • The trust policy is a resource-based policy on the role and names principals plus conditions such as ExternalId, source account, or OIDC claims.
  • For a same-account IAM user or role named directly as a principal, the trust policy can be sufficient to allow AssumeRole without a separate identity-policy allow, subject to its conditions.
  • Cross-account assumption normally requires an identity-policy allow for sts:AssumeRole on the caller and matching target trust; permissions boundaries, SCPs, session policies, and any explicit deny can still restrict assumption or the resulting session.

Why interviewers ask this: The interviewer checks whether you can reason through both stages of role assumption instead of mixing identity and authorization.

sessions

Role chaining creates a new role session from temporary credentials, and a session policy can only narrow the new session's permissions.

  • A chained role session is limited to a maximum duration of one hour even if the target role allows a longer session.
  • The effective permissions are the intersection of the role policies and inline or managed session policies passed to STS.
  • I pass session tags for attribute-based controls and mark only required tags as transitive when another chained role must receive them.

Why interviewers ask this: A strong answer includes the one-hour chaining limit and treats session policy as a restrictive intersection rather than an extra grant.

iam

I use a permissions boundary as the maximum permission set for delegated role or user creation, not as a policy that grants access.

  • A platform role can let a team create application roles only when each new role carries a prescribed boundary.
  • Effective identity permissions are the intersection of attached identity policies and the boundary, so adding AdministratorAccess cannot exceed the boundary.
  • Resource policies, SCPs, session policies, and explicit denies still participate separately, so I test the complete authorization path with Policy Simulator or CloudTrail.

Why interviewers ask this: The interviewer wants to see that you understand boundaries as delegation guardrails and not as a replacement for normal permissions policies.

iamlinux

An SCP sets the maximum available permissions for principals in member accounts but does not grant any API permission itself.

  • An action must be allowed by the applicable SCP and by IAM, while an explicit deny in either layer wins.
  • A permissions boundary limits a specific principal; an SCP limits affected accounts or organizational units, including newly created roles inside them.
  • SCPs do not restrict the management account and do not directly change resource-based permissions for principals outside the organization.

Why interviewers ask this: A strong answer places SCPs correctly in the authorization intersection and states their important scope limits.

forms

I prefer a target-account role with a narrow trust policy and least-privilege permissions, assumed by a named source principal.

  • The source principal needs sts:AssumeRole permission, and the target trust policy restricts the principal plus conditions such as aws:PrincipalOrgID when appropriate.
  • For a third-party caller I require a unique ExternalId to reduce confused-deputy risk, but it is not a secret or a substitute for principal restriction.
  • Direct resource policies can suit S3 or KMS, yet an assumed role gives consistent temporary credentials and a clear CloudTrail session identity.

Why interviewers ask this: This tests whether you can build cross-account access with precise trust conditions and temporary credentials.

encryption

Envelope encryption protects data with a generated data key and protects that data key with a KMS key.

  • The application calls GenerateDataKey, encrypts the payload locally with the plaintext data key, stores the encrypted data key beside the ciphertext, and discards the plaintext key.
  • Decryption sends the encrypted data key to KMS, then uses the returned plaintext data key locally, avoiding a KMS call for every data block.
  • The KMS key policy must enable the principal or IAM delegation, and encryption context conditions can bind decrypt permission to a specific application or resource.

Why interviewers ask this: The interviewer evaluates whether you understand the data path and the special authorization role of a KMS key policy.

secretsdatabasedesign

I would store the credential in Secrets Manager and use a rotation Lambda that advances the secret through the documented staging labels.

  • The function creates AWSPENDING, updates the database user, verifies the pending credential, then moves AWSCURRENT only after the test succeeds.
  • Alternating-user rotation can reduce the gap where old connections and new credentials overlap, provided the database privileges stay equivalent.
  • Applications fetch the current secret at runtime with bounded caching and retry authentication after cache refresh instead of embedding a value at deployment.

Why interviewers ask this: A strong answer explains the rotation state machine and how applications tolerate credential changes without hardcoded secrets.

scalingdesigncompute

I would define several compatible instance types and combine a stable On-Demand base with diversified Spot capacity.

  • Attribute-based instance selection or explicit overrides keep vCPU, memory, and architecture compatible with the application image.
  • Capacity-optimized Spot allocation reduces interruption risk, while the On-Demand base covers the minimum capacity required for steady traffic.
  • Scaling uses a target metric such as ALB requests per target, and instance refresh rolls new versions while preserving a configured healthy percentage.

Why interviewers ask this: The interviewer checks whether you can balance availability, compatibility, scaling behavior, and Spot savings in one concrete design.

scalingautoscalingdeployment

I would treat each numbered launch template version as an immutable release artifact and pin the Auto Scaling group to an explicit version at every promotion.

  • The pipeline creates a new numbered version with the tested AMI and configuration, records that number with the release, and updates the ASG only after validation; production never references `$Latest` or `$Default`.
  • Each promotion starts an instance refresh with defined minimum healthy capacity, warmup, alarms, and checkpoints after small percentages, so the pipeline evaluates service health during each pause and cancels a bad rollout.
  • If a checkpoint or alarm rejects the release, I roll the refresh back to the last known-good pinned version and verify every instance against that version; automatic rollback can enforce the same path because neither ASG state uses a dynamic version reference.

Why interviewers ask this: The interviewer is evaluating whether you can make AMI promotion deterministic and use instance refresh controls to prevent or remove a mixed-version fleet.

hooksscaling

Lifecycle hooks pause instance launch or termination so automation can finish work before Auto Scaling continues.

  • A launch hook can install configuration, register an external agent, or warm a large cache before completing with CONTINUE.
  • A termination hook can drain work or export local state, while the load balancer deregistration delay separately handles in-flight requests.
  • EventBridge or SNS delivers the event to automation, and a heartbeat extends the timeout only for bounded work rather than hiding a stuck process.

Why interviewers ask this: The interviewer wants a clear distinction between lifecycle orchestration, health checks, and load balancer connection draining.

awscontainerscompute

I choose Fargate when per-task isolation and low host operations matter, and ECS on EC2 when host control or sustained utilization justifies fleet management.

  • Fargate bills requested task vCPU and memory, removes node patching, and supports straightforward capacity providers for serverless tasks.
  • EC2 can be cheaper for dense steady workloads and supports specialized AMIs, GPUs, daemon-style agents, and broader instance choices.
  • Both use ECS services, task definitions, IAM task roles, and load balancing, so I keep deployment artifacts portable where platform features allow it.

Why interviewers ask this: A strong answer compares operational burden, cost shape, and host-level requirements rather than claiming one launch type is universally better.

kubernetes

AWS runs the highly available Kubernetes API server and etcd control plane, while I manage cluster access, workloads, networking, add-ons, and worker capacity.

  • The control plane spans multiple Availability Zones and exposes configurable public and private API endpoints with Kubernetes audit and API logs available to CloudWatch.
  • I still configure EKS access entries and access policies, RBAC, Pod Security controls, network policies, and secrets handling.
  • Core add-ons such as VPC CNI, CoreDNS, and kube-proxy need compatible versions and planned upgrades even when installed as EKS managed add-ons.

Why interviewers ask this: The interviewer checks whether managed Kubernetes changes the responsibility boundary without eliminating cluster operations.

Locked questions

  • 21

    When would you use EKS managed node groups versus Karpenter?

    kuberneteskubernetes-autoscaling
  • 22

    How should an EKS pod receive AWS permissions without node credentials?

    kubernetes
  • 23

    How would you manage container images in ECR for secure, repeatable deployments?

    containersdeploymentregistries
  • 24

    How do RDS Multi-AZ deployments differ from read replicas?

    replicationrdsdeployment
  • 25

    How should an application use Aurora cluster, reader, and custom endpoints?

    endpoints
  • 26

    What application design choices make an RDS or Aurora failover safer?

    rdsdesign
  • 27

    When does RDS Proxy help, and what limitations should you consider?

    rdsproxy
  • 28

    How do you design a DynamoDB partition key for a high-volume access pattern?

    dynamodbpartitioningdesign
  • 29

    What should you evaluate before adding a DynamoDB global secondary index?

    indexesdynamodbdecision-making
  • 30

    How do on-demand, provisioned, and adaptive capacity affect DynamoDB design?

    dynamodbdesigncapacity
  • 31

    When would you use DynamoDB transactions and Streams together?

    transactionsdynamodb
  • 32

    How would you keep ElastiCache data consistent with a relational database?

    databasecaching
  • 33

    How do reserved concurrency and account concurrency interact for Lambda?

    concurrencylambdaserverless
  • 34

    When is Lambda provisioned concurrency worth using?

    concurrencylambdaserverless
  • 35

    How would you set SQS visibility timeout and a dead-letter queue policy?

    resiliencequeuescss
  • 36

    What guarantees does an SQS FIFO queue provide, and how do message groups affect throughput?

    queuesthroughputdata-structures
  • 37

    When would you choose EventBridge over SNS or SQS?

    queuespub-subevents
  • 38

    How do you choose between Standard and Express Step Functions workflows?

  • 39

    How would you combine API Gateway throttling with idempotent write APIs?

    idempotencyapi-gatewaygateway
  • 40

    How would you configure Terraform remote state for an AWS team?

    terraformconfig
  • 41

    What makes a useful Terraform module for AWS infrastructure?

    terraform
  • 42

    How do Terraform lifecycle settings change resource behavior?

    terraform
  • 43

    How do CloudFormation change sets and drift detection complement each other?

    iac
  • 44

    What happens during AWS CDK synthesis, and what should be reviewed?

  • 45

    How would you structure CI checks and deployment controls for AWS infrastructure as code?

    deploymentiac
  • 46

    How would you combine CloudWatch with X-Ray or OpenTelemetry for a distributed AWS application?

    observabilitymonitoringdistributed
  • 47

    How do you turn an SLO into useful CloudWatch alarms?

    slomonitoring
  • 48

    How would you choose backup and disaster recovery tiers for an AWS workload?

    backups
  • 49

    How would you combine Savings Plans with rightsizing for a variable compute estate?

    finops
  • 50

    How would you use the AWS Well-Architected Framework to evaluate a proposed service design?

    decision-makingdesign
  • 51

    Two acquired VPCs both use 10.20.0.0/16, but twelve services must communicate privately within six weeks. How would you connect them?

    communication
  • 52

    After attaching a new inspection VPC to Transit Gateway, TCP handshakes fail intermittently and flow logs show replies leaving through a different firewall appliance. What do you inspect?

    gatewaynetworking
  • 53

    Instances reach S3 through a gateway endpoint, but PutObject returns 403 only for arn:aws:s3:::reports-prod while other buckets work. How do you debug it?

    gatewayobject-storageendpoints
  • 54

    A PrivateLink consumer resolves api.internal.example.com to public IPs in one VPC, while another VPC resolves the interface endpoint addresses. Both must use private DNS. What would you change?

    dnsnetworkingprivate-connectivity
  • 55

    A Route 53 failover record has a 60-second TTL, yet clients still hit an unhealthy primary for nine minutes after its ALB fails. How would you investigate?

    dns
  • 56

    An ALB starts returning 502 for 8% of requests after a deployment; target 5xx stays near zero and target response time drops sharply. What do you check first?

    deployment
  • 57

    A TLS listener on an NLB works for modern clients, but 15% of legacy devices fail negotiation after a certificate rotation. How would you diagnose it?

    tls
  • 58

    Three private subnets share one NAT gateway; ErrorPortAllocation rises above zero at 6,000 concurrent outbound connections and NAT charges reached $4,800 last month. What would you do?

    gatewaynetworkingconcurrency
  • 59

    An EC2 API has 18% CPU, but p99 latency doubled and NetworkPacketsIn reaches the instance-family limit during traffic peaks. How would you respond?

    computeapilatency
  • 60

    A mixed-instances Auto Scaling group should provide 40 vCPU units, but DesiredCapacity is 40 and the group launches 40 instances with 16 vCPUs each, causing a cost spike. How would you diagnose and correct it safely?

    scalingautoscaling
  • 61

    Spot nodes save 65%, but a two-minute interruption notice causes 4% of batch jobs to restart from the beginning. How would you reduce lost work?

    batch
  • 62

    Scale-in terminates EC2 workers while they still process requests that last up to seven minutes, causing 1.5% failures. How would you use a lifecycle hook?

    hooksconcurrencyaws
  • 63

    An ECS service requests ten tasks, but six remain PENDING for 20 minutes and events say no container instance met all requirements. What do you inspect?

    containers
  • 64

    ECS tasks exit with code 137 twice per hour; memory utilization reaches 100% while CPU stays below 25%. What is your approach?

    memory
  • 65

    A Fargate service runs at 22% CPU and 78% memory, costs $3,200 monthly, and must keep p95 under 250 ms. How would you rightsize it?

    memorycontainers
  • 66

    After Karpenter consolidates three nodes, five EKS pods stay Pending for 12 minutes with topology-spread and insufficient-memory events. What would you change?

    kuberneteskubernetes-autoscalingspread
  • 67

    After an EKS release, 30 pods show ImagePullBackOff and the few that start enter CrashLoopBackOff within 40 seconds. How do you separate the causes?

    kubernetes
  • 68

    An RDS PostgreSQL instance reaches 500 connections, CPU is only 35%, and new API requests fail with too many connections during peaks. What would you do?

    postgresrdsapi
  • 69

    A Multi-AZ RDS failover completes in 95 seconds, but the application remains degraded for eight minutes and a read replica lags by 14 GB. How do you investigate?

    replicationrds
  • 70

    RDS free storage fell from 180 GB to 25 GB in two days while transaction volume stayed flat. What do you inspect before enabling more storage?

    transactionsrds
  • 71

    One RDS query moved from 80 ms to 4.6 seconds after the table reached 90 million rows, while CPU rose to 70%. How would you tune it?

    queriesrds
  • 72

    An Aurora custom endpoint accidentally includes the writer, and 30 reporting jobs saturate that instance every morning. How would you correct and verify the reporting path?

    endpoints
  • 73

    A DynamoDB table averages 20% provisioned capacity, yet one tenant receives throttling on 12% of writes during a 3,000-request burst. What is happening?

    dynamodbcapacity
  • 74

    Adding a DynamoDB GSI to a 1.2 TB table causes online index throttling and raises base-table write latency. How would you complete the backfill safely?

    indexesdynamodblatency
  • 75

    ElastiCache evictions jump to 40,000 per minute and database QPS triples whenever a popular key expires. How would you stop the cycle?

    databasecaching
  • 76

    A Lambda function reaches its 1,000 regional concurrency quota, throttles 7% of invocations, and drives RDS to 450 connections. How would you stabilize it?

    concurrencylambdathrottle
  • 77

    A Lambda times out at 30 seconds on 2% of requests, while traces show an external API sometimes takes 27 seconds. What would you change?

    serverlessapilambda
  • 78

    A Java Lambda has 1.8-second p95 cold starts, a 300 ms latency target, and only 20 requests per minute overnight. How would you improve it?

    serverlesslatencylambda
  • 79

    A Lambda SQS event source reads batches of 10 messages, but when 1 poison item fails, the other 9 successful items are delivered and processed again. How would you stop the repeated work?

    batchserverlessqueues
  • 80

    One poison message has blocked an SQS FIFO message group for 18 minutes, and producers retry with the same deduplication ID for ten minutes. How would you recover?

    resiliencequeuesqueries
  • 81

    EventBridge delivers 0.4% duplicate order events and events for one order occasionally arrive out of sequence by two seconds. How would you make the consumer correct?

    events
  • 82

    A Step Functions task calls a payment API that returns 429 for 20 seconds, and the current retry policy creates duplicate charges. How would you fix the workflow?

    resilienceapi
  • 83

    API Gateway returns 429 during a 900 RPS launch even though the account quota is 10,000 RPS, and 1 client sends 70% of traffic. What would you inspect?

    api-gatewaygateway
  • 84

    A deployment role in account B can be assumed from account A in staging, but production returns AccessDenied after an organization move. How do you debug AssumeRole?

    deployment
  • 85

    IAM Policy Simulator says s3:GetObject is allowed, but production still returns AccessDenied and CloudTrail mentions an explicit deny. Where do you look?

    iamawsobject-storage
  • 86

    An application role can read an encrypted S3 object but receives KMS AccessDenied on decrypt after the key was replaced 24 hours ago. What do you verify?

    encryptionawsobject-storage
  • 87

    Secrets Manager rotation reports success, but 12% of database logins fail for five minutes after each rotation. How would you fix it?

    secretsdatabase
  • 88

    Access Analyzer reports an S3 bucket policy that allows GetObject to Principal * when a request carries a guessed referrer header. The bucket contains 80,000 customer exports. What do you do?

    object-storageaws
  • 89

    GuardDuty reports an EC2 instance contacting a known command-and-control address every 60 seconds, but the instance serves 20% of production traffic. What is your response?

    computeaws
  • 90

    An operator tried to rename a production security group in the console, but security groups cannot be renamed, so a different SG ID with the same Name tag was created while 10 services still reference the old ID. How would you reconcile Terraform?

    terraformnetworking
  • 91

    A Terraform pipeline has held the remote state lock for 47 minutes after its runner crashed, and a hotfix must ship in 20 minutes. What do you do?

    terraformci-cd
  • 92

    A shared Terraform module update changes 24 services, but only two teams can test this week and one resource replacement appears in the plan. How would you roll it out?

    terraform
  • 93

    A CloudFormation update rolls back after creating 18 of 25 resources, but rollback reaches UPDATE_ROLLBACK_FAILED because a non-empty S3 bucket is DELETE_FAILED. How do you recover?

    rollbackiacaws
  • 94

    A CDK diff for a routine release shows an IAM wildcard and replacement of a production DynamoDB table with 600 GB of data. What do you do before deployment?

    dynamodbdeploymentiam
  • 95

    A CI job using OIDC can deploy from pull requests, but production must deploy only from the protected main environment and issued credentials must expire in less than 60 minutes. How would you constrain it?

    code-reviewdeployment
  • 96

    An API had 14% errors for 11 minutes, but its CloudWatch alarm stayed OK and X-Ray shows traces for only one of six services. How would you repair observability?

    observabilitymonitoringapi
  • 97

    AWS Cost Anomaly Detection reports a $1,900 daily increase in data transfer from one account, starting at 02:00 after a release. How would you investigate and contain it?

  • 98

    A quarterly restore drill must recover a 2 TB RDS database within a four-hour RTO and lose no more than 15 minutes of data. How would you run it?

    databaserds
  • 99

    A 600 GB on-premises application must move to AWS with at most 20 minutes of downtime, but its file store and database cannot be migrated in one weekend. How would you phase it?

    database
  • 100

    A junior proposes fixing recurring S3 AccessDenied errors by attaching AdministratorAccess to the ECS task role for 48 hours. The release is in two hours. How do you respond?

    object-storageaws