Scenario-Based AWS Interview Questions (2027)

46 scenario-based AWS interview questions with answers: VPC connectivity, S3 AccessDenied, IAM evaluation, Lambda timeouts, RDS failover, cost and DR.

Sep 5, 2025 - 15:42
Nov 7, 2026 - 00:05
 0  700
TOPICInterview Q & APractical guide
Scenario-Based AWS Interview Questions (2027)

Scenario-based AWS interview questions describe a real problem, such as an unreachable EC2 instance, an S3 AccessDenied error, a Lambda timeout or a surprise bill, and ask how you would find the cause and fix it. Interviewers score your order of checks, the AWS tools you name and how you prevent a repeat. This page has 46 scenarios with answers, grouped by experience level.

The answers were checked against the AWS documentation in November 2026. If you need background on the services first, start with our list of AWS services DevOps engineers use daily. For CI/CD questions on CodePipeline, CodeBuild and CodeDeploy, use the companion AWS DevOps interview questions guide; this page focuses on networking, IAM, storage, compute, databases, cost and recovery.

Key takeaways

  • Answer every scenario in four parts: symptom, how you confirm the cause, the fix, and how you stop it happening again.
  • Most connectivity scenarios come down to five checks: route table, security group, network ACL, public IP or NAT path, and DNS.
  • For AccessDenied, remember the evaluation order: an explicit deny anywhere wins, and an action needs an allow from every policy type that applies (SCPs, RCPs, permissions boundaries, session policies, and identity or resource policies).
  • Know the numbers interviewers like to test: Lambda times out at 3 seconds by default and 900 seconds at most, the REST API integration timeout defaults to 29 seconds, and RDS Multi-AZ instance failover typically takes 60 to 120 seconds.
  • Senior rounds move from fixing one resource to designing guardrails: AWS Organizations, SCPs, permissions boundaries, centralized logging and a tested disaster recovery plan.
  • AWS has charged for every public IPv4 address since 1 February 2024, which now shows up in many "why is my bill high" scenarios.

How to answer a scenario question

Interviewers rarely want one magic answer. They want to hear a calm, ordered process. A good structure takes under two minutes to say:

StepWhat you sayExample tools
1. ScopeWho is affected, since when, what changedCloudWatch dashboards, AWS Health Dashboard, deployment history
2. Confirm the causeWhich log, metric or command proves itCloudWatch Logs, VPC Flow Logs, CloudTrail, Reachability Analyzer
3. FixThe smallest safe change, or a rollbackConsole, AWS CLI, re-deploy from infrastructure as code
4. PreventAlarm, guardrail, automation or runbookCloudWatch alarms, AWS Config rules, SCPs, CloudFormation or Terraform

Use this table to pick where to start:

Your experienceQuestionsFocus
Fresher or career switcher1 to 12EC2 access, VPC basics, S3, IAM roles, first-bill surprises
2 to 5 years13 to 30Peering, Lambda and SQS behaviour, Auto Scaling, RDS failover, policy evaluation, containers
Senior, lead or architect31 to 40Multi-account design, guardrails, disaster recovery, cost governance, audit
Everyone with on-call experience41 to 46Live incidents under time pressure

Scenario-based AWS interview questions for freshers

1. You launched an EC2 instance in a public subnet but cannot SSH into it. What do you check?

Check the network path from your laptop to port 22 in order. The subnet's route table needs a 0.0.0.0/0 route to an internet gateway. The instance needs a public IPv4 address or an Elastic IP. The security group must allow inbound TCP 22 from your IP. The network ACL must allow inbound 22 and outbound ephemeral ports (1024 to 65535), because NACLs are stateless.

  • Confirm the key pair and the default user name for the AMI (for example ec2-user on Amazon Linux, ubuntu on Ubuntu).
  • Check the instance status checks; a failed system check is an AWS host problem, a failed instance check is usually the OS.
  • To avoid opening port 22 at all, use Systems Manager Session Manager, which needs the SSM Agent and an instance role with the AmazonSSMManagedInstanceCore policy.

2. An instance in a private subnet cannot download OS updates. How do you fix it?

