supraj.dev

Interview questions & answers

AWS Architect

Solutions architecture, IAM, VPC, compute, and resilience.

  • 178 questions
  • 14 easy
  • 81 medium
  • 83 hard
  • 4 related articles

178 questions

Question 1Easy

What is the difference between an IAM role and an IAM user?

#
Show answer

A user is a long-lived identity with permanent credentials, meant for a person or legacy app. A role has no permanent credentials — it's assumed temporarily, handing back short-lived STS credentials. Roles are the secure default for services (EC2, Lambda), cross-account access, and federated/OIDC logins because nothing long-lived is stored.

Question 2Easy

What is the difference between a security group and a NACL?

#
Show answer

A security group is a stateful firewall attached to an ENI/instance — return traffic is automatically allowed, and it has allow rules only. A NACL is a stateless firewall at the subnet level — you must allow both directions explicitly, it supports allow and deny rules, and rules are evaluated in numbered order. SGs are your primary control; NACLs are a coarse subnet-wide backstop.

Question 3Medium

How do you give an EC2 instance access to S3 without hardcoding credentials?

#
Show answer

Attach an IAM role to the instance via an instance profile, with a least-privilege policy scoped to the specific bucket/prefix. The SDK automatically retrieves temporary credentials from the instance metadata service (prefer IMDSv2). No keys are stored on disk and credentials rotate automatically.

Question 4Medium

Explain how a request is routed in a typical public/private VPC setup.

#
Show answer

Public subnets have a route to an Internet Gateway; resources there (e.g. an ALB or NAT gateway) get public IPs. Private subnets route outbound internet traffic through a NAT gateway in a public subnet, so instances can reach the internet but aren't directly reachable. Route tables per subnet, plus security groups and NACLs, define what can talk to what. App/DB tiers live in private subnets; only the load balancer is public.

Question 5Hard

How does an IAM policy evaluation decide allow vs deny?

#
Show answer

Default is implicit deny. AWS gathers all applicable policies (identity, resource, permission boundaries, SCPs, session policies). Any explicit Deny anywhere wins immediately. Otherwise the request is allowed only if there's an explicit Allow AND it isn't blocked by a permission boundary or SCP. So effective permissions are the intersection of identity policy ∩ boundary ∩ SCP, minus any explicit deny.

Question 6Hard

An S3 bucket triggers a Lambda function on s3:ObjectCreated:*. The Lambda writes a message to SQS. How do you guarantee exactly-once processing when S3 event notifications are at-least-once and Lambda may retry?

#
Show answer

S3 event notifications are inherently at-least-once — the same event can be delivered multiple times due to retries or replication events. Lambda may also retry on failure, compounding duplicates. To achieve effective exactly-once, you must implement idempotency in the consumer. The Lambda should extract the S3 object's ETag (or a combination of bucket+key+eventTime) and use it as a deduplication ID. If using SQS FIFO, set MessageDeduplicationId to the event's unique hash — SQS FIFO will reject duplicate messages within the 5-minute deduplication window. However, S3 Event Notifications do not support FIFO natively, so the Lambda must handle dedup by writing the event hash to DynamoDB with a TTL (e.g., 1 hour) using a conditional write (ConditionExpression: attribute_not_exists(PK)). If the conditional write fails, the Lambda skips processing. This pattern catches duplicates from both S3 retries and Lambda retries. Without deduplication, downstream systems may double-count inventory, charge customers twice, or create duplicate database records.

Question 7Hard

You have a DynamoDB table with a partition key of userId and a sort key of timestamp. Under heavy write load, you see throttling on a few partitions. Diagnose the root cause and design a mitigation strategy without full table rebuild.

#
Show answer

This is a "hot partition" problem. The userId partition key causes all writes for a popular user to hit a single partition, exceeding the 1000 WCU/partition limit. Even if the table has 10000 WCU provisioned, throughput is divided across partitions — a single popular user can only consume 1000 WCU. Mitigations: (1) Add a suffix to the partition key — append a random digit (0–9) to userId during writes, and use a scatter-read pattern (Query with BETWEEN for all suffixes) during reads. This spreads writes across 10 partitions but increases read cost. (2) Use write sharding with a configurable shard count stored in a config table — clients compute userId + "-" + (hash(userId) % shardCount). (3) If the access pattern supports it, use DynamoDB Accelerator (DAX) to absorb read traffic, freeing read capacity for write-heavy partitions. (4) Switch to on-demand capacity, which scales per-partition throughput dynamically but may cost more. The core insight: partition key design must account for access distribution, not just uniqueness.

Question 8Medium

What is the difference between an S3 Event Notification sent directly to a Lambda function versus routing through SQS first? When would you insert SQS into the pipeline?

#
Show answer

Direct S3-to-Lambda invocation invokes the function asynchronously — S3 publishes the event, and Lambda queues it internally. However, Lambda has a concurrency limit (1000 by default per account) and an internal event queue with a 6-hour TTL. If the Lambda throttles, S3 retries but the retry window is limited (eventual retries up to 2 times). SQS decouples the producer from the consumer: S3 sends to SQS, and the Lambda polls from SQS. This provides: (1) a durable buffer (up to 14 days) so no events are lost during Lambda cold starts or throttles, (2) batch processing (up to 10 messages per invocation), (3) DLQ support for poison messages, and (4) decoupled retry policies — SQS retries based on a configurable redrivePolicy before discarding. Use direct invocation when latency is critical and the processing is lightweight. Insert SQS when the downstream is variable-throughput, needs batching, or requires guaranteed delivery with custom retry semantics.

Question 9Hard

A corporate network uses a Transit Gateway with multiple VPCs attached. VPC A (spoke) needs to reach VPC B's private RDS instance, but VPC B must not initiate connections back to VPC A. How do you configure route tables and security groups to enforce this?

#
Show answer

Transit Gateway route tables control inter-VPC traffic. To enforce one-way communication, create separate route tables: associate VPC A with Route Table RT_A, and VPC B with Route Table RT_B. In RT_A, add a static route for VPC B's CIDR pointing to the VPC B attachment. Do NOT add a return route in RT_B for VPC A's CIDR — VPC B will not have a route back, so return traffic from RDS (which is a response to an established connection) still flows because AWS tracks connection state at the network interface level. However, RDS itself does not initiate connections. For defense in depth, add a security group on the RDS instance that allows inbound from VPC A's CIDR or the VPC A security group, and set egress to deny all in VPC A's security group. If VPC B has other resources that could be compromised and used as a pivot, also configure a network ACL on VPC B's subnets to deny return traffic to VPC A. Transit Gateway also supports cross-account attachments if VPCs are in different accounts.

Question 10Medium

Lambda functions running behind an Application Load Balancer show high P99 latency during cold starts, but P50 is normal. What factors contribute to cold start latency, and how can you mitigate without always-on provisioned concurrency?

#
Show answer

Cold start latency is the sum of: (1) sandbox allocation (container/download of code), (2) runtime initialization (Node.js parsing, Python import, JVM class loading), (3) handler code initialization (DB connections, config loading inside the handler closure). For ALB-triggered Lambdas, the ALB adds a 750ms idle timeout before recycling the sandbox, making cold starts more frequent under sparse traffic. Mitigations without provisioned concurrency: (1) Use SnapStart for Java/Python — Lambda snapshots the initialized runtime and resumes from snapshot (reducing cold start from seconds to <200ms). (2) Keep functions warm with a CloudWatch Events rule triggering the function every 5 minutes with a dummy event; branch on the event shape to skip real work. (3) Reduce deployment package size — use AWS SDK v3 with tree-shaking, avoid bundling large native modules. (4) Use the arm64 architecture (Graviton2) — lower cost and often faster initialization. (5) Move initialization code outside the handler for connection reuse across warm invocations. For ALB specifically, increase the idle timeout to 60s to keep the connection alive and reduce re-init.

Question 11Hard

An existing t3.medium EC2 instance must be migrated to a different subnet in the same VPC without changing its public IP, private IP, or elastic IP assignment. How do you achieve a zero-downtime migration?

#
Show answer

In AWS, changing a subnet requires stopping the instance, detaching the ENI, and attaching a new ENI in the target subnet — which changes the private IP. To keep the same private IP, you must create a secondary ENI in the target subnet with the desired IP, then swap the primary ENI. However, Elastic IPs can be reassigned: detach the EIP from the old ENI and associate it with the new ENI. For zero-downtime, use a multi-step approach: (1) Provision a second ENI in the target subnet with the same private IP (possible only if the IP is not already in use), (2) Attach the second ENI as eth1, (3) Update the OS routing table to prefer the new ENI, (4) Reassociate the EIP to the new ENI, (5) Remove the old ENI. If the same private IP is impossible (IP belongs to the old subnet's CIDR range), you must use a different private IP and update DNS or use an internal ALB/NLB to abstract the IP. The better approach is to use an Application Load Balancer or NLB in front of the instance, making the instance's IP irrelevant for clients.

Question 12Hard

You have a Multi-AZ RDS PostgreSQL instance and a read replica in a different region. On the primary, a DROP TABLE is executed accidentally. Can the read replica be promoted to recover the table? What is the recovery strategy?

#
Show answer

A cross-region read replica uses logical replication (streaming WAL), which applies all DDL/DML from the primary — including DROP TABLE. By the time you notice, the DROP has already been replayed on the replica, so promoting it gives you a database without the table. For point-in-time recovery (PITR), RDS automatically takes automated backups with transaction log retention. You can restore the primary instance to a point in time just before the DROP (usually within the last 35 days, default 7). Restore to a new instance, extract the table via pg_dump, then import it back to the primary. If the DROP was recent, AWS also supports backtracking for Aurora (not standard RDS). To prevent recurrence use: (1) sql_safe_updates in PostgreSQL via rds.force_autovacuum_logging_level, (2) IAM policy deny rds:DeleteDBInstance on the replica, (3) RDS event notifications for DDL changes, (4) logical replication slots with a secondary consumer that logs incoming WAL for replay audit. The read replica is for read scaling and disaster recovery, not a backup mechanism for DDL mistakes.

Question 13Medium

CloudFront serves content from an S3 origin with RestrictBucketAccess enabled (OAI). But a user is still able to access the S3 object directly using the S3 URL if they guess the object key. How do you block direct S3 access without breaking CloudFront?

#
Show answer

The OAI allows only CloudFront to access S3 via the bucket policy, but if the OAI is not properly configured, or the bucket policy permits s3:GetObject from Principal: "*", direct access works. To block direct S3 access: (1) Configure the bucket policy to deny all principals except the CloudFront OAI (or OAC for v2). Example: "Condition": {"StringEquals": {"AWS:SourceArn": "arn:aws:cloudfront::ACCOUNT:distribution/DIST_ID"}} with Principal: "*", Action: "s3:GetObject", and specifying the OAI ARN. (2) Ensure S3 Block Public Access settings are enabled. (3) Use an Origin Access Control (OAC) instead of OAI — OAC supports aws:SourceArn condition keys for stronger verification. (4) If users still access directly, they are likely getting the objects through a cached response — set Cache-Control: private or add a Referer header check via a CloudFront Lambda@Edge that signs a custom header checked by S3 via bucket policy. (5) Use pre-signed URLs for private content and set CloudFront to sign using trusted key groups.

Question 14Hard

An ECS service using Fargate launch type runs a task that mounts an EFS filesystem. Multiple tasks across AZs write to the same file concurrently, causing data corruption. How do you design for safe concurrent writes without rewriting the application?

#
Show answer

EFS supports the NFSv4.1 protocol with file locking, but the application must use flock() or fcntl() advisory locking, and all tasks must run the same locking protocol. If the application does not use locks, you have three options: (1) Use EFS's GeneralPurpose performance mode with Bursting throughput, which does not help with locking — the app must be fixed. (2) Insert a sidecar container running a distributed lock service like Redis (ElastiCache) or ZooKeeper — the application obtains a lock from the sidecar before writing. This requires code changes. (3) Restructure the workload: instead of all tasks writing to the same file, partition the data by task ID and write to separate files, then merge at read time. This avoids concurrent writes entirely. (4) Use an S3 bucket as the shared store with S3's strong read-after-write consistency (since December 2020) — the application writes to S3 instead of EFS, using conditional writes (If-None-Match: * for new objects) to prevent overwrites. EFS is not designed for high-concurrency same-file writes — it provides NFS semantics, not distributed consensus. If the app cannot be modified, the simplest fix is to serialize writes through an SQS queue consumed by a single task.

Question 15Medium

You encrypt an S3 bucket with SSE-KMS. When you enable S3 Inventory, the inventory reports show "Failed" for some objects. What is causing this, and how do you ensure inventory succeeds for KMS-encrypted objects?

#
Show answer

S3 Inventory reads object metadata to generate reports. For SSE-KMS objects, the inventory service needs kms:Decrypt permission on the KMS key used to encrypt each object. If the KMS key policy or the IAM role executing inventory lacks kms:Decrypt or kms:GenerateDataKey, the inventory cannot read the object's metadata (it tries to decrypt the object's encryption context for the report). Additionally, if the objects are encrypted with different KMS keys (e.g., per-object customer keys), the inventory service must have permissions for every key. Solutions: (1) Grant the S3 Inventory service principal (s3-inventory.amazonaws.com) kms:Decrypt in the KMS key policy using the aws:SourceAccount and aws:SourceArn condition keys. (2) Use a single KMS key for the entire bucket, reducing permission complexity. (3) Verify the inventory is configured with the correct optional fields — requesting SSE-KMS-related fields may require additional permissions. (4) If the objects are in OUTPOSTS, inventory does not support SSE-KMS objects at all — you must use SSE-S3 or SSE-C.

