Skip to main content
Cloud, DevOps & Systems

Amazon Web Services (AWS) Interview Questions

All Levels (Junior to Staff)16 Questions

Amazon Web Services cloud architecture: VPC subnetting, IAM least-privilege security, DynamoDB single-table design, S3 consistency, and Well-Architected Framework.

25 min study timeIncludes Production Code & Pitfall TrapsActive Recall Practice Mode Available

Practice Amazon Web Services (AWS) Interview Questions

Showing 16 of 16 technical questions with engineering explanations

Filter Level:
Question #1FundamentalJunior

How do AWS Regions, Availability Zones, and Edge Locations differ in fault isolation and latency?

Senior Engineering Answer

An AWS Region is a physically isolated geographic area (such as us-east-1) containing at least three Availability Zones (AZs). Each AZ consists of one or more discrete data centers with independent power, cooling, and networking connected via ultra-low-latency (<2 ms) redundant fiber, enabling synchronous or multi-AZ failover. Edge Locations are globally distributed POPs used by CloudFront and Route 53 to cache static/dynamic content and terminate TLS close to end users.

Common Interview Trap / Anti-Pattern:

Assuming AZ names like us-east-1a map to the same physical facility across different AWS accounts; AWS randomizes AZ letters per account, so cross-account architectures must compare AZ IDs (such as use1-az2).

Question #2FundamentalJunior

What is the difference between IAM Users, IAM Roles, and EC2 Instance Profiles?

Senior Engineering Answer

An IAM User is a permanent identity backed by long-term passwords or static access keys. An IAM Role has no long-term credentials; trusted principals assume it via AWS STS (AssumeRole) to receive short-lived, automatically rotated temporary credentials. An EC2 Instance Profile is a wrapper object that attaches a single IAM Role to an EC2 instance so applications retrieve temporary credentials transparently via IMDSv2.

Production Code Example
# Fetch temporary role credentials securely via IMDSv2 token
TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/iam/security-credentials/
Common Interview Trap / Anti-Pattern:

Leaving IMDSv1 enabled exposes applications vulnerable to Server-Side Request Forgery (SSRF) because a single unauthenticated GET request to 169.254.169.254 returns IAM credentials.

Question #3FundamentalJunior

How do Security Groups and Network ACLs (NACLs) differ inside an Amazon VPC?

Senior Engineering Answer

Security Groups operate as stateful virtual firewalls attached to ENIs (network interfaces): if an inbound rule permits a request, the return outbound traffic is automatically allowed regardless of outbound rules, and they support only Allow rules (with an implicit deny). NACLs operate at the subnet boundary, are stateless (requiring explicit rules for both inbound requests and ephemeral return ports 1024-65535), and process numbered Allow and Deny rules sequentially.

Common Interview Trap / Anti-Pattern:

Forgetting to allow ephemeral return ports (1024-65535) in a custom NACL breaks outbound API calls and SSH/HTTPS responses even when the Security Group permits them.

Question #4FundamentalJunior

How does Amazon S3 handle consistency, encryption, and storage class tiering?

Senior Engineering Answer

Amazon S3 provides strong read-after-write consistency for all PUT, overwrite, and DELETE operations across all regions at no extra cost. Storage classes balance storage price against retrieval latency and minimum duration charges: S3 Standard for hot access, S3 Intelligent-Tiering for unknown/changing access patterns, S3 Standard-IA for infrequent access, and Glacier Instant/Flexible/Deep Archive for long-term compliance. Encryption options include SSE-S3 (default) and SSE-KMS (with CloudTrail key audit trails).

Production Code Example
{
  "Rules": [{
    "ID": "ArchiveOldLogs",
    "Status": "Enabled",
    "Transitions": [
      { "Days": 30, "StorageClass": "STANDARD_IA" },
      { "Days": 180, "StorageClass": "GLACIER" }
    ]
  }]
}
Common Interview Trap / Anti-Pattern:

Moving millions of tiny (<128 KB) objects into S3 Standard-IA or Glacier incurs minimum billable object size charges and per-transition API fees that exceed S3 Standard costs.