A private subnet has no route to the internet by design. Add a NAT gateway in a public subnet, give it an Elastic IP, and add a 0.0.0.0/0 route to the NAT gateway in the private subnet's route table. If the instance only needs AWS services such as S3 or DynamoDB, a gateway VPC endpoint is a better choice: it keeps traffic off the internet and AWS does not charge for gateway endpoints.

3. A static website hosted on S3 returns 403 Forbidden. Why?

The most common cause is S3 Block Public Access. Since April 2023 all four Block Public Access settings are on by default for new buckets, so a bucket policy that grants public read is blocked. Other causes are a missing bucket policy, objects encrypted with a KMS key the caller cannot use, or a missing index.html.

The better fix for production is to keep the bucket private and serve it through CloudFront with origin access control (OAC), with a bucket policy that allows only that distribution. You get HTTPS, caching and no public bucket.

4. A teammate deleted an important file from S3. Can you recover it?

Only if versioning was enabled on the bucket. With versioning, a simple delete adds a delete marker; removing the marker brings the object back.

aws s3api list-object-versions --bucket my-bucket --prefix reports/q3.csv
aws s3api delete-object --bucket my-bucket --key reports/q3.csv --version-id <delete-marker-version-id>

Without versioning, the object is gone unless you have a replica or an AWS Backup copy. For prevention, enable versioning, consider S3 Object Lock for records that must not change, and restrict s3:DeleteObject in IAM.

5. A developer pushed AWS access keys to a public GitHub repository. What do you do first?

Deactivate the key immediately, then delete it and issue a new one only if a long-term key is truly needed. Next, check CloudTrail for API calls made with that access key ID, looking for new IAM users, new keys, unknown regions and large EC2 launches. Remove the key from the Git history as well, because deleting the file in a new commit leaves it in older commits.

For prevention, replace long-term keys with IAM roles: instance profiles on EC2, task roles on ECS, OIDC federation for CI systems such as GitHub Actions, and IAM Identity Center for people. Add secret scanning to the repository.

6. An application on EC2 needs to read from S3. How should it get credentials?

Attach an IAM role to the instance through an instance profile. The AWS SDKs and CLI fetch temporary credentials from the instance metadata service automatically and refresh them before they expire. Grant only the actions and bucket ARNs the application needs, and require IMDSv2 on the instance.

7. Your application runs on one EC2 instance and goes down whenever that instance fails. How do you make it highly available?

Put the application behind an Application Load Balancer and run it in an Auto Scaling group that spans at least two Availability Zones. The Auto Scaling group replaces unhealthy instances, and the load balancer only sends traffic to healthy targets. Move state off the instance: sessions to ElastiCache or DynamoDB, files to S3 or EFS, and the database to RDS with Multi-AZ. Build the instance from a launch template so replacements are identical.

8. Your first AWS bill is much higher than expected. How do you find out why?

Open Cost Explorer, group by service, then by usage type, to see which line grew. Common surprises on learning accounts:

  • NAT gateways, which charge per hour and per GB processed even when idle.
  • Public IPv4 addresses, charged hourly since 1 February 2024, whether attached or not.
  • Unattached EBS volumes and old snapshots left after instances were terminated.
  • Resources running in a region you forgot about.
  • Data transfer out to the internet.

Then create an AWS Budget with email alerts so the next surprise reaches you in days, not at month end.

9. You need to block one malicious IP address from reaching your web servers. Do you use a security group or a network ACL?

A network ACL, or AWS WAF if traffic comes through an ALB or CloudFront. Security groups only have allow rules, so you cannot write a deny for one address. Network ACLs support numbered allow and deny rules evaluated in order, so a low-numbered deny for that IP works at the subnet level. WAF is the better tool for HTTP traffic because it can also rate-limit and match patterns.

10. Users in other countries say images on your site load slowly. What do you suggest?

Serve static content through Amazon CloudFront. Edge locations cache objects close to users, so repeat requests do not travel back to your origin region. Set sensible Cache-Control headers, compress responses, and keep the S3 origin private behind origin access control.