Question 16Medium

Your EC2 instance is running, but the application is inaccessible. What would you check first?

#
Show answer

Evaluate the issue layer-by-layer: (1) Security Group & Network ACLs: Verify inbound rules allow traffic on the application port (e.g., 80/443) from the client's CIDR block. (2) Route Tables: Check if the subnet is associated with an Internet Gateway (IGW) route (0.0.0.0/0 -> igw-xxxx) for public ingress, or a NAT Gateway for private egress. (3) Local OS Listener: SSH in and run ss -ltnp or netstat to confirm the application service is listening on the correct interface (e.g., 0.0.0.0 vs 127.0.0.1) and port. (4) Systemd logs: Run journalctl -u app.service to check if the app crashed or failed startup diagnostics. (5) ALB target health: Verify the load balancer target status if it sits behind an ALB.

Question 17Medium

Why would you choose an Auto Scaling Group over a single EC2 instance?

#
Show answer

An ASG provides several key production benefits over a standalone instance: (1) High Availability & Self-Healing: If an instance becomes unhealthy or fails status checks, the ASG terminates it and launches a new one automatically across Availability Zones. (2) Dynamic Scaling: Horizontally scales capacity out or in based on traffic metrics (CPU, request count, target tracking) to handle sudden spikes. (3) Cost Optimization: Automatically matches compute capacity to demand, scaling down to a minimum count during off-peak hours and utilizing mixed instance policies (Spot and On-Demand). (4) Automated Rollouts: Integrates with Launch Templates to execute rolling updates (InstanceRefresh) with zero downtime.

Question 18Medium

What happens when an EC2 instance fails a health check?

#
Show answer

The response depends on the configuration: (1) Behind ALB: The target group marks the instance unhealthy and stops routing new connections to it, draining existing ones. (2) Inside ASG: The Auto Scaling Group waits for the specified HealthCheckGracePeriod (to allow boot/initialization), and if the instance fails its EC2 status check or ELB target health check, it terminates the instance and launches a replacement based on the current launch template. (3) Troubleshooting: To prevent loss of debug state on termination, you can use ASG Lifecycle Hooks to pause termination, or inspect system logs before the instance is deleted.

Question 19Medium

How would you securely access a private EC2 instance?

#
Show answer

Avoid using jump servers with open port 22. Instead, use: (1) AWS Systems Manager (SSM) Session Manager: Recommended standard. Requires the SSM Agent running on the instance and an IAM Role with AmazonSSMManagedInstanceCore permissions. Access is authenticated via IAM and logged, with no inbound port 22 open. (2) EC2 Instance Connect Endpoint (EICE): Allows SSH tunneling using the AWS CLI or Console via a managed VPC endpoint. (3) Bastion Jump Host: Hardened instance in a public subnet, restricted by security groups to allow SSH from a specific developer IP address only.

Question 20Medium

EBS vs EFS — when would you use each?

#
Show answer

(1) EBS (Elastic Block Store): Block storage attached to a single EC2 instance (ReadWriteOnce). Best for performance-sensitive, transactional, or low-latency workloads like database storage (gp3/io2 Block Express for databases). (2) EFS (Elastic File System): Serverless POSIX-compliant shared filesystem (ReadWriteMany) that can be mounted concurrently by thousands of compute instances (EC2, ECS, EKS) across multiple Availability Zones. Best for shared application assets, configuration directories, and parallel pipelines needing concurrent file access.

Question 21Easy

Why should an application use an IAM Role instead of Access Keys?

#
Show answer

IAM Roles provide superior security: (1) Temporary Credentials: Roles use the Security Token Service (STS) to generate credentials that rotate automatically every 1 to 12 hours, eliminating the risk of compromised long-lived keys. (2) No Stored Secrets: Applications do not need access key secrets stored on disk or environment variables. (3) Scoped Governance: AWS dynamically provisions metadata credentials to EC2 instances, ECS task execution, or Lambda execution environments. (4) Audit trails: Role assumptions are recorded in CloudTrail.

Question 22Medium

A user cannot access an S3 bucket. How would you troubleshoot it?

#
Show answer

Evaluate the authorization layers in sequence: (1) S3 Block Public Access: Verify if global settings block public reads. (2) Bucket Policy: Check for explicit Denys or IP/VPC restrictions in the bucket's resource policy. (3) Identity-Based IAM Policy: Ensure the user's IAM role/user has appropriate permissions (s3:GetObject / s3:ListBucket). (4) Permission Boundary / SCP: Check for restrictions at the Organizations level. (5) KMS Key Policy: If the bucket uses SSE-KMS, verify the IAM user has kms:Decrypt and kms:GenerateDataKey on the key policy.

Question 23Easy

What is the difference between an S3 Bucket Policy and an IAM Policy?

#
Show answer

(1) S3 Bucket Policy: A resource-based policy written in JSON and attached directly to the bucket. It specifies *who* (Principals) can perform actions on the bucket, which is ideal for configuring cross-account access. (2) IAM Policy: An identity-based policy attached directly to a user, group, or role, defining *what* actions that specific identity can perform across any resources. Both policies are evaluated together, and any explicit Deny in either overrides all Allows.

Question 24Easy

How would you recover a deleted file from S3?

#
Show answer

(1) Versioning Enabled: S3 does not delete the actual object on a simple Delete call; it writes a "Delete Marker" as the current version. To recover, toggle "Show Versions" in the console or CLI, find the Delete Marker, and delete it. The previous version becomes active again. (2) Versioning Disabled: The deletion is permanent. Recovery is impossible unless you have replication configured (CRR/SRR) or must restore from an S3 backup/snapshot.

Question 25Easy

What is the purpose of S3 Versioning?

#
Show answer

S3 Versioning protects against accidental deletions and overwrites by retaining multiple iterations of an object in the same bucket. It allows you to roll back files to previous historical versions and recover deleted files. It is also a prerequisite for S3 Replication (Cross-Region/Same-Region) and S3 Object Lock. Pair with S3 Lifecycle rules to transition older versions to cheaper storage (Glacier) to control costs.

Question 26Easy

Public Subnet vs Private Subnet?

#
Show answer

(1) Public Subnet: The route table has an explicit route pointing to an Internet Gateway (0.0.0.0/0 -> igw-xxxx). Resources inside get public IP addresses and can be accessed directly from the internet. Best for ALBs, public NAT Gateways, and bastions. (2) Private Subnet: The route table does not point to an Internet Gateway. Resources only have private IPs and route outbound traffic through a NAT Gateway in a public subnet. Best for applications, databases, and private backends.

Question 27Easy

Why do we need a NAT Gateway?

#
Show answer

A NAT (Network Address Translation) Gateway resides in a public subnet and enables resources in private subnets (like database EC2s or Lambda functions) to securely connect outbound to the internet (for package updates, third-party API calls, or patches) while preventing external hosts on the internet from initiating inbound connections back to those private resources.

Question 28Easy

Security Group vs NACL?

#
Show answer

(1) Security Group: Stateful firewall at the instance/ENI level. Inbound allowed traffic automatically allows return outbound traffic. Evaluates all rules, supports "Allow" only. (2) Network ACL (NACL): Stateless firewall at the subnet boundary. You must explicitly configure both inbound and outbound rules. Evaluates rules sequentially in numbered order, supports both "Allow" and "Deny" rules.

Question 29Medium

What happens if a route table is misconfigured?

#
Show answer

Misconfigured route tables drop packets, resulting in "Connection Timeout" or routing failures. Common errors include: (1) Missing internet egress (0.0.0.0/0 route) in a public subnet, (2) Private subnets routing to an IGW instead of a NAT, (3) Missing peer/Transit Gateway routes for VPC-to-VPC traffic. Diagnose using VPC Reachability Analyzer or by checking route status in the console.

Question 30Medium

How would you design a highly available VPC?

#
Show answer

(1) Multi-AZ: Spread resources across at least two (ideally three) Availability Zones. (2) Tiered Subnets: Deploy public subnets (external load balancers), private application subnets (EC2, ECS, EKS), and isolated data subnets (databases, caches) in each AZ. (3) Redundant NATs: Deploy one NAT Gateway in each AZ's public subnet to ensure that an AZ failure does not disrupt outbound connectivity for the other zones. (4) Route Tables: Separate route tables per subnet type and AZ.

Question 31Medium

ALB vs NLB — when would you use each?

#
Show answer

(1) Application Load Balancer (ALB): Operates at Layer 7 (Application). Supports HTTP/HTTPS, path-based routing, host-based routing, SSL termination, WAF, gRPC, and user authentication. Best for web applications and REST APIs. (2) Network Load Balancer (NLB): Operates at Layer 4 (Transport). Can handle millions of connections per second with ultra-low latency, supports static/Elastic IPs, TCP/UDP sockets, TLS pass-through, and is best for gaming, TCP services, or high-throughput stream processing.

Question 32Medium

Why would you place an Application Load Balancer in public subnets?

#
Show answer

An internet-facing ALB must be placed in public subnets so it can accept public incoming traffic, map public IP addresses to its listeners, and route requests. It then terminates SSL and forwards traffic internally to the application backend servers (EC2 instances or containers) residing securely in private subnets, acting as a buffer that prevents exposing private compute directly.

Question 33Medium

How does Route 53 help with high availability?

#
Show answer

Route 53 provides high availability through DNS routing strategies: (1) DNS Failover: Uses health checks to monitor backend endpoints and automatically routes traffic away from failed resources to healthy targets or static backup pages. (2) Active-Active/Active-Passive routing, (3) Latency and Geolocation routing: Directs users to the closest healthy AWS region. (4) Weighted routing: Shifts traffic gradually during canary updates.

Question 34Easy

What happens when a DNS record is updated?

#
Show answer

When a DNS record is updated in Route 53, the changes are propagated globally to all Route 53 name servers in seconds. However, clients and local ISP resolvers cache the old record based on the Time-to-Live (TTL) value. Until the TTL expires, clients will continue routing traffic to the old destination. For migrations, you should lower the record TTL (e.g., to 60s) before executing the cutover.

Question 35Easy

CloudWatch vs CloudTrail?

#
Show answer

(1) CloudWatch: Observability and monitoring. Captures performance metrics (CPU, memory, disk, network), application logs, and generates alerts/alarms based on threshold metrics. Focuses on *resource performance*. (2) CloudTrail: Auditing and compliance. Records every API call made in the AWS account, including the user, time, source IP, and action taken. Focuses on *account activity and security*.

Question 36Medium

What AWS services would you use to monitor application health?

#
Show answer

A comprehensive monitoring stack includes: (1) CloudWatch Metrics & Alarms for system and application status, (2) Route 53 Health Checks for external endpoint uptime, (3) CloudWatch Synthetics (canaries) to run automated browser scripts simulating user login and checkout flows, (4) AWS X-Ray for distributed tracing to identify API dependency latency and bottlenecks.

Question 37Medium

How would you investigate a sudden spike in AWS costs?

#
Show answer

Use a structured cost audit: (1) AWS Cost Explorer: Group cost by service, region, or usage type to pinpoint the spike. (2) Cost Anomaly Detection: Identify the exact resource that deviated. (3) Cost Allocation Tags: Track which project or team owns the resource. (4) AWS Budgets: Set alerts to notify on forecasts. (5) Athena + CUR (Cost & Usage Report): Run SQL queries on CUR logs for granular billing metadata (e.g., NAT Gateway data transfer, unattached EBS volumes).

Question 38Easy

What metrics do you monitor for EC2 instances?

#
Show answer