Question #5IntermediateMid-Level

How do Public Subnets, Private Subnets, Internet Gateways, NAT Gateways, and VPC Endpoints route traffic in a VPC?

Senior Engineering Answer

A subnet becomes public when its associated Route Table sends 0.0.0.0/0 to an Internet Gateway (IGW) and instances have public IPs. A private subnet routes 0.0.0.0/0 to a NAT Gateway deployed in a public subnet so backend hosts can initiate outbound internet connections while blocking unsolicited inbound traffic. VPC Gateway Endpoints (for S3 and DynamoDB) and PrivateLink Interface Endpoints keep AWS API traffic completely off the public internet and avoid NAT Gateway per-GB data processing fees.

Production Code Example
// S3 Gateway Endpoint route table entry automatically injected:
// Destination: pl-63a5400a (com.amazonaws.us-east-1.s3) -> Target: vpce-0abc12345
Common Interview Trap / Anti-Pattern:

Downloading large artifacts or writing heavy telemetry to S3 from private subnets through a NAT Gateway instead of a free S3 Gateway Endpoint wastes massive NAT data-processing charges.

Question #6IntermediateMid-Level

How does AWS evaluate IAM permissions across Identity policies, Resource policies, Permission Boundaries, and SCPs?

Senior Engineering Answer

IAM starts with an implicit Deny. An Explicit Deny in any applicable policy (Organizations SCP, Permission Boundary, Session Policy, Identity Policy, or Resource Policy) immediately terminates evaluation with Deny. Otherwise, within the same account, an Allow from either an Identity Policy or a Resource Policy grants access—EXCEPT when an SCP or Permission Boundary applies, in which case the action must also be allowed by the SCP and Boundary. Cross-account access always requires an Allow in both the caller's identity policy and the target's resource policy.

Production Code Example
{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "RequireTLS",
    "Effect": "Deny",
    "Principal": "*",
    "Action": "s3:*",
    "Resource": ["arn:aws:s3:::corp-bucket", "arn:aws:s3:::corp-bucket/*"],
    "Condition": { "Bool": { "aws:SecureTransport": "false" } }
  }]
}
Common Interview Trap / Anti-Pattern:

Attaching an AWS Organizations Service Control Policy (SCP) grants zero permissions on its own—an SCP acts strictly as a maximum guardrail ceiling and still requires IAM policies inside member accounts.

Question #7IntermediateMid-Level

How do AWS Lambda cold starts work, and how do VPC attachment, SnapStart, and Provisioned Concurrency affect latency?

Senior Engineering Answer

A cold start occurs when Lambda allocates a new microVM, downloads the deployment package or container image, boots the language runtime, and runs module-level initialization outside the handler. Modern Hyperplane ENIs eliminate the old 10-second VPC ENI cold-start penalty by sharing pre-provisioned ENIs across functions. To minimize cold starts further, keep dependencies slim, initialize SDK clients outside the handler for reuse across warm invokes, enable SnapStart (for Java/Python/.NET snapshots), or pay for Provisioned Concurrency.

Production Code Example
// Initialize SDK clients once per execution environment (outside handler)
const ddb = DynamoDBDocumentClient.from(new DynamoDBClient({}));
export const handler = async (event) => {
  return ddb.send(new GetCommand({ TableName: process.env.TABLE, Key: { pk: event.id } }));
};
Common Interview Trap / Anti-Pattern:

Instantiating database pools or AWS SDK clients inside the Lambda handler function re-runs TLS handshakes on every invocation and leaks sockets across frozen warm containers.

Question #8IntermediateMid-Level

How do SQS Standard, SQS FIFO, SNS, and EventBridge differ for asynchronous microservice integration?

Senior Engineering Answer

SNS is a push-based pub/sub fan-out topic delivering messages immediately to multiple subscribers (SQS queues, Lambda, HTTP). SQS is a pull-based durable queue buffering work for consumers: SQS Standard offers near-unlimited throughput with at-least-once delivery and best-effort ordering, while SQS FIFO guarantees strict per-MessageGroupId ordering and deduplication (up to 300-3,000+ msg/s with batching/high-throughput mode). EventBridge is a serverless event bus that filters JSON event payloads with content-based rules and schemas across SaaS and AWS services.