11. A contractor needs access to one S3 bucket for two weeks. How do you grant it?

Give them a role, not a shared IAM user. In an organization that uses IAM Identity Center, create a permission set scoped to that bucket and assign it for the period, then remove the assignment. If they only need to download or upload a few files, a presigned URL with a short expiry avoids giving any AWS identity at all.

12. The root volume on an EC2 instance is full. How do you add space without losing data?

Increase the EBS volume size online, then grow the partition and file system inside the OS. Take a snapshot first.

aws ec2 modify-volume --volume-id vol-0abc1234 --size 50
# on the instance, after the modification reaches the optimizing state
sudo growpart /dev/nvme0n1 1
sudo xfs_growfs -d /          # XFS (Amazon Linux default)
sudo resize2fs /dev/nvme0n1p1 # ext4

Then find what filled the disk, often logs without rotation, and add a CloudWatch alarm on disk usage through the CloudWatch agent.

Scenario-based AWS interview questions for 2 to 5 years of experience

13. Two VPCs are peered, but instances cannot reach each other. What is missing?

Peering only creates the connection; it does not add routes. Check each item:

  • Both VPCs' route tables need a route to the other VPC's CIDR with the peering connection as the target.
  • Security groups must allow traffic from the peer CIDR (or the peer security group ID within the same region).
  • CIDR blocks must not overlap; overlapping VPCs cannot be peered.
  • Peering is not transitive. If A peers with B and B peers with C, A cannot reach C through B.
  • If you use private DNS names, enable DNS resolution for the peering connection.

VPC Reachability Analyzer can test the path between two ENIs and tell you which component blocks it.

14. You now have twelve VPCs and an on-premises data centre that all need to talk. Peering or Transit Gateway?

Transit Gateway. Full-mesh peering grows with the square of the number of VPCs and still does not give transitive routing or a single attachment point for VPN and Direct Connect. A Transit Gateway acts as a regional hub: each VPC and the on-premises connection attach once, and route tables on the gateway control which networks can reach which. Peering still makes sense for a few VPCs with heavy traffic, because it has no per-GB processing charge. Our post on VPC peering vs Transit Gateway compares them in more depth.

15. A Lambda function times out intermittently. How do you troubleshoot it?

Start with the numbers. The default timeout is 3 seconds and the maximum is 900 seconds (15 minutes). Compare the configured timeout with the function's Duration metric: if p99 duration sits close to the limit, normal variation will cause timeouts.

  • Read the CloudWatch logs for the Task timed out lines and see which call was in progress. AWS X-Ray traces show which downstream call is slow.
  • A function attached to a VPC needs a NAT gateway or VPC endpoints to reach AWS APIs or the internet; without them, calls hang until the timeout.
  • Set explicit timeouts on SDK and HTTP clients shorter than the function timeout, so you get a clear error instead of a silent timeout.
  • More memory also means more CPU, which often shortens CPU-bound runs.
  • Create database and SDK clients outside the handler so warm invocations reuse connections.

More detail on limits is in Lambda timeout and payload limits.

16. API Gateway returns 504 to clients, but the Lambda function behind it finishes successfully in 40 seconds. Why?

The REST API integration timeout defaults to a range of 50 milliseconds to 29 seconds. API Gateway gives up at 29 seconds and returns 504, while Lambda keeps running to completion. For Regional and private REST APIs you can request a higher integration timeout through Service Quotas, which may require a lower account throttle quota; edge-optimized APIs stay at 29 seconds.

The cleaner design for long work is asynchronous: accept the request, put a job on SQS or start a Step Functions execution, return 202 with a job ID, and let the client poll or receive a callback.

17. An SQS-triggered Lambda processes some messages more than once. What is going on?

The likely cause is a visibility timeout that is too short. If the function is still working when the timeout expires, the message becomes visible and another invocation picks it up. AWS recommends a queue visibility timeout of at least six times the function timeout, plus MaximumBatchingWindowInSeconds if you use a batch window.

  • By default, one failed message makes the whole batch return to the queue. Turn on partial batch responses (ReportBatchItemFailures) so only failed messages are retried.
  • Configure a dead-letter queue with maxReceiveCount of at least 5, as AWS suggests, so poison messages stop looping.
  • Standard queues deliver at least once, so the handler must be idempotent anyway, for example by recording processed message IDs in DynamoDB with a conditional write.