Monitor both hypervisor and OS metrics: (1) Default Metrics: CPU utilization, Network In/Out, Disk Reads/Writes (Ops/Bytes), and Status Checks (StatusCheckFailed_System / StatusCheckFailed_Instance). (2) Custom Agent Metrics: Memory utilization and local disk space (requires the CloudWatch Agent). (3) Burst Metrics: CPU Credit Balance for burstable instance classes (t3/t4g) to prevent unexpected performance throttling.

Question 39Easy

What is the purpose of an Auto Scaling Policy?

#
Show answer

An Auto Scaling Policy defines how an Auto Scaling Group adjusts its instance count. (1) Target Tracking: Keeps a metric stable (e.g., average CPU at 60%). (2) Step Scaling: Responds to alarms with stepped instance changes (e.g., if CPU is 80% add 2, if 95% add 4). (3) Scheduled Scaling: Scales capacity based on known timing patterns (e.g., scaling up on business mornings, scaling down at night).

Question 40Medium

How would you secure secrets and passwords in AWS?

#
Show answer

Implement a zero-secret policy: (1) AWS Secrets Manager: Best for database keys. Supports automatic rotation, KMS encryption at rest, and secret versioning. (2) Systems Manager (SSM) Parameter Store: SecureString parameters integrate with KMS for lightweight config tokens. (3) Runtime Injection: Inject secrets as environment variables into ECS/Fargate task definitions or Lambda configs at runtime instead of hardcoding them in container images or source code.

Question 41Medium

What would happen if an RDS instance becomes unavailable?

#
Show answer

(1) Single-AZ Setup: The database goes offline, causing application downtime (high RTO) and potential data loss (RPO). You must restore from snapshots. (2) Multi-AZ Setup: AWS automatically fails over to a standby replica in a different AZ. The DNS CNAME record of the database endpoint is updated to point to the new primary. The failover takes 60–120 seconds, ensuring high availability with no data loss.

Question 42Medium

Multi-AZ vs Read Replica?

#
Show answer

(1) Multi-AZ: High availability and disaster recovery. Uses synchronous replication to a standby instance in another AZ. Standby cannot serve traffic; failover is automatic. (2) Read Replicas: Scalability. Uses asynchronous replication to read-only database nodes (can be cross-region). Replicas serve read queries to offload the primary, but failover is manual (requires promoting the replica).

Question 43Hard

How would you perform a zero-downtime deployment in AWS?

#
Show answer

Use one of these three deployment strategies: (1) Blue/Green: Spin up a duplicate environment (Green), deploy new code, test it, then swap DNS or ALB target group weights to shift users to Green. (2) Canary: Deploy the new code to a small percentage of instances, routing 5% of traffic, monitor error rates/logs, then scale up. (3) Rolling: ASG Instance Refresh terminates and replaces instances in batches (e.g., 25% at a time), keeping the minimum healthy instances active.

Question 44Medium

A deployment succeeds, but users cannot access the application. What would you check?

#
Show answer

Check the network path and target state: (1) Target Group Health: Verify if targets are passing health checks. If they fail, inspect the application startup logs. (2) DNS Routing: Ensure Route 53 records resolve to the correct load balancer. (3) Security Groups: Check if the deploy updated security group rules, blocking communication between the ALB and instances. (4) CloudWatch Metrics: Inspect ALB request count, 5XX errors, and target connection errors.

Question 45Hard

Explain the AWS architecture you worked on and why it was designed that way.

#
Show answer

Designed a highly resilient, 3-tier microservice architecture: (1) Edge/Ingress: Route 53 with latency-based routing to CloudFront for static assets and public ALBs. (2) Compute: EKS (Elastic Kubernetes Service) with Fargate profiles in private subnets, avoiding node management and autoscaling based on CPU/Memory and SQS queue depth. (3) Database: Amazon Aurora PostgreSQL Serverless Multi-AZ for transactional data, combined with DynamoDB for session state and S3 for static assets. (4) Security: IAM Roles for Service Accounts (IRSA) for least privilege, SSM Session Manager for secure console access, and KMS for full-stack data encryption at rest.

Question 46Hard

Your API Gateway behind CloudFront shows intermittent 503 errors. CloudFront logs show OriginConnectError. ALB target health checks pass. Walk through the complete debugging process.

#
Show answer

CloudFront's OriginConnectError means CloudFront cannot establish a TCP connection to your custom origin (API Gateway or ALB). Causes and checks: (1) CloudFront origin protocol mismatch — if the origin is set to HTTPS but API Gateway only accepts HTTPS, verify the origin protocol matches. (2) API Gateway endpoint type — if using EDGE optimized, CloudFront in front of an Edge-optimized API Gateway creates a circular dependency; use REGIONAL endpoint type behind CloudFront. (3) Custom domain name — API Gateway requires the Host header to match its configured domain; CloudFront may send the wrong Host. Set the Origin Custom Header to Host: <api-gateway-host>. (4) ALB idle timeout — if the origin is an ALB, ensure the ALB idle timeout (default 60s) exceeds CloudFront's origin response timeout (default 30s, max 120s for custom origins). (5) Security group — ALB security group must allow inbound from CloudFront's IP ranges (published in https://d7uri8nf7uskq.cloudfront.net/tools/list-cloudfront-ips), not from 0.0.0.0/0. (6) WAF rate limiting — if API Gateway has WAF with rate-based rules, CloudFront requests from shared IPs can trigger blocks. Enable CloudFront-Forwarded-Headers or use managed rule groups. Check CloudWatch logs for 503s with IntegrationErrorMessage to pinpoint the cause.

Question 47Hard

A Lambda function processes SQS messages in batches of 10. Under high load, some messages succeed while others in the same batch fail. The failed messages retry, but the successful ones are reprocessed, causing duplicates. How do you ensure at-most-once or exactly-once processing?

#
Show answer

SQS + Lambda uses partial batch responses (since Nov 2020): your function returns {"batchItemFailures": [{"itemIdentifier": "<messageId>"}]}, telling Lambda which messages failed. Successful messages are removed from the queue; only failed ones are retried. Implementation: in your handler, process each message in a loop; if a message fails, catch the error, record its messageId in a list, and continue processing the rest. After the loop, return { batchItemFailures: failedIds.map(id => ({ itemIdentifier: id })) }. Lambda then deletes the successful messages from the queue and leaves the failed ones for retry. This achieves at-least-once for successful messages (exactly-once is impossible without dedup). For stronger guarantees: use SQS FIFO with MessageDeduplicationId based on a business-level unique key — SQS FIFO deduplicates within 5 minutes. However, Lambda doesn't support FIFO partial batch responses in all regions yet. Combine DynamoDB conditional writes for idempotency as a fallback: store processed message IDs with a TTL.

Question 48Medium

Your team accidentally deleted an S3 bucket with 5 years of customer data. Versioning was not enabled. MFA Delete was disabled. What recovery options exist and what do you do in the first 15 minutes?

#
Show answer

Without versioning, S3 object deletions are permanent within minutes. Recovery options depend on timing: (1) AWS Support case — open an urgent ticket with AWS Support; they may be able to recover deleted buckets within a window (typically a few hours to days) via internal S3 garbage collection processes. This is not guaranteed. (2) Cross-region replication — if CRR was configured, the replica bucket may still have the data. (3) Backup — restore from any external backup (AWS Backup, Velero, database dumps, ETL pipelines). (4) Glacier/Vault — if a Vault Lock or Glacier Archive was created, data may be recoverable. First 15 minutes: (1) Do NOT make any further API calls to the bucket — no writes, no list operations. (2) Open AWS Support urgent case, provide bucket name and approximate deletion time. (3) Check CloudTrail to identify who/what performed the delete — review s3:DeleteBucket events. (4) Check if the bucket name is still reserved (try aws s3api head-bucket). (5) If the bucket name is available, create it immediately with the same name to prevent someone else from registering it. (6) Contact the account team if you have Enterprise Support. Prevention: S3 Versioning + MFA Delete + AWS Backup + S3 Object Lock (write-once-read-many) for critical data. Also configure deletion prevention via SCPs that deny s3:DeleteBucket without MFA.

Question 49Hard

AWS Architect incident: One AZ impairment causes user-facing errors even though resources exist in two AZs. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: ALB target health, subnet/AZ mapping, route tables, RDS events, and CloudWatch metrics. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Place load-balanced stateless tiers across AZs, verify health checks per AZ, use managed Multi-AZ data services, and test AZ evacuation rather than assuming redundancy works.

Question 50Hard

AWS Architect architecture scenario: Design a highly available web tier with database failover. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Place load-balanced stateless tiers across AZs, verify health checks per AZ, use managed Multi-AZ data services, and test AZ evacuation rather than assuming redundancy works.

Question 51Medium

AWS Architect security scenario: Security groups allow broad east-west traffic between tiers. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Place load-balanced stateless tiers across AZs, verify health checks per AZ, use managed Multi-AZ data services, and test AZ evacuation rather than assuming redundancy works.

Question 52Hard

AWS Architect release scenario: Move a single-AZ service to multi-AZ without downtime. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Place load-balanced stateless tiers across AZs, verify health checks per AZ, use managed Multi-AZ data services, and test AZ evacuation rather than assuming redundancy works.

Question 53Medium

AWS Architect reliability/cost scenario: Cross-AZ data transfer and idle capacity costs are rising. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Place load-balanced stateless tiers across AZs, verify health checks per AZ, use managed Multi-AZ data services, and test AZ evacuation rather than assuming redundancy works.

Question 54Hard

AWS Architect incident: A Lambda gets AccessDenied in production but works with admin permissions. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: CloudTrail denied events, IAM policy simulator, Access Analyzer, and service-specific condition keys. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Start from observed actions, scope resources and conditions, use roles not users, add permission boundaries where needed, and keep break-glass access separate.

Question 55Hard

AWS Architect architecture scenario: Design least-privilege IAM for compute workloads. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Start from observed actions, scope resources and conditions, use roles not users, add permission boundaries where needed, and keep break-glass access separate.

Question 56Medium

AWS Architect security scenario: Wildcard IAM policies allow privilege escalation. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Start from observed actions, scope resources and conditions, use roles not users, add permission boundaries where needed, and keep break-glass access separate.

Question 57Hard

AWS Architect release scenario: Replace broad IAM policies with scoped permissions. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Start from observed actions, scope resources and conditions, use roles not users, add permission boundaries where needed, and keep break-glass access separate.

Question 58Medium

AWS Architect reliability/cost scenario: Security review blocks production release. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Start from observed actions, scope resources and conditions, use roles not users, add permission boundaries where needed, and keep break-glass access separate.

Question 59Hard

AWS Architect incident: Private instances cannot reach a managed service endpoint. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: route tables, security groups, NACLs, VPC flow logs, endpoint policies, and DNS resolution. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Trace source subnet route, destination DNS, endpoint policy, security group, NACL, and return path. Use gateway/interface endpoints for supported services and keep NAT for true internet egress.

Question 60Hard

AWS Architect architecture scenario: Design private networking for app, data, and shared services. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Trace source subnet route, destination DNS, endpoint policy, security group, NACL, and return path. Use gateway/interface endpoints for supported services and keep NAT for true internet egress.

Question 61Medium

AWS Architect security scenario: Public IPs are added to fix connectivity quickly. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Trace source subnet route, destination DNS, endpoint policy, security group, NACL, and return path. Use gateway/interface endpoints for supported services and keep NAT for true internet egress.

Question 62Hard

AWS Architect release scenario: Move outbound traffic from internet paths to VPC endpoints. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Trace source subnet route, destination DNS, endpoint policy, security group, NACL, and return path. Use gateway/interface endpoints for supported services and keep NAT for true internet egress.

Question 63Medium

AWS Architect reliability/cost scenario: NAT gateway costs are unexpectedly high. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Trace source subnet route, destination DNS, endpoint policy, security group, NACL, and return path. Use gateway/interface endpoints for supported services and keep NAT for true internet egress.

Question 64Hard

AWS Architect incident: A private object is reachable through an unexpected URL. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: bucket policy, public access block, CloudTrail data events, CloudFront origin config, and access logs. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Enable Block Public Access, use OAC/OAI correctly, restrict bucket policy by distribution, log object access, and use lifecycle/caching for cost control.

Question 65Hard

AWS Architect architecture scenario: Design S3 access through CloudFront only. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Enable Block Public Access, use OAC/OAI correctly, restrict bucket policy by distribution, log object access, and use lifecycle/caching for cost control.

Question 66Medium

AWS Architect security scenario: Bucket policy uses public principals or weak conditions. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Enable Block Public Access, use OAC/OAI correctly, restrict bucket policy by distribution, log object access, and use lifecycle/caching for cost control.

Question 67Hard