Production Code Example
// Common reliable fan-out: SNS Topic -> Multiple SQS Queues -> Workers + DLQ
// Set VisibilityTimeout >= 6x Lambda timeout to avoid duplicate retries while processing
Common Interview Trap / Anti-Pattern:

Setting an SQS queue's VisibilityTimeout shorter than the consumer's maximum processing duration causes the message to reappear and be processed concurrently by multiple workers.

Question #9AdvancedSenior

How does Amazon DynamoDB partition data internally, and how do you avoid hot-partition throttling and design Global Secondary Indexes?

Senior Engineering Answer

DynamoDB hashes the Partition Key (PK) to assign items to storage partitions (each supporting up to 1,000 WCUs, 3,000 RCUs, and 10 GB). If traffic concentrates on a single PK (such as today's date or a celebrity user ID), that partition throttles with ProvisionedThroughputExceededException even if table-wide capacity looks underutilized; write sharding (appending a suffix 0..N) spreads hot keys. Global Secondary Indexes (GSIs) replicate projected attributes asynchronously to new partition/sort keys and have independent throughput—if a GSI throttles, backpressure propagates and stalls writes to the base table.

Production Code Example
// Single-table access pattern with composite PK/SK and sparse GSI
{
  "PK": "TENANT#acme",
  "SK": "ORDER#2026-11-12#0091",
  "GSI1PK": "STATUS#PENDING_REVIEW",
  "GSI1SK": "2026-11-12T10:15:00Z"
}
Common Interview Trap / Anti-Pattern:

Using Scan operations or designing a GSI with a low-cardinality partition key (such as boolean active=true) creates a single hot partition that caps write throughput across the entire table.

Question #10AdvancedSenior

How do Application Load Balancer (ALB), Network Load Balancer (NLB), and Gateway Load Balancer (GWLB) differ under high load?

Senior Engineering Answer

ALB operates at Layer 7 (HTTP/HTTPS/gRPC), terminating TLS, inspecting headers/paths/cookies, and injecting X-Forwarded-For, while scaling gradually (or needing pre-warming for instant massive spikes). NLB operates at Layer 4 (TCP/UDP/TLS), handling millions of RPS with sub-millisecond latency, static Elastic IPs per AZ, and source IP preservation without rewriting packets. GWLB uses GENEVE encapsulation on Layer 3/4 to steer inline traffic transparently through fleets of third-party firewalls or IDS appliances.

Common Interview Trap / Anti-Pattern:

Forgetting to enable Cross-Zone Load Balancing or misaligning ALB idle timeout (default 60s) below the backend server's keep-alive timeout causes intermittent 502 Bad Gateway errors due to race conditions closing pooled sockets.

Question #11AdvancedSenior

How do Amazon Aurora's distributed storage engine and RDS Multi-AZ differ in failover speed and replication architecture?

Senior Engineering Answer

Standard RDS Multi-AZ uses synchronous block-level storage replication between a primary instance and a standby instance in another AZ, taking ~60-120 seconds for DNS cutover during failover. Amazon Aurora decouples compute from a shared, log-structured distributed storage volume that replicates 6 copies across 3 AZs (requiring 4/6 write quorum and 3/6 read quorum). Aurora writer instances ship only redo log records—never full 8K/16K database pages—allowing up to 15 low-lag read replicas and sub-30-second failover.

Common Interview Trap / Anti-Pattern:

Using standard RDS instance endpoints directly from Lambda without RDS Proxy exhausts max_connections during traffic bursts; RDS Proxy pools connections and masks Aurora failover DNS TTL delays.

Question #12AdvancedSenior

How do AWS KMS envelope encryption and bucket keys work to secure high-volume S3 and DynamoDB workloads?

Senior Engineering Answer

AWS KMS Hardware Security Modules (HSMs) never export customer managed master keys (CMKs); instead, services use envelope encryption. KMS GenerateDataKey returns a plaintext Data Encryption Key (DEK) and an encrypted copy of that DEK. The application or AWS service encrypts the large payload locally with AES-256-GCM using the plaintext DEK, wipes the plaintext DEK from memory, and stores the ciphertext alongside the encrypted DEK. Enabling S3 Bucket Keys caches a short-lived bucket-level intermediate key in S3, cutting KMS API calls and costs by up to 99%.

Production Code Example
aws s3api put-bucket-encryption --bucket corp-datalake \
  --server-side-encryption-configuration '{
    "Rules": [{"ApplyServerSideEncryptionByDefault":{"SSEAlgorithm":"aws:kms","KMSMasterKeyID":"alias/data-key"},"BucketKeyEnabled":true}]
  }'