18. New instances in an Auto Scaling group are terminated as unhealthy a few seconds after launch. What do you check?

The health check grace period. When you create a group in the console it defaults to 300 seconds, but through the AWS CLI or an SDK it defaults to 0, which turns the grace period off. If the group uses ELB health checks and the application takes two minutes to start, Auto Scaling marks the instance unhealthy and replaces it in a loop.

Also confirm the target group health check path returns 200, that the instance security group allows the health check port from the load balancer's security group, and that user data is not failing. Lifecycle hooks are an alternative: they hold an instance in a wait state until your bootstrap signals that it is ready.

19. During a traffic spike, the Auto Scaling group adds capacity too slowly. How do you improve it?

  • Use target tracking on a metric that rises early, such as ALBRequestCountPerTarget, rather than CPU if the application is I/O bound.
  • Set the default instance warmup so new instances are not counted before they can serve traffic.
  • Reduce boot time: bake software into the AMI instead of installing it in user data.
  • Use warm pools to keep pre-initialized, stopped instances ready.
  • For daily or weekly patterns, add scheduled scaling or predictive scaling ahead of the known peak.
  • Check that the account's EC2 quotas allow the maximum size you set.

See how Auto Scaling works and what triggers it for the policy types.

20. After an RDS Multi-AZ failover, the database was back in about two minutes, but the Java application stayed down much longer. Why?

RDS fails over by changing the DNS record of the DB endpoint to point at the standby. AWS says failover typically takes 60 to 120 seconds. If the application's JVM caches DNS for a long time, it keeps connecting to the old IP. AWS recommends a JVM DNS TTL of no more than 60 seconds:

networkaddress.cache.ttl=60

Also make the connection pool validate connections and retry, and consider RDS Proxy, which holds client connections open during a failover. Test the behaviour before production needs it:

aws rds reboot-db-instance --db-instance-identifier prod-db --force-failover

21. Reporting queries are slowing down the primary database. Can you point them at the Multi-AZ standby?

No. In a Multi-AZ DB instance deployment the standby cannot serve read traffic; it exists only for failover. Create one or more read replicas and send reporting traffic to the replica endpoint, accepting that replicas lag slightly behind. A Multi-AZ DB cluster deployment, which has two readable standbys, is the other option on supported engines. Our explainer on Single-AZ vs Multi-AZ RDS covers the trade-offs.

22. An application on EC2 gets AccessDenied from S3, although its role policy allows s3:GetObject. Where do you look?