AWS Architect release scenario: Migrate from public S3 hosting to private origin access. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Enable Block Public Access, use OAC/OAI correctly, restrict bucket policy by distribution, log object access, and use lifecycle/caching for cost control.

Question 68Medium

AWS Architect reliability/cost scenario: Data transfer and request costs spike after hotlinking. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Enable Block Public Access, use OAC/OAI correctly, restrict bucket policy by distribution, log object access, and use lifecycle/caching for cost control.

Question 69Hard

AWS Architect incident: A bad migration corrupts production data. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: RDS events, automated backup status, PITR window, snapshots, parameter changes, and database logs. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use PITR, final snapshots, tested restore drills, migration approvals, least-privilege DB users, and rollback plans that include application compatibility.

Question 70Hard

AWS Architect architecture scenario: Design backup and restore for relational databases. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use PITR, final snapshots, tested restore drills, migration approvals, least-privilege DB users, and rollback plans that include application compatibility.

Question 71Medium

AWS Architect security scenario: Application roles have destructive database privileges. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use PITR, final snapshots, tested restore drills, migration approvals, least-privilege DB users, and rollback plans that include application compatibility.

Question 72Hard

AWS Architect release scenario: Introduce blue/green database migration safety. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use PITR, final snapshots, tested restore drills, migration approvals, least-privilege DB users, and rollback plans that include application compatibility.

Question 73Medium

AWS Architect reliability/cost scenario: Storage and backup retention costs are increasing. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use PITR, final snapshots, tested restore drills, migration approvals, least-privilege DB users, and rollback plans that include application compatibility.

Question 74Hard

AWS Architect incident: A few keys throttle while table-level capacity looks healthy. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: CloudWatch throttles, Contributor Insights, partition key distribution, and access pattern review. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Design from access patterns, spread hot writes with sharding where needed, avoid scans, use GSIs carefully, and validate cost under realistic traffic.

Question 75Hard

AWS Architect architecture scenario: Design a table for high-write multi-tenant traffic. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Design from access patterns, spread hot writes with sharding where needed, avoid scans, use GSIs carefully, and validate cost under realistic traffic.

Question 76Medium

AWS Architect security scenario: IAM allows full table scans from application roles. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Design from access patterns, spread hot writes with sharding where needed, avoid scans, use GSIs carefully, and validate cost under realistic traffic.

Question 77Hard

AWS Architect release scenario: Change partition strategy without a big-bang migration. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Design from access patterns, spread hot writes with sharding where needed, avoid scans, use GSIs carefully, and validate cost under realistic traffic.

Question 78Medium

AWS Architect reliability/cost scenario: On-demand capacity costs are climbing. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Design from access patterns, spread hot writes with sharding where needed, avoid scans, use GSIs carefully, and validate cost under realistic traffic.

Question 79Hard

AWS Architect incident: One event source consumes all Lambda concurrency and starves APIs. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: Lambda concurrency metrics, throttles, event source mapping settings, DLQ depth, and CloudWatch logs. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Set reserved concurrency for critical functions, tune batch size and retry behavior, use DLQs or destinations, and make handlers idempotent.

Question 80Hard

AWS Architect architecture scenario: Design serverless concurrency isolation. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Set reserved concurrency for critical functions, tune batch size and retry behavior, use DLQs or destinations, and make handlers idempotent.

Question 81Medium

AWS Architect security scenario: Functions have broad permissions across event sources. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Set reserved concurrency for critical functions, tune batch size and retry behavior, use DLQs or destinations, and make handlers idempotent.

Question 82Hard

AWS Architect release scenario: Introduce reserved concurrency and DLQs. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Set reserved concurrency for critical functions, tune batch size and retry behavior, use DLQs or destinations, and make handlers idempotent.

Question 83Medium

AWS Architect reliability/cost scenario: Retries and duplicate work increase cost. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Set reserved concurrency for critical functions, tune batch size and retry behavior, use DLQs or destinations, and make handlers idempotent.

Question 84Hard

AWS Architect incident: Tasks restart during deployment and the service drops traffic. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: ECS service events, target group health, task logs, CPU/memory metrics, and deployment config. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Tune health checks, min/max healthy percentages, task sizing, autoscaling, IAM roles, and log visibility before migrating production traffic.

Question 85Hard

AWS Architect architecture scenario: Design a resilient container service on ECS. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Tune health checks, min/max healthy percentages, task sizing, autoscaling, IAM roles, and log visibility before migrating production traffic.

Question 86Medium

AWS Architect security scenario: Task roles and execution roles are over-permissive. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Tune health checks, min/max healthy percentages, task sizing, autoscaling, IAM roles, and log visibility before migrating production traffic.

Question 87Hard

AWS Architect release scenario: Move EC2-hosted containers to Fargate. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Tune health checks, min/max healthy percentages, task sizing, autoscaling, IAM roles, and log visibility before migrating production traffic.

Question 88Medium

AWS Architect reliability/cost scenario: Fargate costs are higher than expected. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Tune health checks, min/max healthy percentages, task sizing, autoscaling, IAM roles, and log visibility before migrating production traffic.

Question 89Hard

AWS Architect incident: A node group upgrade evicts too many pods at once. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: EKS events, node drain logs, PDBs, pod scheduling, IAM access entries, and autoscaler logs. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use managed node groups carefully, enforce PDBs, isolate namespaces, use IRSA/workload identity, and test upgrades in a staging cluster first.

Question 90Hard

AWS Architect architecture scenario: Design an EKS platform for multiple teams. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use managed node groups carefully, enforce PDBs, isolate namespaces, use IRSA/workload identity, and test upgrades in a staging cluster first.

Question 91Medium

AWS Architect security scenario: Cluster admin access is granted broadly. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use managed node groups carefully, enforce PDBs, isolate namespaces, use IRSA/workload identity, and test upgrades in a staging cluster first.

Question 92Hard

AWS Architect release scenario: Upgrade Kubernetes version with minimal downtime. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use managed node groups carefully, enforce PDBs, isolate namespaces, use IRSA/workload identity, and test upgrades in a staging cluster first.

Question 93Medium

AWS Architect reliability/cost scenario: Cluster autoscaler overprovisions nodes. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use managed node groups carefully, enforce PDBs, isolate namespaces, use IRSA/workload identity, and test upgrades in a staging cluster first.

Question 94Hard

AWS Architect incident: Users see stale or wrong content after a deploy. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: CloudFront cache headers, access logs, origin logs, invalidation history, and cache policy config. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use versioned assets, correct Cache-Control, targeted invalidations, separate cache behaviors, and explicit private content controls.

Question 95Hard

AWS Architect architecture scenario: Design global static and dynamic content delivery. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use versioned assets, correct Cache-Control, targeted invalidations, separate cache behaviors, and explicit private content controls.

Question 96Medium

AWS Architect security scenario: Signed URL or header logic leaks private content. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use versioned assets, correct Cache-Control, targeted invalidations, separate cache behaviors, and explicit private content controls.

Question 97Hard

AWS Architect release scenario: Change cache policies and origin request policies safely. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use versioned assets, correct Cache-Control, targeted invalidations, separate cache behaviors, and explicit private content controls.

Question 98Medium

AWS Architect reliability/cost scenario: Origin load and CloudFront invalidation costs are high. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use versioned assets, correct Cache-Control, targeted invalidations, separate cache behaviors, and explicit private content controls.

Question 99Hard

AWS Architect incident: A poison message blocks useful work and retries repeatedly. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: queue depth, age of oldest message, receive count, DLQ metrics, and consumer logs. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use visibility timeout based on processing time, DLQs, idempotency keys, batch failure handling, and backpressure-aware consumers.

Question 100Hard

AWS Architect architecture scenario: Design asynchronous processing with backpressure. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use visibility timeout based on processing time, DLQs, idempotency keys, batch failure handling, and backpressure-aware consumers.

Question 101Medium

AWS Architect security scenario: Messages contain sensitive payloads without encryption controls. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use visibility timeout based on processing time, DLQs, idempotency keys, batch failure handling, and backpressure-aware consumers.

Question 102Hard

AWS Architect release scenario: Introduce DLQ and redrive policies. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use visibility timeout based on processing time, DLQs, idempotency keys, batch failure handling, and backpressure-aware consumers.

Question 103Medium

AWS Architect reliability/cost scenario: Retry storms increase Lambda and downstream costs. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use visibility timeout based on processing time, DLQs, idempotency keys, batch failure handling, and backpressure-aware consumers.

Question 104Hard

AWS Architect incident: A service cannot decrypt data after a key policy change. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: CloudTrail KMS events, key policy, grants, encryption context, and service role permissions. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Separate admin and usage permissions, use grants for AWS services when appropriate, test key policy changes, and cache data keys where services support it.

Question 105Hard

AWS Architect architecture scenario: Design encryption key ownership across accounts. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Separate admin and usage permissions, use grants for AWS services when appropriate, test key policy changes, and cache data keys where services support it.

Question 106Medium

AWS Architect security scenario: Key administrators can also decrypt production data. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Separate admin and usage permissions, use grants for AWS services when appropriate, test key policy changes, and cache data keys where services support it.

Question 107Hard

AWS Architect release scenario: Rotate customer-managed keys. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Separate admin and usage permissions, use grants for AWS services when appropriate, test key policy changes, and cache data keys where services support it.

Question 108Medium

AWS Architect reliability/cost scenario: KMS request costs grow with high-volume workloads. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Separate admin and usage permissions, use grants for AWS services when appropriate, test key policy changes, and cache data keys where services support it.

Question 109Hard

AWS Architect incident: A deployment role works in dev but cannot assume the prod role. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: STS assume-role errors, trust policy, SCPs, permission boundaries, and CloudTrail. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use Organizations, SCP guardrails, explicit trust, external IDs where needed, centralized identity, and account vending with standard baselines.

Question 110Hard

AWS Architect architecture scenario: Design multi-account landing zone access. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use Organizations, SCP guardrails, explicit trust, external IDs where needed, centralized identity, and account vending with standard baselines.

Question 111Medium

AWS Architect security scenario: Trust policies allow unknown principals. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use Organizations, SCP guardrails, explicit trust, external IDs where needed, centralized identity, and account vending with standard baselines.

Question 112Hard

AWS Architect release scenario: Move workloads into separate AWS accounts. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use Organizations, SCP guardrails, explicit trust, external IDs where needed, centralized identity, and account vending with standard baselines.

Question 113Medium

AWS Architect reliability/cost scenario: Account sprawl creates operational overhead. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use Organizations, SCP guardrails, explicit trust, external IDs where needed, centralized identity, and account vending with standard baselines.

Question 114Hard

AWS Architect incident: An outage occurs but CloudWatch alarms did not fire. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: CloudWatch metrics, logs, X-Ray traces, alarm history, synthetic checks, and dashboard gaps. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Alert on symptoms and saturation, keep debug logs sampled, protect sensitive fields, and align alarms to user impact rather than every low-level metric.

Question 115Hard

AWS Architect architecture scenario: Design meaningful AWS monitoring for user journeys. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Alert on symptoms and saturation, keep debug logs sampled, protect sensitive fields, and align alarms to user impact rather than every low-level metric.

Question 116Medium

AWS Architect security scenario: Logs expose secrets or customer data. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Alert on symptoms and saturation, keep debug logs sampled, protect sensitive fields, and align alarms to user impact rather than every low-level metric.

Question 117Hard

AWS Architect release scenario: Introduce SLO-based alarms across services. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Alert on symptoms and saturation, keep debug logs sampled, protect sensitive fields, and align alarms to user impact rather than every low-level metric.

Question 118Medium

AWS Architect reliability/cost scenario: Log ingestion costs are too high. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Alert on symptoms and saturation, keep debug logs sampled, protect sensitive fields, and align alarms to user impact rather than every low-level metric.

Question 119Hard

AWS Architect incident: DNS failover did not move users during a regional incident. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: Route 53 health checks, resolver output, TTLs, regional ALB health, and synthetic tests. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Understand DNS TTL limits, use external health checks, test failover regularly, and decide active-active versus active-passive based on RTO/RPO and cost.

Question 120Hard

AWS Architect architecture scenario: Design multi-region traffic failover. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Understand DNS TTL limits, use external health checks, test failover regularly, and decide active-active versus active-passive based on RTO/RPO and cost.

Question 121Medium

AWS Architect security scenario: Health checks expose internal endpoints. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Understand DNS TTL limits, use external health checks, test failover regularly, and decide active-active versus active-passive based on RTO/RPO and cost.

Question 122Hard

AWS Architect release scenario: Introduce weighted routing before active-active. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Understand DNS TTL limits, use external health checks, test failover regularly, and decide active-active versus active-passive based on RTO/RPO and cost.