Common Interview Trap / Anti-Pattern:

Writing millions of S3 objects per hour with SSE-KMS while BucketKeyEnabled is false hits KMS per-second API rate quotas (typically 5,500-30,000 req/s) and inflates KMS bills unnecessarily.

Question #13StaffPrincipal / Staff

How do you architect multi-region active-active vs active-passive failover on AWS without split-brain data loss?

Senior Engineering Answer

Multi-region architectures must guard against hard regional dependencies (especially us-east-1 control-plane calls during failovers). Active-active uses Route 53 latency/geolocation routing or AWS Global Accelerator (Anycast static IPs with fast endpoint health-check shifts) paired with DynamoDB Global Tables (last-writer-wins conflict resolution) or Aurora Global Database (with write forwarding or read-local/write-primary). Active-passive avoids cross-region write conflicts by keeping a warm standby or Pilot Light with Route 53 ARC (Application Recovery Controller) routing controls to prevent automated health-check flapping.

Common Interview Trap / Anti-Pattern:

Designing a data-plane failover path that calls AWS IAM, STS, or CloudFormation control-plane APIs in us-east-1 during an outage defeats regional isolation if us-east-1 itself is degraded.

Question #14StaffPrincipal / Staff

How does AWS Transit Gateway compare to VPC Peering and AWS PrivateLink at enterprise scale?

Senior Engineering Answer

VPC Peering creates non-transitive 1:1 links with zero single points of failure and lowest per-GB cost, but managing N*(N-1)/2 meshes across hundreds of VPCs becomes unmaintainable. Transit Gateway provides a regional hub-and-spoke router supporting transitive routing, BGP/VPN/Direct Connect aggregation, and isolated route tables across thousands of VPCs (at a per-GB processing fee). AWS PrivateLink exposes individual services via Network Load Balancers into consumer VPCs as ENIs—preventing CIDR overlap conflicts completely.

Common Interview Trap / Anti-Pattern:

Peering or attaching VPCs with overlapping CIDR blocks to a Transit Gateway causes asymmetric or unroutable paths; use PrivateLink when exposing SaaS or internal APIs across teams with unmanaged CIDRs.

Question #15StaffPrincipal / Staff

How do Lambda Event Source Mappings handle partial batch failures, Kinesis shard iteration, and Poison Pill messages?

Senior Engineering Answer

For Kinesis and DynamoDB Streams, Lambda polls shards sequentially per shard; an unhandled error stalls the entire shard indefinitely until record expiration (up to 7 days) unless BisectBatchOnFunctionError, MaximumRetryAttempts, and an OnFailure destination (SQS/SNS) are configured. For both SQS and Streams, returning ReportBatchItemFailures (batchItemFailures: [{ itemIdentifier }]) lets Lambda checkpoint succeeded items and retry only failed messages instead of reprocessing the whole batch.

Production Code Example
return {
  batchItemFailures: failedRecords.map((id) => ({ itemIdentifier: id }))
};
Common Interview Trap / Anti-Pattern:

Leaving Kinesis Lambda retry attempts at the default infinite (-1) without a DLQ lets a single malformed poison-pill record halt shard processing for 24+ hours.

Question #16StaffPrincipal / Staff

How do you govern a multi-account AWS Landing Zone using AWS Organizations, Control Tower, IAM Identity Center, and VPC IPAM?