Read the error message first. S3 now includes the policy type in many AccessDenied messages, for example "with an explicit deny in a service control policy" or "because no VPC endpoint policy allows the s3:GetObject action". Then check:

  • The resource ARN. s3:GetObject needs arn:aws:s3:::bucket/*, while s3:ListBucket needs arn:aws:s3:::bucket.
  • The bucket policy for an explicit deny, for example one that requires a specific VPC endpoint or TLS.
  • KMS: an object encrypted with SSE-KMS also needs kms:Decrypt in the role policy and the key policy.
  • The VPC endpoint policy if traffic goes through a gateway endpoint.
  • SCPs, RCPs and any permissions boundary on the role.

The IAM policy simulator and CloudTrail events help confirm which statement applies.

23. A role in account B cannot read objects in a bucket in account A. What must be in place?

For cross-account access, both sides must allow the request: the identity policy on the role in account B and the bucket policy in account A. Neither alone is enough. If the objects use a customer managed KMS key, the key policy in account A must also allow the role. Object ownership matters too: with the bucket owner enforced setting (ACLs disabled), the bucket owner owns every object, which avoids the old problem of objects uploaded by another account being unreadable by the owner.

{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "AllowAccountBReader",
    "Effect": "Allow",
    "Principal": {"AWS": "arn:aws:iam::222233334444:role/report-reader"},
    "Action": ["s3:GetObject"],
    "Resource": "arn:aws:s3:::account-a-reports/*"
  }]
}

24. A user has AdministratorAccess but still gets AccessDenied. Explain how AWS evaluates the request.

An identity policy is only one input. AWS gathers every policy that applies to the request and works through these rules:

Policy typeEffect on the result
Any explicit DenyWins over every allow, in any policy type
SCPs and RCPs (AWS Organizations)Set the maximum available; the action must be allowed by them as well
Permissions boundaryEffective permissions are the intersection of the boundary and the identity policy
Session policyFurther limits an assumed-role or federated session
Identity-based and resource-based policies (same account)The union: an allow in either is enough, if nothing above blocks it
No applicable allowImplicit deny

So an administrator in a member account can be blocked by an SCP, a permissions boundary, or a deny in a bucket or key policy.

25. A CloudFormation stack is stuck in UPDATE_ROLLBACK_FAILED. How do you recover it?

Find the resource that failed to roll back in the stack events, fix the underlying cause, then continue the rollback. Common causes are resources changed or deleted outside CloudFormation, missing permissions, expired credentials, quota limits and Auto Scaling instances that never sent their signals.

aws cloudformation continue-update-rollback --stack-name payments-prod
# last resort: skip resources that cannot be rolled back
aws cloudformation continue-update-rollback --stack-name payments-prod --resources-to-skip LegacyQueue

Skipped resources no longer match the template, so fix them before the next update. To prevent repeats, stop manual changes to stack resources and run drift detection regularly.

26. Users see 502, 503 or 504 errors from an Application Load Balancer. How do you tell them apart?

CodeTypical causes from the ALB documentation
502 Bad GatewayTarget refused or reset the connection, returned a malformed response, closed a keep-alive connection that the ALB still used, or a Lambda target errored or timed out
503 Service UnavailableThe target group has no registered targets
504 Gateway TimeoutThe ALB could not connect within 10 seconds, the target did not respond before the idle timeout, or a network ACL blocked return traffic on ephemeral ports

Compare HTTPCode_ELB_5XX_Count (generated by the load balancer) with HTTPCode_Target_5XX_Count (passed through from your application), and turn on ALB access logs to see the error reason per request. For 502s, a common fix is to make the application's keep-alive timeout longer than the ALB idle timeout.

27. NAT gateway charges are one of the largest lines on the bill. How do you reduce them?

Find what is sending the traffic first. Enable VPC Flow Logs on the NAT gateway's network interface and group by destination. Typical findings and fixes:

  • S3 and DynamoDB traffic: add gateway endpoints, which have no additional charge.
  • Container image pulls from ECR and calls to other AWS APIs: add interface endpoints if the volume justifies their hourly cost.
  • Cross-AZ traffic to a NAT gateway in another zone: deploy one NAT gateway per AZ and route each subnet to its local one.
  • Large external downloads in build jobs: cache dependencies in a repository such as CodeArtifact.

28. ECS tasks in private subnets fail to start with an image pull error. What is wrong?

The tasks have no path to Amazon ECR. A task in a private subnet needs either a NAT gateway or VPC endpoints for ECR: the ecr.api and ecr.dkr interface endpoints plus the S3 gateway endpoint, because image layers are stored in S3. Add the CloudWatch Logs endpoint if the task uses the awslogs driver. Also confirm the task execution role has permission to pull from ECR. The stopped task's "stopped reason" field in the ECS console usually names the exact failure.

29. Pods on an EKS cluster stay in Pending. How do you investigate?

Run kubectl describe pod and read the events. Common causes:

  • Insufficient cpu or Insufficient memory: no node has room. Check that Cluster Autoscaler or Karpenter is running and allowed to add nodes.
  • No free IP addresses: the Amazon VPC CNI gives each pod an IP from the subnet, so small subnets run out. Use larger subnets, prefix delegation or additional CIDR ranges.
  • Taints, node selectors or affinity rules that no node satisfies.
  • A PersistentVolumeClaim waiting for an EBS volume in a different AZ from the available nodes.

30. The team stores the database password in an environment variable in the task definition. How would you improve it?

Move it to AWS Secrets Manager and turn on automatic rotation, which has built-in support for RDS databases. ECS can inject the secret into the container at start-up, and on EKS the Secrets Store CSI Driver does the same job, so the value never appears in the task definition, manifest or Git. Grant secretsmanager:GetSecretValue only to the role that needs it. For non-secret configuration, Systems Manager Parameter Store is cheaper and simpler.

Scenario-based AWS interview questions for senior engineers

31. The company runs everything in one AWS account. How would you design a multi-account setup?

Use AWS Organizations with organizational units that reflect how you govern workloads, not the org chart. A common layout:

  • A management account used only for billing and organization settings, with no workloads.
  • A Security OU with a log archive account (organization CloudTrail, Config and VPC Flow Logs) and a security tooling account (GuardDuty, Security Hub and IAM Access Analyzer administration).
  • A Workloads OU split into production and non-production accounts, often one account per application per environment.
  • A Sandbox OU with strict budgets for experiments.

AWS Control Tower can set up this landing zone with guardrails. People sign in through IAM Identity Center with permission sets, and pipelines deploy across accounts by assuming roles.

32. How do you stop anyone, including account administrators, from disabling CloudTrail or using unapproved regions?

Use service control policies at the OU level. SCPs do not grant permissions; they set the maximum that any principal in the account can use, including the account's root user. Exempt a break-glass or platform role with a condition.

{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "ProtectCloudTrail",
    "Effect": "Deny",
    "Action": ["cloudtrail:StopLogging", "cloudtrail:DeleteTrail", "cloudtrail:UpdateTrail"],
    "Resource": "*",
    "Condition": {
      "ArnNotLike": {"aws:PrincipalARN": "arn:aws:iam::*:role/PlatformAdmin"}
    }
  }]
}

A region restriction uses the aws:RequestedRegion condition key, with global services such as IAM excluded from the deny. Test SCPs on a sandbox OU first, because a mistake can lock out every account below it.

33. Developers want to create IAM roles for their Lambda functions without asking the platform team. How do you allow that safely?

Use permissions boundaries. Allow developers to create roles only if they attach a specific boundary policy, using the iam:PermissionsBoundary condition key, and deny them the ability to change or remove that boundary. A role's effective permissions are the intersection of its identity policy and its boundary, so a developer cannot create a role more powerful than the boundary, even with a broad policy attached.

34. The business asks for disaster recovery with an RTO of one hour and an RPO of fifteen minutes. Which strategy do you choose?

AWS describes four strategies, from cheapest and slowest to most expensive and fastest:

StrategyWhat runs in the recovery regionTypical fit
Backup and restoreBackups only; infrastructure is redeployed from codeRecovery in hours, data loss up to the last backup
Pilot lightData replicated and live; application servers switched offTens of minutes to recover
Warm standbyA scaled-down but working copy that can take traffic at onceMinutes to recover
Multi-site active/activeFull capacity serving traffic in more than one regionNear-zero recovery time, highest cost

For a one-hour RTO and fifteen-minute RPO, pilot light or warm standby fits: continuous replication (RDS cross-region read replicas, Aurora global database, S3 replication or DynamoDB global tables) meets the RPO, and infrastructure as code plus Auto Scaling meets the RTO. Point-in-time backups are still needed, because replication copies corruption too. The plan only counts if it has been tested.

35. Plan the failover of a web application with an Aurora database to a second region.

  • Data: an Aurora global database. AWS says it replicates with typical latency under a second and can promote a secondary region to read/write in under a minute.
  • Compute: the same CloudFormation or Terraform code deployed in both regions, scaled down in the secondary. Check service quotas there before you need them.
  • Traffic: Route 53 failover routing with health checks, or Amazon Application Recovery Controller routing controls for a manual, data-plane switch.
  • Dependencies: secrets, KMS keys, container images and AMIs copied to the second region.
  • Runbook: decide who declares the disaster, because automatic failover on a false alarm also costs data and availability.

AWS advises relying on data-plane operations during failover, since control-plane APIs have lower availability goals.

36. How do you protect backups against ransomware or a compromised administrator?

Keep at least one copy in a separate account that production credentials cannot reach. AWS Backup can copy recovery points across accounts and regions, and AWS Backup Vault Lock can stop anyone from deleting recovery points before their retention ends. For S3 data, enable versioning and S3 Object Lock in compliance mode for records that must stay unchanged. Restore from these backups on a schedule so you know they work.

37. A security audit requires every data store to use customer managed KMS keys. How do you enforce that across forty accounts?

Combine preventive and detective controls. Preventive: SCPs that deny creating unencrypted resources where condition keys allow it, and infrastructure as code modules that set encryption by default. Detective: AWS Config managed rules for encryption, deployed to every account through a conformance pack or Control Tower, with findings sent to Security Hub. Key policies should separate key administrators from key users, and key usage shows up in CloudTrail for audits.

38. Finance reports that the AWS bill jumped sharply this month across the organization. How do you investigate and stop it recurring?

  1. In Cost Explorer at the management account, group by linked account, then service, then usage type, and compare with last month.
  2. Check AWS Cost Anomaly Detection for alerts that identify the service and account behind a spike.
  3. Look at CloudTrail in the affected account for who created the resources, and when.
  4. Fix the immediate cause: a forgotten load test, a logging loop, oversized instances or a missing S3 lifecycle rule.

To prevent repeats, enforce cost allocation tags, set budgets per account with alerts, review Savings Plans coverage for steady workloads, and send cost data to a dashboard every team sees.

39. How do you deploy a new version to an EC2 fleet with no downtime and a fast rollback?

Two common patterns: a CodeDeploy blue/green deployment that shifts load balancer traffic to a new set of instances, or an Auto Scaling instance refresh with a new launch template version and a minimum healthy percentage. Both should watch CloudWatch alarms and roll back automatically if error rates rise. The pipeline side of this question, including AppSpec hooks and deployment configurations, is covered in the AWS DevOps interview questions guide.

40. Someone opened port 22 to 0.0.0.0/0 on a production security group. How do you find out who did it and stop it happening again?

Search CloudTrail for AuthorizeSecurityGroupIngress events on that group; the event shows the principal, time and source IP. Event history covers the last 90 days, and an organization trail delivered to S3 keeps records longer. AWS Config's resource timeline shows how the group changed over time.

For prevention, add an AWS Config rule that flags unrestricted SSH and triggers automatic remediation, or an EventBridge rule that reverts the change and alerts the team. Better still, remove the need for SSH by using Session Manager.

Incident scenarios: live troubleshooting questions

41. The production site is down at 2 a.m. and you are on call. Where do you start?

Confirm the impact and check what changed. Look at the AWS Health Dashboard for a service event in your region, then your deployment history, then the load balancer and application dashboards. If a deployment went out in the last hour, roll it back before you dig into the root cause. Post short updates in the incident channel, and write the timeline down as you go; it becomes the post-incident review.

42. Error rates rose right after a deployment. What do you do?

Roll back first and investigate after. A rollback is a known-good state, and every minute spent debugging in production extends the outage. Once stable, compare the two versions: configuration, environment variables, dependency versions and database migrations. Then add the missing safety net, such as automated rollback on a CloudWatch alarm, a canary stage or a smoke test in the pipeline.

43. DynamoDB requests fail with ProvisionedThroughputExceededException. How do you respond?

Check whether the whole table is short on capacity or one partition key is hot. CloudWatch shows consumed against provisioned capacity, and CloudWatch Contributor Insights for DynamoDB shows the most accessed keys. For a general shortfall, raise capacity, enable auto scaling or switch the table to on-demand mode. For a hot key, change the key design so writes spread across more partition key values. Make sure clients retry with exponential backoff, which the AWS SDKs do by default.

44. GuardDuty reports that an EC2 instance is communicating with a known cryptocurrency mining pool. What are your steps?

  1. Contain: replace the instance's security groups with one that blocks all traffic except your forensics access, and detach it from the load balancer. Do not terminate it yet, because you would lose evidence.
  2. Preserve: snapshot the EBS volumes and capture memory if your process supports it.
  3. Investigate: check CloudTrail for actions taken with the instance role's credentials, and revoke active sessions for that role.
  4. Recover: rebuild from a clean, patched AMI, rotate any secrets the instance could read, and close the entry point, such as an exposed port or a vulnerable package.

45. You changed a Route 53 record, but some users still reach the old server an hour later. Why?

Resolvers and clients cache records for the TTL that was set before the change. If the old TTL was a day, some users will keep the old answer for up to a day. Before a planned migration, lower the TTL well in advance (at least one old-TTL period before the change), switch the record, then raise the TTL again. Alias records to AWS resources use the target's TTL, so check which kind you have.

46. A security scan shows an S3 bucket with customer data was made public. What do you do in the first hour?

  1. Turn on Block Public Access for the bucket immediately, and at the account level if no bucket in the account should be public.
  2. Find out what was exposed and for how long: review the bucket policy and ACL history in CloudTrail and AWS Config, and check server access logs or CloudTrail data events if they were enabled.
  3. Follow your incident and data-protection process, which may include notifying your security and legal teams.
  4. Prevent repeats: enforce account-level Block Public Access through an SCP that denies changing it, and use IAM Access Analyzer to report buckets shared outside the organization.

Our guide to misconfigured S3 bucket risks lists more controls.

How to practise these scenarios

Reading answers is not enough; interviewers ask follow-up questions that only hands-on time prepares you for. Build a small lab in a sandbox account with a budget alert: a VPC with public and private subnets, an ALB with an Auto Scaling group, an RDS Multi-AZ instance and an S3 bucket behind CloudFront. Then break it on purpose. Remove a route, tighten a bucket policy, force a database failover, and practise explaining the fix aloud. For general rounds that mix AWS with Linux, Docker and Kubernetes, use the 200+ DevOps interview questions hub.

If you want guided labs, the AWS Solutions Architect Associate training covers the networking, storage and resilience topics above, and the AWS DevOps Engineer Professional training goes deeper into automation, monitoring and incident response. Classes run in Kharadi, Pune, and live online across India.

Frequently asked questions

What are scenario-based AWS interview questions?

They describe a realistic problem, such as an outage, an access error or a cost spike, and ask what you would do. Interviewers use them to judge troubleshooting order, knowledge of AWS tools and judgement about trade-offs, rather than recall of definitions.

How should I structure my answer to an AWS scenario question?

State the likely causes, explain how you would confirm the real one with a specific log, metric or command, give the fix, and finish with prevention. Keep it under two minutes and invite follow-up questions.

Which AWS topics come up most in scenario rounds?

VPC connectivity, IAM and S3 access errors, Auto Scaling and load balancer health checks, Lambda timeouts, RDS failover and read scaling, cost investigations, multi-account guardrails and disaster recovery.

What is the maximum Lambda timeout?

900 seconds (15 minutes). The default is 3 seconds. If Lambda sits behind a REST API in API Gateway, the integration timeout of 29 seconds applies first unless you raise it for a Regional or private API.

How long does an RDS Multi-AZ failover take?

AWS documents typical failover times of 60 to 120 seconds for Multi-AZ DB instance deployments. Large transactions or long recovery can make it longer, and applications must reconnect because the endpoint's DNS record changes.

What is the difference between an SCP and a permissions boundary?

An SCP applies to every principal in an AWS Organizations account or OU and sets the maximum permissions available there. A permissions boundary is attached to one IAM user or role and limits only that identity. Neither grants permissions by itself.

Do I need an AWS certification to pass scenario interviews?

No. A certification shows structured study, but scenario rounds reward hands-on experience. Being able to describe a problem you actually built and fixed in a lab counts for a lot.

How many scenarios should I practise before an interview?

Aim to explain at least fifteen to twenty scenarios aloud across networking, IAM, compute, databases and cost. Depth on fewer scenarios beats shallow memorisation of many.

References

Interested in learning more?Get a callback from our training advisors.

What's Your Reaction?

Like Like 1
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 1
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.