Question 123Medium

AWS Architect reliability/cost scenario: Multi-region duplication costs are high. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Understand DNS TTL limits, use external health checks, test failover regularly, and decide active-active versus active-passive based on RTO/RPO and cost.

Question 124Hard

AWS Architect incident: Monthly AWS spend doubles after a platform rollout. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: Cost Explorer, CUR, tags, Trusted Advisor, Compute Optimizer, and service-level usage metrics. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Find top drivers, tag ownership, rightsizing compute, optimize data transfer/NAT/logs, and create budgets with accountable owners.

Question 125Hard

AWS Architect architecture scenario: Design cost-aware cloud architecture. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Find top drivers, tag ownership, rightsizing compute, optimize data transfer/NAT/logs, and create budgets with accountable owners.

Question 126Medium

AWS Architect security scenario: Cost visibility roles expose account-wide metadata broadly. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Find top drivers, tag ownership, rightsizing compute, optimize data transfer/NAT/logs, and create budgets with accountable owners.

Question 127Hard

AWS Architect release scenario: Introduce budgets and cost allocation tags. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Find top drivers, tag ownership, rightsizing compute, optimize data transfer/NAT/logs, and create budgets with accountable owners.

Question 128Medium

AWS Architect reliability/cost scenario: Leadership asks for immediate savings without downtime. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Find top drivers, tag ownership, rightsizing compute, optimize data transfer/NAT/logs, and create budgets with accountable owners.

Question 129Hard

AWS Architect incident: A restore takes longer than the stated RTO. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: AWS Backup jobs, restore test logs, snapshot age, cross-region copy status, and IAM delete permissions. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Define RTO/RPO per workload, test restores, isolate backup delete rights, copy critical backups cross-account or cross-region, and tier retention.

Question 130Hard

AWS Architect architecture scenario: Design disaster recovery across AWS services. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Define RTO/RPO per workload, test restores, isolate backup delete rights, copy critical backups cross-account or cross-region, and tier retention.

Question 131Medium

AWS Architect security scenario: Backup delete permissions are too broad. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Define RTO/RPO per workload, test restores, isolate backup delete rights, copy critical backups cross-account or cross-region, and tier retention.

Question 132Hard

AWS Architect release scenario: Add AWS Backup policies and restore drills. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Define RTO/RPO per workload, test restores, isolate backup delete rights, copy critical backups cross-account or cross-region, and tier retention.

Question 133Medium

AWS Architect reliability/cost scenario: Long retention increases storage cost. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Define RTO/RPO per workload, test restores, isolate backup delete rights, copy critical backups cross-account or cross-region, and tier retention.

Question 134Hard

AWS Architect incident: API latency spikes but backend Lambda duration is normal. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: API Gateway access logs, integration latency, authorizer logs, throttling metrics, and WAF logs. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Separate gateway latency from backend duration, add throttling/WAF/auth, cache safe responses, and log request IDs end to end.

Question 135Hard

AWS Architect architecture scenario: Design managed API ingress with throttling and auth. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Separate gateway latency from backend duration, add throttling/WAF/auth, cache safe responses, and log request IDs end to end.

Question 136Medium

AWS Architect security scenario: Authorizer misconfiguration allows unintended access. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Separate gateway latency from backend duration, add throttling/WAF/auth, cache safe responses, and log request IDs end to end.

Question 137Hard

AWS Architect release scenario: Move public APIs behind API Gateway. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Separate gateway latency from backend duration, add throttling/WAF/auth, cache safe responses, and log request IDs end to end.

Question 138Medium

AWS Architect reliability/cost scenario: Request charges grow due to abusive clients. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Separate gateway latency from backend duration, add throttling/WAF/auth, cache safe responses, and log request IDs end to end.

Question 139Hard

AWS Architect incident: Long-running connections drop during deployments. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: target health, deregistration delay, access logs, listener rules, and backend connection metrics. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use ALB for HTTP routing and NLB for TCP/static IP needs, tune draining and idle timeouts, and prevent clients from bypassing the load balancer.

Question 140Hard

AWS Architect architecture scenario: Choose ALB or NLB for mixed HTTP and TCP workloads. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use ALB for HTTP routing and NLB for TCP/static IP needs, tune draining and idle timeouts, and prevent clients from bypassing the load balancer.

Question 141Medium

AWS Architect security scenario: Security groups allow direct instance bypass. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use ALB for HTTP routing and NLB for TCP/static IP needs, tune draining and idle timeouts, and prevent clients from bypassing the load balancer.

Question 142Hard

AWS Architect release scenario: Change target groups and listener rules safely. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use ALB for HTTP routing and NLB for TCP/static IP needs, tune draining and idle timeouts, and prevent clients from bypassing the load balancer.

Question 143Medium

AWS Architect reliability/cost scenario: Load balancer hours and LCU costs are increasing. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use ALB for HTTP routing and NLB for TCP/static IP needs, tune draining and idle timeouts, and prevent clients from bypassing the load balancer.

Question 144Hard

AWS Architect incident: A rotated secret breaks applications using cached credentials. How do you investigate, recover service, and prevent the same failure?

#
Show answer

Start by proving scope and recent change: rotation Lambda logs, secret versions, application auth failures, and IAM access logs. Check logs, metrics, health checks, dependency errors, and config drift before changing anything. Recover with the smallest reversible action, then document the root cause. Prevention: Use staged labels correctly, make apps refresh secrets safely, avoid logging values, cache with TTL, and test rotation with rollback.

Question 145Hard

AWS Architect architecture scenario: Design safe secret rotation. What design would you choose, and what tradeoffs would you call out in an interview?

#
Show answer

Design for failure domains, rollback, observability, and least privilege first. Validate capacity, limits, network paths, and operational ownership. The practical answer is not one service or command; it is the architecture plus the runbook. For this scenario: Use staged labels correctly, make apps refresh secrets safely, avoid logging values, cache with TTL, and test rotation with rollback.

Question 146Medium

AWS Architect security scenario: Secrets are copied into environment variables and logs. How do you harden it without breaking production?

#
Show answer

Baseline current behavior, add guardrails in report-only or staged mode where possible, and test the highest-risk paths first. Roll out with logs, alerts, and a rollback plan. Use least privilege, explicit ownership, and automated checks. For this scenario: Use staged labels correctly, make apps refresh secrets safely, avoid logging values, cache with TTL, and test rotation with rollback.

Question 147Hard

AWS Architect release scenario: Move static secrets to Secrets Manager rotation. How do you ship the change safely?

#
Show answer

Separate build, deploy, validation, and cutover. Use canary or blue/green where possible, keep the old path available until health checks pass, and define rollback before starting. Watch saturation, errors, latency, and user-facing checks. For this scenario: Use staged labels correctly, make apps refresh secrets safely, avoid logging values, cache with TTL, and test rotation with rollback.

Question 148Medium

AWS Architect reliability/cost scenario: Secret version sprawl and API calls raise cost. What signals do you inspect and what changes do you make?

#
Show answer

Look at utilization, error rate, latency, queue depth, throttling, quota, retry volume, and recent deployment history. Optimize the bottleneck rather than guessing. Prefer rightsizing, caching, batching, and lifecycle policies before broad rewrites. For this scenario: Use staged labels correctly, make apps refresh secrets safely, avoid logging values, cache with TTL, and test rotation with rollback.

Question 149HardAWS multi-AZ resilience

An AWS Availability Zone becomes impaired while your API spans three AZs. How do you keep checkout available, recover safely and validate that your multi-AZ architecture actually tolerates the loss?

#

An ALB fronts EKS nodes spread across three AZs, with a regional RDS database and queues. The east-facing AZ loses capacity, 5xx rise and the remaining two AZs receive a surge of traffic. Leadership believes multi-AZ means automatic zero-impact failover.

Show answer

Triage: Declare incident scope, confirm which AZ resources are failing with ALB target health, load balancer request/error metrics, instance/node status, scheduler events and dependency metrics. Check whether healthy targets exist in surviving zones and whether they can absorb the load. Inspect subnet/IP capacity, cluster-autoscaler scale-up, quotas, NAT gateways, egress routing, zonal EBS volumes and zonal storage constraints. Verify RDS/Aurora high-availability posture and failover status rather than assuming the database is protected because the application is spread out.

Containment: Follow pretested AZ-impairment procedures. Steer traffic away from demonstrably unhealthy targets or shift workloads using supported load-balancer and cluster controls, while protecting surviving zones from overload with rate limits and reduced optional work. Confirm that any database failover has completed and client connections are recovering; avoid repeated forced failovers or simultaneous deployments. Watch checkout success, queue age, error rates and latency by AZ and customer region throughout recovery.

Prevention: Run controlled game days for one-AZ loss, including saturation of the surviving zones, zonal DNS/NAT dependency loss, slow node scale-up and database connection reconnection. Reserve tested headroom and spread replicas with topology constraints and PodDisruptionBudgets where appropriate. Define and test RTO/RPO separately from availability. Multi-AZ raises resilience, but does not guarantee every user sees zero errors or that data and capacity automatically fail over.

Trade-offs

Maintaining extra per-AZ headroom costs money; rapid failover can move overload to surviving zones if connection and capacity limits are not considered.

Common mistake

Assuming an ALB across three subnets makes every dependency regional, or draining an AZ without checking surviving-zone capacity.

Follow-up

All unhealthy targets drain successfully, but p99 grows and RDS connections hit their limit in the remaining AZs. How would you prioritize load shedding and recovery?

Assess the complete failure domain
  1. Confirm impairment and affected availability zone
  2. Inspect ALB targets and surviving service capacity
  3. Check zonal networking, compute and storage
  4. Validate database failover and client reconnection
  5. Verify user transactions and document RTO/RPO

Check your reasoning

  • Name two dependencies that remain AZ-scoped in an otherwise regional deployment.
  • Explain why health routing alone does not guarantee sufficient capacity.
  • Describe a non-destructive game-day test for surviving-zone saturation.
Question 150HardDatabase overload after recovery

An RDS PostgreSQL failover finishes, but your application immediately overloads the recovered primary. How do you diagnose the second outage, control reconnection traffic and prove durable recovery?

#

The database reports Available after failover. Within two minutes, API connections spike to thousands, p99 latency degrades and the primary becomes unresponsive again. Autoscaled application pods and background workers all reconnect simultaneously.

Show answer

Triage: Separate initial infrastructure recovery from the secondary client-driven overload. Record the failover timeline, RDS connections, CPU, memory, freeable memory, wait events, lock contention, storage latency, active transactions and max_connections. Compare application connection-pool sizes multiplied by replicas and workers, retry timing, stale DNS/pooled sessions, queue backlog, long queries and cache warmup. Identify whether the bottleneck is connection creation, database work, locks or a hot query; RDS status Available alone does not establish usable application capacity.

Containment: Temporarily cap request and worker concurrency, pause nonessential consumers, use bounded retries with backoff and jitter, shed excess traffic and let critical work proceed at a sustainable rate. Reset stale connections through controlled pool behavior; consider a correctly configured RDS Proxy to smooth connection management/failover when the service architecture permits it. Do not simply raise max_connections or autoscale every API pod: that can worsen memory pressure and amplify the reconnection storm. Resume queued work in controlled stages while monitoring successful writes and end-to-end latency.

Prevention: Capacity-test failover and warm restart behavior with realistic pool counts, queue depth and client timeouts. Establish total database connection budgets across services, circuit breakers, worker admission control, idempotent operations and tested failover DNS handling. Define a recovery criterion that includes stable customer transactions and backlog drainage at expected traffic, not merely a green RDS console status.

Trade-offs

Connection pooling and proxying can reduce connection storms, but an overloaded query workload still needs rate controls and query tuning. Aggressive queue draining may erase recovery capacity.

Common mistake

Restoring the primary and immediately allowing every application replica to retry or reconnect without a global budget.

Follow-up

The database has 1,000 permitted connections and 120 pods each allow a pool of 20. How would you set global and per-service connection budgets?

Prevent a secondary outage during restart
  1. Confirm primary failover and endpoint readiness
  2. Inspect connection spikes and DB wait events
  3. Bound API/worker admission and retry pressure
  4. Drain queues gradually at measured capacity
  5. Verify stable transactions and update failover runbook

Check your reasoning

  • Calculate how per-pod pool sizing can exceed database connection limits.
  • Explain why a proxy is not a substitute for fixing hot queries.
  • Describe how you would drain an accumulated work queue safely.
Question 151HardDistributed retries, load shedding & idempotency

A downstream payment service begins timing out, and automatic retries cause traffic to multiply until the whole system fails. How do you quantify the retry storm and stop it without losing important requests?