Senior Engineering Answer

Production AWS organizations isolate blast radius, billing, and service quotas by workload and environment (Dev/Stage/Prod/Security/Shared-Network) into separate accounts inside Organizational Units (OUs). AWS Organizations applies SCPs (e.g., denying root user access, restricting regions, protecting CloudTrail), AWS IAM Identity Center federates human SSO via short-lived permission sets, CloudTrail logs stream centrally to an immutable Log Archive account, and VPC IPAM allocates non-overlapping CIDR ranges automatically.

Common Interview Trap / Anti-Pattern:

Sharing a single AWS account across teams and environments using only IAM tags leads to cross-environment quota exhaustion (e.g., dev Lambda bursts throttling prod Lambdas sharing the 1,000 account concurrency limit).

Amazon Web Services (AWS) Track Coverage & Difficulty Profile

9 of 16 prompts include code examples

This Amazon Web Services (AWS) preparation set groups 16 prompts across Junior (4), Mid-Level (4), Senior (4), Principal / Staff (4) roles with 4 fundamental, 4 intermediate, 4 advanced, 4 staff exercises tailored to Cloud, DevOps & Systems.

JuniorFundamental

How do AWS Regions, Availability Zones, and Edge Locations differ in fault isolation and latency?

JuniorFundamental

What is the difference between IAM Users, IAM Roles, and EC2 Instance Profiles?

JuniorFundamental

How do Security Groups and Network ACLs (NACLs) differ inside an Amazon VPC?

JuniorFundamental

How does Amazon S3 handle consistency, encryption, and storage class tiering?

Mid-LevelIntermediate

How do Public Subnets, Private Subnets, Internet Gateways, NAT Gateways, and VPC Endpoints route traffic in a VPC?

Mid-LevelIntermediate

How does AWS evaluate IAM permissions across Identity policies, Resource policies, Permission Boundaries, and SCPs?

Frequently Asked Technical Interview Questions (Amazon Web Services (AWS))

Essential theoretical concepts, architecture trade-offs, and runtime design questions asked by hiring committees.

What is the difference between AWS EBS, EFS, and Instance Store volumes?
EBS is network-attached block storage scoped to a single Availability Zone for databases and boot volumes. EFS is an elastic, multi-AZ managed NFS filesystem mountable concurrently by hundreds of EC2 instances or Lambda functions. Instance Store is physically attached NVMe SSD storage on the host server—offering the highest IOPS for caches/scratch data, but lost permanently if the instance stops or fails.
How do DynamoDB On-Demand and Provisioned capacity modes compare for cost and scaling?
On-Demand charges strictly per million read/write requests and absorbs unpredictable traffic spikes instantly (up to double previous peak every 30 minutes), costing roughly 5-7x more per unit than fully utilized Provisioned capacity. Provisioned mode with Auto Scaling and Reserved Capacity is far cheaper for steady, predictable workloads.
Why should you use OAC (Origin Access Control) instead of public S3 buckets behind CloudFront?
CloudFront Origin Access Control (OAC) keeps the S3 bucket completely private and uses SigV4-signed requests so only your specific CloudFront distribution can fetch origin objects. This prevents users from bypassing WAF rules, signed URLs, or caching by hitting the raw S3 URL directly.
How does AWS WAF differ from AWS Shield Standard and Shield Advanced?
AWS Shield Standard automatically protects against common Layer 3/4 volumetric SYN/UDP flood DDoS attacks at no extra cost. Shield Advanced adds Layer 7 mitigation, 24/7 DDoS Response Team (DRT) support, and cost protection against autoscaling spikes. AWS WAF inspects Layer 7 HTTP/HTTPS payloads to block SQL injection, XSS, and rate-limited bots.
Complete Learning Ecosystem

Pair Interview Prep with Cheat Sheets & Roadmaps

Review syntax formulas on our interactive cheat sheets, test your skills in technical quizzes, and study high-scale system designs.

Want to practice other technologies?

Explore our comprehensive technical interview tracks across all core technology stacks.

Browse All Interview Tracks