#

The web tier, API tier and a payment SDK each make three attempts per logical operation. The payment backend slows down and queue age climbs, while autoscaling appears to increase traffic instead of fixing the outage.

Show answer

Triage: Trace a logical transaction with one correlation and idempotency key across front end, API, SDK, queues and payment service. Count actual downstream attempts, active requests, retryable error codes, timeouts, queue age and request admission. If three layers each make three attempts, one original operation may trigger up to 27 payment attempts before other fan-out; verify the real retry policy and whether all requests can overlap. Separate transient errors from permanent validation failures and operations that already committed before the client timed out.

Containment: Stop uncontrolled retries at intermediate layers; choose an appropriate retry owner and cap its total attempts and elapsed-time budget. Apply timeouts, exponential backoff with jitter, circuit breaking and priority-aware load shedding to let the dependency recover. For asynchronous workflows, bound consumer concurrency and move poison or expired work to a dead-letter or reconciliation path. Use idempotency keys and server-side deduplication for financial mutations; never assume retry is safe just because the HTTP request returned a timeout. Preserve evidence for uncertain outcomes instead of creating duplicate payments.

Prevention: Load-test dependent-service latency and rate-limit responses, maintain retry attempt budget telemetry, bound queue age and install recovery-oriented admission limits. Size backoff and request deadlines for real SLOs, and test overload with a healthy rollback path. Evaluate cost per successful logical operation and downstream amplification, not just response errors at the API edge.

Trade-offs

Aggressive fail-fast/load shedding can increase visible error rates briefly but protect the dependency and reduce total recovery time. Too few retries may hurt transient-failure recovery; tune budgets using evidence.

Common mistake

Adding retries or scaling clients during a dependency outage without controlling duplicate side effects or total downstream request volume.

Follow-up

The payment API times out after charging a card. What contract must support a safe retry, and how does the client recover if the final result remains unknown?

From one request to an amplified outage
  1. Identify the logical transaction and each retry layer
  2. Measure attempts vs successful logical operations
  3. Bound retries and shed excess/expired load
  4. Enforce idempotency and uncertain-write reconciliation
  5. Drain backlog and verify sustained dependency recovery

Check your reasoning

  • Explain how three retry layers can generate 27 backend attempts.
  • Distinguish a safe GET retry from an uncertain payment mutation.
  • Name one metric that reveals retry amplification before the backend collapses.
Question 152MediumEKS identity

IRSA or EKS Pod Identity for a new cluster — which do you choose and why?

#

You are building three new EKS clusters. Each workload needs its own AWS permissions.

Show answer

Both give Pods short-lived AWS credentials tied to a Kubernetes service account. IRSA relies on each cluster's OIDC provider, and every role's trust policy must name that provider, which gets awkward across many clusters.

EKS Pod Identity uses an agent on the nodes and associations you create through the EKS API. Roles trust a single service principal, so one role can be reused across clusters, and session tags carry cluster and namespace details for finer policies. I would default to Pod Identity for new clusters and keep IRSA where Pod Identity's documented limitations apply, such as unsupported compute types.

Trade-offs

Pod Identity simplifies trust management but adds an agent DaemonSet you must keep healthy.

Common mistake

Granting permissions to the node role so every Pod on the node inherits them.

Follow-up

How would you migrate a running workload from IRSA to Pod Identity without downtime?

Question 153MediumStorage

Two workers overwrite the same S3 object. How can you make writes safe without adding a database?

#

Workers update a shared manifest JSON in S3. Occasionally one worker's update disappears.

Show answer

S3 supports conditional writes. If-None-Match: * makes a PUT succeed only if the object does not exist yet, which gives you create-once semantics. If-Match: <etag> makes it succeed only if the object is unchanged since you read it.

So each worker reads the object and its ETag, applies its change, and writes with If-Match. If another worker got there first, S3 returns 412 Precondition Failed and the worker re-reads and retries. Add jittered backoff and a retry limit so heavy contention does not turn into a storm.

Trade-offs

Optimistic concurrency is simple and cheap at low contention; at high contention a queue or a real database is a better fit.

Common mistake

Using a timestamp check in application code, which still races between read and write.

Follow-up

How would you redesign the manifest so workers rarely touch the same object?

Question 154MediumEKS

What does EKS Auto Mode take off your plate, and when would you not use it?

#

A small platform team spends most of its time on node groups, Karpenter upgrades and add-on versions.

Show answer

EKS Auto Mode lets AWS run the parts of the data plane most teams assemble themselves: provisioning and scaling nodes based on Pod demand, node operating system updates and replacement, and core capabilities such as load balancing, block storage and Pod networking. You still own workloads, IAM, network design, Pod security and costs.

It suits teams that want Kubernetes without operating nodes. Skip it, or use it selectively, when you need custom AMIs or kernel settings, node-level agents it does not allow, or full control of node lifecycle. Compare its per-instance management charge with the engineering time it saves.

Trade-offs

Less node operations work in exchange for less control over how nodes are built and changed.

Common mistake

Assuming Auto Mode also manages application resilience, such as PodDisruptionBudgets and topology spread.

Follow-up

How would you migrate an existing cluster's workloads from managed node groups to Auto Mode?

Question 155HardAI on AWS

What do you put in place before running an Amazon Bedrock feature in production?

#

A support assistant on Bedrock works in testing. Launch is in two weeks.

Show answer

Safety: apply Bedrock Guardrails for content filters, denied topics and sensitive-information redaction, and test them on your own examples. Capacity: check per-model, per-Region quotas for requests and tokens, request increases early, consider cross-Region inference profiles to spread load, and handle throttling with backoff. Use provisioned throughput only if you need guaranteed capacity.

Visibility: turn on model invocation logging to CloudWatch or S3 with redaction, and track tokens and cost per feature. Access: limit which models each role may invoke with IAM, and reach Bedrock over VPC endpoints from private workloads.

Trade-offs

Guardrails and logging add latency and cost, but without them you cannot see or control what the model returns.

Common mistake

Discovering token-per-minute quotas on launch day.

Follow-up

How would you alert on a guardrail suddenly blocking far more responses than usual?

Question 156HardOrganizations & IAM

Teams keep sharing S3 buckets and KMS keys with outside accounts through resource policies. How would you use resource control policies to stop that centrally?

#

An audit finds bucket policies granting access to vendor accounts that nobody approved. SCPs are already in place, but they did not stop it.

Show answer

SCPs set the maximum permissions for IAM principals inside your organization's member accounts. They do nothing when an outside account's principal calls your bucket, because that principal is not yours. Resource control policies (RCPs) cover the other side: they set the maximum permissions on resources in your member accounts, whoever is calling. Neither grants anything; both are guardrails intersected with identity and resource policies.

The usual pattern is a data perimeter RCP: deny access to supported resources (S3, KMS, SQS, Secrets Manager, STS and more on the supported list) unless the caller belongs to your organization, with explicit exceptions for approved partners and for AWS services acting on your behalf. Because an RCP applies even when a bucket policy says otherwise, a team can no longer open data to the world by editing one policy.

Know the limits. RCPs do not apply to resources in the management account, do not restrict service-linked roles, and do not apply to AWS managed KMS keys. Roll out carefully: AWS strongly recommends testing on individual accounts, then lower OUs, using CloudTrail Access Denied events to find breakage, before attaching anything at the root.

Trade-offs

A central perimeter stops whole classes of data exposure, but every legitimate external integration becomes an exception you must document and maintain.

Common mistake

Attaching a new RCP at the organization root on day one and breaking partner integrations and service access across every account.

Follow-up

How would you combine an RCP with VPC endpoint policies so data can be reached only from your networks?

RCP sketch: only principals from your org may use S3 · json
{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "EnforceOrgIdentities",
    "Effect": "Deny",
    "Principal": "*",
    "Action": "s3:*",
    "Resource": "*",
    "Condition": {
      "StringNotEqualsIfExists": { "aws:PrincipalOrgID": "o-exampleorgid" },
      "BoolIfExists": { "aws:PrincipalIsAWSService": "false" }
    }
  }]
}
Question 157MediumEC2 security

After enforcing IMDSv2, containers on EC2 hosts can no longer get credentials, but the host itself can. What is wrong?

#

Security set HttpTokens to required across the fleet. Pods on self-managed Kubernetes nodes and Docker containers on build hosts now fail to fetch instance role credentials.

Show answer

IMDSv2 requires a session token obtained with a PUT request, and the response to that PUT is limited by a hop count. On many instances the default hop limit is 1: the docs say it defaults to 2 only if the AMI declares ImdsSupport: v2.0, otherwise 1. A container on a bridged network is one extra network hop away, so its token response never arrives and its SDK falls back or fails.

AWS recommends a hop limit of 2 in container environments where IMDSv2 is required. You can change it on running instances with modify-instance-metadata-options, and set it in launch templates for new ones.

But ask whether containers should use the instance role at all. Any container that reaches IMDS gets the node's permissions. On Kubernetes, prefer per-workload identity (IRSA or EKS Pod Identity) and keep the hop limit at 1 so pods cannot borrow the node role. Before requiring IMDSv2 anywhere, check the MetadataNoToken CloudWatch metric, which counts IMDSv1 calls, so you know who will break.

Trade-offs

Hop limit 2 makes containers work with IMDSv2 but lets every container use the node role; hop limit 1 blocks that, but only works if workloads have their own identity.

Common mistake

Raising the hop limit fleet-wide to fix one build host, and silently giving every pod on every node the node's IAM permissions.

Follow-up

How would you prove that no pod in an EKS cluster can still reach the node role?

Require IMDSv2 and allow one extra hop for containers · shell
aws ec2 modify-instance-metadata-options \
  --instance-id i-1234567890abcdef0 \
  --http-tokens required \
  --http-put-response-hop-limit 2 \
  --http-endpoint enabled
Question 158MediumEKS

How would you move an EKS cluster from the aws-auth ConfigMap to access entries, and what is the one-way step?

#

Cluster access is defined in a hand-edited aws-auth ConfigMap. A bad edit last quarter locked every engineer out for an hour.

Show answer

Access entries move cluster access out of a Kubernetes ConfigMap and into the EKS API. You create an entry for an IAM principal and associate access policies such as AmazonEKSClusterAdminPolicy, or map it to Kubernetes groups for your own RBAC. Because it is an AWS API, you manage it with IAM permissions, Terraform or CloudFormation, and CloudTrail records every change. A typo in YAML can no longer lock everyone out.

The cluster's authentication mode controls which sources are read. Migrate in stages: switch to API_AND_CONFIG_MAP so both work, create access entries for every principal in aws-auth, test each role, and only then switch to API. The docs are clear that the switch is one way: you cannot change back to a mode that removes the EKS API and access entries. Going from API_AND_CONFIG_MAP to API is also final for the ConfigMap path.

Keep a break-glass role with an admin access entry that lives outside normal pipelines, so a broken deploy cannot remove the last admin.

Trade-offs

Access entries are auditable and IaC friendly, but they add IAM-side management and the mode change cannot be rolled back.

Common mistake

Switching straight to API mode before every principal in aws-auth has an access entry.

Follow-up

How would you give a team admin rights in only its own namespaces with access entries?

Create an access entry and grant cluster admin · shell
aws eks create-access-entry --cluster-name prod \
  --principal-arn arn:aws:iam::111122223333:role/platform-admin
aws eks associate-access-policy --cluster-name prod \
  --principal-arn arn:aws:iam::111122223333:role/platform-admin \
  --policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy \
  --access-scope type=cluster
Question 159MediumEKS

The EKS bill for control planes jumped sixfold on some clusters. What happened, and what policy would you set?

#

Forty clusters were left on an old Kubernetes version during a busy year. Nobody changed node counts, yet the EKS line item rose sharply.

Show answer

Each Kubernetes version gets 14 months of standard support on EKS after release, then 12 months of extended support. Standard support costs $0.10 per cluster per hour; extended support costs $0.60 per cluster per hour (the standard price plus $0.50). Extended support is on by default, so clusters that miss upgrades move to the higher price automatically. That is the sixfold jump.

You can set a cluster's upgrade policy to supportType=STANDARD, which disables extended support, but the docs warn you cannot disable it once the cluster has already entered it. With extended support disabled, the docs say the cluster is automatically upgraded to the next Kubernetes version at the end of standard support, which forces the decision instead of paying for delay.

The policy I would set: treat extended support as a paid exception with an owner and an end date, not a default. Track each cluster's version and end-of-standard-support date, budget two upgrades a year, and test upgrades on a staging cluster with real add-ons. Paying for extended support is reasonable for a short window around a risky migration; paying for it by accident is not.

Trade-offs

Extended support buys time for hard upgrades, but at six times the control-plane price; standard-only forces upgrades on EKS's schedule.

Common mistake

Treating the control-plane fee as fixed and not tracking version support dates per cluster.

Follow-up

How would you report, per team, which clusters will enter extended support in the next quarter?

Keep a cluster on standard support only · shell
aws eks update-cluster-config --name prod-eu \
  --upgrade-policy supportType=STANDARD
Question 160MediumServerless

An SQS-triggered Lambda processes some messages twice, even though it never fails. Why?

#

The function timeout was raised to 5 minutes for a slow downstream API. The queue visibility timeout stayed at its old value of 60 seconds. Duplicate orders appear under load.

Show answer

When Lambda polls a batch, the messages are hidden for the queue's visibility timeout. If processing, including any retry inside Lambda, takes longer than that, the messages become visible again and another poller picks them up while the first invocation is still working. The work is done twice even though nothing failed.

AWS guidance is to set the source queue's visibility timeout to at least six times the function timeout, plus the maximum batching window if you use one. With a 5-minute function timeout, that means at least 30 minutes. The margin covers Lambda's own retries when the function is throttled or errors.

Fix the configuration, but also make the handler idempotent, because SQS standard queues deliver at least once anyway. Use a deduplication key (order ID) with a conditional write, and report partial batch failures so one bad message does not make the whole batch reappear.

Trade-offs

A long visibility timeout prevents duplicates but delays the retry of a message whose invocation really crashed.

Common mistake

Raising the function timeout without touching the queue, and then debugging the duplicates as an application bug.

Follow-up

How would you choose maxReceiveCount for the dead-letter queue given these timeouts?

Question 161HardDynamoDB

Writes to a DynamoDB table are throttled, but the table itself has plenty of write capacity. Where do you look?

#

A provisioned-capacity orders table shows throttled writes after a feature added a new GSI on status. Table-level consumed capacity is well under its limit.

Show answer

Each write to the base table is also propagated to every global secondary index that projects the item. If a GSI does not have enough write capacity, DynamoDB throttles writes to the table itself. The docs say this directly: heavy write activity on a table with an under-provisioned GSI gets throttled. So the table looks healthy while the index is the bottleneck.

Check the throttling and consumed write capacity metrics per index, not just for the table. Two causes are common. The GSI's provisioned write capacity was copied from a small default and never scaled with the table. Or the index key is low-cardinality, such as status with three values, so almost all writes land on one hot index partition no matter how much capacity you add.

Fixes: give each GSI write capacity and autoscaling matched to the table's write rate, project only the attributes the query needs (smaller index writes), and redesign low-cardinality keys, for example by adding a shard suffix to the status key and querying the shards in parallel. Sparse indexes, where only items with the attribute are indexed, also cut write volume.

Trade-offs

Extra GSIs make reads flexible but multiply write cost and add new places to be throttled.

Common mistake

Raising the table's write capacity, which changes nothing while the index is the bottleneck.

Follow-up

How would you query all orders with status PENDING if you shard the index key ten ways?

Question 162HardDynamoDB

A payments ledger must survive a Region outage with no lost or conflicting writes. Would you use DynamoDB global tables with multi-Region strong consistency?

#

The current design uses an eventually consistent global table. During a failover test, two Regions accepted conflicting balance updates and last-writer-wins dropped one.

Show answer

Default global tables replicate asynchronously and resolve conflicts with last writer wins. That is fine for many workloads but not for a balance, where a dropped write is lost money.

Multi-Region strong consistency (MRSC), generally available since June 2025, makes writes and strongly consistent reads agree across Regions, so a read in any Region sees the latest write, and the table can keep serving if one Region fails. It has hard constraints: an MRSC table must be deployed in exactly three Regions, either three replicas or two replicas plus a witness. It does not support transactions, TTL or local secondary indexes, you cannot add replicas to an existing MRSC table, and a table must be empty to convert.

So it fits a ledger only if you can model updates without DynamoDB transactions, for example single-item conditional writes per account, and accept higher write latency because each write coordinates across Regions. If the ledger needs multi-item transactions, keep a single write Region with fast failover, or use a database designed for that.

Trade-offs

MRSC removes conflicting writes and lost updates but costs write latency and rules out transactions, TTL and LSIs.

Common mistake

Assuming any global table is safe for money because it is multi-Region, when the default mode can drop conflicting writes.

Follow-up

How would you model a transfer between two accounts without a multi-item transaction?

Question 163MediumDatabases

Can you cut the cost of forty idle dev databases with Aurora Serverless v2 scale to zero, and what will surprise the developers?

#

Each team has an always-on dev Aurora cluster that is busy only during working hours.

Show answer

Since November 2024, Aurora Serverless v2 can scale to 0 ACUs and pause automatically after a period with no connections, so idle clusters stop paying for compute (storage is still billed). It needs Aurora PostgreSQL 13.15+, 14.12+, 15.7+ or 16.3+, or Aurora MySQL 3.08+.

The surprises are on resume. The docs give a typical resume time of about 15 seconds, and 30 seconds or longer if the cluster has been paused for more than 24 hours. The first query of the morning will look like an outage to a tool with a short connection timeout. And anything that holds a connection open, such as a connection pool, a monitoring agent or a scheduled job, keeps the cluster awake. An associated RDS Proxy prevents auto-pause entirely.

So: use it for dev and test clusters, raise client connection timeouts and add retries on connect, remove keep-alive monitors from those clusters, and set a minimum above zero for anything with a latency SLO.

Trade-offs

Scaling to zero saves compute cost on idle clusters but adds cold-start delay and needs connection discipline.

Common mistake

Enabling it on a cluster behind RDS Proxy or a chatty connection pool and wondering why the bill did not change.

Follow-up

How would you measure how many hours per day each dev cluster actually paused?

Question 164HardDatabases

You put RDS Proxy in front of PostgreSQL to stop Lambda connection storms, but database connections still spike. What is pinning, and how do you fix it?

#

A thousand concurrent Lambda invocations connect through RDS Proxy. The proxy dashboard shows high pinned connections, and the database is again near max_connections.

Show answer

RDS Proxy saves connections by multiplexing: after each transaction it can reuse the same database connection for another client. When a client does something that ties state to the session, the proxy pins that client to its connection until the session ends, and nobody else can reuse it. Pinning reduces connection reuse, so with heavy pinning the proxy behaves like a pass-through.

Causes depend on the engine. For PostgreSQL, the docs list any SET command, PREPARE and EXECUTE, temporary tables, cursors and session advisory locks. For MySQL, prepared statements, setting variables, temporary tables and LOCK TABLES, among others. Any statement over 16 KB pins on every engine. Many drivers and ORMs issue SET or server-side prepared statements on connect without you noticing.

Fix it at the client: move session settings into the database or role defaults, turn off server-side prepared statements in the driver, avoid temporary tables in hot paths, and check the proxy's pinning metrics and logs after each change. Also keep the Lambda's own connection reused across invocations instead of opening one per request.

Trade-offs

Turning off server-side prepared statements restores multiplexing but can cost some query planning efficiency.

Common mistake

Raising max_connections on the database instead of finding what pins sessions at the proxy.

Follow-up

How would you find which driver setting is issuing the SET that pins your sessions?

Question 165MediumCost

A new line item for public IPv4 addresses appears across all accounts. How do you find and cut it?

#

Hundreds of EC2 instances in "public" subnets have auto-assigned public IPs, and dozens of Elastic IPs sit unattached from old projects.

Show answer

Since February 1, 2024, AWS charges $0.005 per hour for every public IPv4 address, whether it is attached to a resource or idle. That covers EC2 instances, RDS, EKS nodes and other services that can hold a public IPv4. At that rate each address costs roughly $3.60 a month, so a few thousand forgotten addresses add up.

Find them first. Public IP Insights in IPAM and the cost and usage data show which accounts and resources hold addresses. Then cut in order of risk. Release unattached Elastic IPs. Turn off public IP auto-assignment on subnets where instances do not need inbound internet traffic. Move instances behind a load balancer and into private subnets, using a NAT gateway or VPC endpoints for outbound traffic. For new workloads, consider dual-stack or IPv6 where clients support it.

Check the trade before moving everything behind NAT: NAT gateways have their own hourly and per-GB charges, so for small, chatty fleets the cheapest option is usually VPC endpoints for AWS services plus removing addresses nobody uses.

Trade-offs

Private subnets cut address cost and attack surface, but outbound paths through NAT have their own cost and can become a bottleneck.

Common mistake

Replacing every public IP with NAT without comparing NAT data processing cost to the address cost saved.

Follow-up

How would you stop new subnets from auto-assigning public IPs across the organization?

Question 166MediumNetworking

Your ALB is internet-facing only so CloudFront can reach it, and attackers bypass CloudFront by hitting the ALB directly. What would you change?

#

WAF rules run at CloudFront. A scanner found the ALB DNS name and now sends traffic straight to it, skipping WAF and caching.

Show answer

The old fixes were a secret custom header checked by the ALB, or a security group limited to CloudFront's managed prefix list. Both work, but the ALB is still on the internet, and a leaked header or misconfigured rule reopens the bypass.

CloudFront VPC origins, launched in November 2024, let CloudFront deliver from Application Load Balancers, Network Load Balancers or EC2 instances in private subnets. The origin has no public address, so there is nothing to bypass: the only way in is through CloudFront, and therefore through your WAF rules. AWS states there is no additional cost for using VPC origins.

Migration: create an internal ALB alongside the public one, add it as a VPC origin, shift the CloudFront behaviour, test, then delete the public ALB and its public IPv4 addresses (which also saves the per-address charge). Keep origin TLS and health checks as before.

Trade-offs

Private origins remove the bypass path entirely, but every client must now come through CloudFront, including internal tools that used the ALB directly.

Common mistake

Relying only on a secret header for origin protection and leaving it in logs, code samples or browser-visible traffic.

Follow-up

How would you give internal services access to the same backend without going through CloudFront?

Question 167HardStorage

How would you protect backups in S3 from an attacker who has stolen admin credentials in the same account?

#

A ransomware playbook includes deleting backups first. Your backup bucket has versioning and MFA delete is not set up.

Show answer

Versioning alone is not enough: an admin can delete versions or the lifecycle rules that keep them. S3 Object Lock adds write-once-read-many retention. It works only in buckets with versioning enabled, and it has two modes.

In governance mode, users cannot delete or shorten retention unless they have special permission (s3:BypassGovernanceRetention). That protects against mistakes, but a stolen admin role usually has that permission. In compliance mode, no user can overwrite or delete a protected version during the retention period, including the account root user. That is the control that survives full account compromise. Legal holds add retention with no end date until someone removes them.

Use compliance mode for the backups that must survive an attack, with a retention period that matches your recovery needs, and put the bucket in a separate backup account with tight access. Test restores regularly. Be deliberate, because compliance mode cannot be undone: data you lock for a year, you store and pay for a year.

Trade-offs

Compliance mode gives real protection against insiders and stolen root, but mistakes in retention length cannot be fixed and the storage cost is locked in.

Common mistake

Using governance mode and assuming it stops an attacker who has admin permissions.

Follow-up

How would you size the retention period against how long an attacker might sit in the account before acting?

Question 168MediumOrganizations & IAM

A SaaS vendor asks you to create a cross-account role that trusts their AWS account. What must the trust policy include, and why?

#

The vendor monitors many customers from one AWS account. Your draft trust policy trusts the vendor account ID and nothing else.

Show answer

If the trust policy trusts only the vendor's account, any of the vendor's customers who learns your role ARN could configure it in their own vendor settings, and the vendor's system would happily assume your role on their behalf. That is the confused deputy problem: a trusted party is tricked into using its access for someone else.

The fix for third-party roles is an external ID. The vendor generates a unique ID per customer, you add a condition on sts:ExternalId in the trust policy, and the vendor passes that ID when it assumes the role. Another customer cannot supply your ID, so the vendor cannot be steered into your account. The IAM docs describe this as the main purpose of the external ID.

The same idea applies when an AWS service, rather than a vendor, acts for you: in resource policies that grant a service principal access, add aws:SourceArn or aws:SourceAccount (or the org variants) so only your resources can trigger the service against your data. Keep the vendor role narrowly scoped, and review its CloudTrail activity.

Trade-offs

External IDs are simple and effective but are not secrets; they protect against confused deputies, not against a compromised vendor.

Common mistake

Choosing the external ID yourself and reusing it across vendors, or letting the vendor use a value shared by all customers.

Follow-up

How would you detect a vendor role being used outside its expected actions?

Trust policy for a third-party role with an external ID · json
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Principal": { "AWS": "arn:aws:iam::999988887777:root" },
    "Action": "sts:AssumeRole",
    "Condition": { "StringEquals": { "sts:ExternalId": "customer-4f2a9c" } }
  }]
}
Question 169MediumContainers

ECS now has built-in blue/green deployments. How would you use them for a payment API, and what would you still build yourself?

#

The team does rolling ECS deployments today. Two bad releases last quarter reached all tasks before anyone noticed rising errors.

Show answer

Since July 2025, Amazon ECS has a built-in blue/green deployment strategy, so you no longer need a separate deployment service to run one. ECS starts the new (green) revision alongside the old one, shifts production traffic to it, and keeps the blue revision around for a bake time so you can roll back quickly. Deployment lifecycle hooks let you run your own checks at stages of the deployment, for example a smoke test before traffic shifts.

For a payment API I would run a lifecycle hook that calls synthetic checks against green before any customer traffic reaches it, shift traffic, and keep a bake time long enough to see real error and latency signals, often 10 to 30 minutes depending on traffic. Tie rollback to CloudWatch alarms on error rate and latency so it does not depend on a human watching.

What you still own: the health signals, the alarm thresholds, database changes that must work for both blue and green at once, and the extra capacity cost of running two full revisions during each deployment.

Trade-offs

Blue/green gives fast rollback and a clean test stage, but doubles capacity during deploys and needs backward-compatible data changes.

Common mistake

Using blue/green with a schema migration that breaks the old revision, so rollback has nothing safe to roll back to.

Follow-up

How would you handle a database migration that blue and green must both tolerate?

Question 170EasyStorage

An old upload tool fails on a newly created S3 bucket but works on old ones. What changed?

#

The tool sets an object ACL such as public-read on every upload. A Terraform module created a new bucket last week with default settings.

Show answer

Since April 2023, new S3 buckets are created with S3 Block Public Access turned on and ACLs disabled. Object Ownership defaults to Bucket owner enforced, which means the bucket owner owns every object and ACLs no longer affect access. A tool that sends a public-read ACL on upload is now asking for something the bucket does not allow.

Do not fix this by re-enabling ACLs and turning off Block Public Access. Remove the ACL from the upload call, grant access through the bucket policy or IAM, and if the objects must be public, serve them through CloudFront with origin access control instead of making the bucket public. For cross-account writers, Bucket owner enforced is actually a gift: you no longer need the writer to set bucket-owner-full-control for you to read their objects.

Trade-offs

Keeping ACLs disabled simplifies access to one policy model, at the cost of updating legacy tools that still send ACLs.

Common mistake

Switching the bucket back to ACLs enabled to make the old tool work.

Follow-up

How would you find existing buckets that still have ACLs enabled and migrate them?

Question 171MediumAPI

A report endpoint behind API Gateway times out at 29 seconds. Would you raise the timeout?

#

A REST API calls a Lambda that builds a PDF report. Large reports take 40 to 90 seconds, and clients get gateway timeouts.

Show answer

Since June 2024, you can raise the integration timeout above 29 seconds for Regional and private REST APIs. AWS notes that this might require a reduction in your account-level throttle quota, so a longer timeout can cost you request capacity across the account.

Raising it is reasonable for a modest overrun on an internal API. But a 90-second synchronous request has other problems: clients, proxies and mobile networks often time out sooner, a retry repeats the whole job, and every waiting request holds a connection.

For work like report generation, I would make it asynchronous. Accept the request, put a job on a queue or start a Step Functions execution, return 202 with a job ID, and let the client poll a status endpoint or receive a webhook, with the finished file served from S3 through a presigned URL. Use an idempotency key so client retries do not start duplicate jobs.

Trade-offs

A longer timeout is a one-line change but holds connections and may cut throttle quota; asynchronous jobs need more design but scale and retry cleanly.

Common mistake

Raising the timeout and stopping there, while clients and proxies still time out at 30 or 60 seconds.

Follow-up

How would you design the status endpoint so polling clients do not overload it?

Question 172MediumCost

A lifecycle rule to move logs to a colder storage class saved far less than expected. Why?

#

A bucket holds two billion log objects, most of them a few KB. A rule transitions objects older than 30 days to a cheaper class.

Show answer

Two things work against small objects. First, by default S3 Lifecycle no longer transitions objects smaller than 128 KB to any storage class; that has been the default since September 2024 (older configurations keep their previous behaviour until you edit them). Most of these logs simply never moved. Second, each transition is charged as a request per object, so moving billions of tiny objects can cost more in transition requests than it saves in storage.

The fix is upstream: batch small logs into larger objects before they land in S3, for example with a delivery stream or a periodic compaction job that writes compressed files of tens of MB. Large objects transition cheaply and also make queries and restores faster. For existing data, compare the storage saving per object with the per-object transition charge before transitioning, and consider simply expiring logs you do not need.

Also check the colder classes' minimum storage duration and retrieval charges, which can erase savings for data that is read again soon.

Trade-offs

Compacting objects saves storage, transition and request cost, but adds a pipeline step and delays when individual records are queryable.

Common mistake

Writing one object per log event and trying to fix the cost later with lifecycle rules.

Follow-up

How would you calculate the break-even object size for a transition?

Question 173MediumCost

Your databases run on large gp2 volumes sized for IOPS, not capacity. How would you move to gp3, and what do you watch?

#

Several 2 TB gp2 volumes hold 300 GB of data each. They were made large years ago because gp2 performance grows with volume size.

Show answer

On gp2, baseline performance is tied to volume size, which is why teams over-provision capacity to get IOPS. gp3 decouples them: every gp3 volume includes a baseline of 3,000 IOPS and 125 MiB/s regardless of size, and you can provision more IOPS and throughput separately. AWS prices gp3 up to 20 percent lower per GiB than gp2.

Steps: measure what each volume really uses (peak IOPS and throughput from CloudWatch over a busy period, not an average). Modify the volume type in place to gp3 with IOPS and throughput set to cover those peaks plus headroom; Elastic Volumes changes the type without detaching. Watch latency and queue length during and after the change. Shrinking capacity is a separate, harder step, because EBS volumes cannot be made smaller in place: you migrate the data to a new, smaller volume.

The common win is two-fold: the type change alone is cheaper per GiB, and once performance no longer depends on size, the next storage migration can right-size capacity too.

Trade-offs

gp3 is cheaper and more predictable, but you now have to choose IOPS and throughput explicitly instead of getting them from size.

Common mistake

Converting to gp3 at the 3,000 IOPS baseline when the old 2 TB gp2 volume was delivering much more, and slowing the database.

Follow-up

How would you roll this out across hundreds of volumes safely?

Question 174MediumServerless

A Lambda that writes processed files back to its source bucket ran up a huge bill overnight. What happened, and what protects you?

#

The function triggers on object creation in a bucket, resizes the image and writes the result into the same bucket under another prefix. The event filter was later broadened.

Show answer

Each write created a new object event, which invoked the function again, which wrote another object: an infinite loop. Loops like this between Lambda and services such as S3, SQS and SNS can run for hours and generate large bills.

Lambda has recursive loop detection. It detects loops between your functions and Amazon SQS, Amazon S3, Amazon SNS and EventBridge custom event buses, and stops the chain after about 16 invocations in the same chain of requests. It needs a recent enough AWS SDK in the function to carry the tracking context, and it does not cover every service; loops through DynamoDB, for example, are not detected. So treat it as a safety net, not the design.

The design fix is to make loops impossible: write output to a different bucket, or scope the trigger to an input prefix and write to a different output prefix the filter cannot match. Add reserved concurrency as a cost ceiling, and an AWS Budgets alert on the account so a runaway shows up in hours, not at month end.

Trade-offs

Separate buckets make loops impossible but add resources and policies; prefix filters are simpler but can be broken by a later filter change.

Common mistake

Relying on loop detection alone and broadening the event filter without checking whether it now matches the function's own output.

Follow-up

How would you test event filters in CI so a broadened pattern is caught before deploy?

Question 175HardIAM

How does AWS evaluate permissions when an explicit deny, an allow and an SCP all apply?

#

An IAM policy allows s3:GetObject, an SCP in the account allows it too, but a permission boundary does not. The principal also has a Deny for the same action from another attached policy.

Show answer

Start from implicit deny: a request succeeds only if some policy grants it. Identity-based and resource-based policies grant access; in the same account an allow from either is enough, while cross-account access needs an allow in both accounts.

SCPs, permission boundaries and session policies do not grant anything. They cap the maximum permission: the effective allow must survive every applicable guardrail. So an allow in the identity policy plus an SCP allow still fails if the boundary omits the action. An explicit Deny anywhere in the chain is final and overrides every allow, including a resource-based direct grant. SCPs apply to member accounts (including their root users), but not to the management account or service-linked roles.

Trade-offs

Resource-based policies can grant cross-account access directly, but identity-side guardrails in the calling account still apply.

Common mistake

Assuming an SCP or boundary grants access, or that an explicit deny is merely one vote among allows.

Follow-up

Why does the same identity policy need a resource-policy allow as well when the bucket is in another account?

Question 176HardDynamoDB

What is DynamoDB partition key design and why does it matter?

#

A table keyed by status throttles writes even though its on-demand capacity alarm is nowhere near the table limit.

Show answer

DynamoDB hashes the partition key to choose a physical partition. Every item with the same key value lives in the same partition, and a composite sort key orders items inside it. A key like status has only a few values, so almost all writes land on a handful of partitions; well-distributed, high-cardinality keys spread the load.

Each partition is designed for 3,000 read units or 1,000 write units per second, and item size counts toward that budget: a 20 KB item costs five read units on a consistent read. Adaptive capacity can split busy partitions in both provisioned and on-demand mode, but it cannot split one hot key, and on-demand mode does not remove hot-partition throttling. With a local secondary index the whole item collection stays in one partition and is capped at 10 GB.

Trade-offs

A random suffix spreads writes but makes ordered range queries harder; a time-based key is easy to query but concentrates current traffic.

Common mistake

Treating on-demand capacity as a fix for a low-cardinality partition key.

Follow-up

How would you spread writes for a tenant that is genuinely one very active key?

Question 177MediumLambda

How do Lambda triggers differ: synchronous, asynchronous and event source mappings?

#

The same function is called by API Gateway, by an S3 event notification and by an SQS queue. Each one seems to retry failures differently.

Show answer

A synchronous invoke (API Gateway, direct SDK calls) waits for the result. Lambda does not retry a function error in this mode; the caller sees the error and decides what to do.

An asynchronous invoke (S3, SNS, EventBridge) returns immediately after Lambda accepts the event. Lambda retries function errors twice by default, roughly one minute then two minutes apart; throttles and system errors are retried for up to six hours. You can set retry attempts from 0 to 2, cap event age, and route discarded events to a DLQ or on-failure destination.

An event source mapping is a Lambda-owned poller for streams and queues. It batches records (limited by batch size, batching window and a 6 MB payload) and delivers at least once, so duplicates are possible. On error the whole batch is reprocessed and the affected shard is paused until the batch succeeds or expires.

Trade-offs

Async retries buy resilience but can duplicate side effects; make handlers idempotent rather than relying on exactly-once delivery.

Common mistake

Assuming the same retry policy applies to all three invocation paths.

Follow-up

Why does an SQS event source mapping need partial batch response handling?

Question 178HardNetworking

VPC Flow Logs show REJECT entries. How do you tell whether it is a security group or a network ACL?

#

Flow logs show an accepted inbound request followed by a rejected outbound reply on an ephemeral port. The instance security group allows the traffic.

Show answer

Flow logs record the 5-tuple, protocol, packets, bytes, action (ACCEPT or REJECT) and a log status, but not the rule or layer that decided it. You infer the layer from the traffic pattern and the configuration.

Security groups are stateful, attach to ENIs, contain only allow rules and automatically permit return traffic. NACLs are stateless, attach to subnets, support allow and deny rules, and are evaluated in ascending rule number with an implicit deny at the end. A rejected reply on an ephemeral port after an accepted request is the classic stateless-NACL signature: the outbound return rule is missing. Check both directions of the relevant NACL, the ephemeral range (often 32768–61000 on Linux, 1024–65535 for AWS-managed services), then the security groups and route tables.

Flow logs are not real time by default (a 10-minute aggregation window) and do not show Amazon DNS traffic.

Trade-offs

A broad 1024-65535 return rule fixes symptoms but weakens the subnet boundary; prefer the actual ephemeral range.

Common mistake

Reading REJECT as proof that the security group denied the packet.

Follow-up

Why can a NACL not block Route 53 Resolver DNS traffic?