Back to Course
Interview Prep

Top 50 AWS Interview Questions and Answers

AWS interviews test your understanding of cloud computing fundamentals, core AWS services, networking, security, architecture best practices, and real-world problem-solving. This comprehensive guide covers 50 frequently asked AWS interview questions — from beginner-level concepts to advanced architectural patterns — with clear explanations and practical examples.

1–10: Core Services & Compute

Q1 What is AWS and what are its core services?
AWS (Amazon Web Services) is a comprehensive cloud computing platform offering over 200 services. Core services include:
  • Compute: EC2, Lambda, ECS, EKS
  • Storage: S3, EBS, EFS, Glacier
  • Database: RDS, DynamoDB, Redshift, Aurora
  • Networking: VPC, Route 53, CloudFront, ELB
  • Security: IAM, KMS, WAF, Shield
  • Management: CloudWatch, CloudTrail, Config
Q2 What is the difference between EC2 and Lambda?
  • EC2 — virtual servers (instances) that run continuously. You manage the OS, patches, and scaling. Billed per second/hour.
  • Lambda — serverless compute service that runs code in response to events. No infrastructure management. Billed per invocation and compute time.
// Lambda example (Node.js)
        exports.handler = async (event) => {
          console.log('Event:', event);
          return { statusCode: 200, body: 'Hello from Lambda!' };
        };
Use EC2 for long-running applications, Lambda for event-driven, short-lived tasks.
Q3 What is Auto Scaling and how does it work?
Auto Scaling automatically adjusts the number of EC2 instances in a group based on demand. It has three components:
  • Launch Template/Configuration — defines instance settings (AMI, instance type, etc.).
  • Auto Scaling Group — manages the fleet of instances.
  • Scaling Policy — defines when to scale (e.g., based on CPU utilization, custom metrics, or schedule).
It helps maintain application availability, optimize costs, and handle traffic spikes.
Q4 What is Elastic Load Balancing (ELB) and its types?
ELB automatically distributes incoming application traffic across multiple targets (EC2 instances, containers, IPs). Types:
  • Application Load Balancer (ALB) — Layer 7, HTTP/HTTPS, path-based routing, WebSocket support.
  • Network Load Balancer (NLB) — Layer 4, TCP/UDP, ultra-low latency, high throughput.
  • Gateway Load Balancer (GWLB) — Layer 3, deploys and scales third-party virtual appliances.
  • Classic Load Balancer (CLB) — legacy, Layer 4/7, not recommended for new workloads.
Q5 What is Amazon ECS and Amazon EKS?
  • ECS (Elastic Container Service) — AWS's own container orchestration service. It runs Docker containers on a cluster of EC2 instances or using Fargate (serverless).
  • EKS (Elastic Kubernetes Service) — managed Kubernetes service. It runs Kubernetes control plane and workers, compatible with standard Kubernetes tooling.
Choose ECS for deep AWS integration and simplicity; choose EKS for Kubernetes ecosystem and portability.
Q6 What is AWS Fargate?
Fargate is a serverless compute engine for containers. It removes the need to provision and manage EC2 instances — you just specify the CPU and memory requirements, and Fargate runs the containers. It works with both ECS and EKS.
// Fargate task definition snippet
        {
          "family": "my-app",
          "requiresCompatibilities": ["FARGATE"],
          "cpu": "256",
          "memory": "512",
          "containerDefinitions": [
            { "name": "web", "image": "nginx:latest" }
          ]
        }
Q7 What is the difference between a Region, Availability Zone, and Edge Location?
  • Region — a geographical area with multiple Availability Zones (e.g., us-east-1 in N. Virginia).
  • Availability Zone (AZ) — one or more distinct data centers within a Region, isolated from failures in other AZs.
  • Edge Location — a CDN endpoint used by CloudFront to cache content closer to users (hundreds globally).
Designing for high availability means deploying across multiple AZs within a Region.
Q8 What are the different EC2 purchasing options?
  • On-Demand — pay per second/hour, no commitment. Ideal for unpredictable workloads.
  • Reserved Instances — 1- or 3-year commitment, significant discount (up to 72%). Standard or Convertible.
  • Spot Instances — bid for unused capacity, up to 90% discount. Can be terminated with 2-minute notice. Great for fault-tolerant workloads.
  • Savings Plans — flexible pricing model with commitment to compute usage (EC2, Fargate, Lambda).
  • Dedicated Hosts — physical servers dedicated to you for compliance/licensing needs.
Q9 What is the difference between Amazon S3 and EBS?
  • S3 (Simple Storage Service) — object storage for unstructured data. Accessible via API/HTTP, stores files (objects) in buckets. Designed for durability (11 9's).
  • EBS (Elastic Block Store) — block storage for EC2 instances. Acts like a virtual hard drive, attached to a single instance (or multiple with EBS Multi-Attach).
Use S3 for backups, data lakes, static websites; use EBS for databases, file systems, and applications requiring low-latency block storage.
Q10 What is the difference between S3 Standard, S3 IA, and S3 Glacier?
  • S3 Standard — high durability, availability, low latency. For frequently accessed data.
  • S3 Intelligent-Tiering — automatically moves data between access tiers to optimize costs.
  • S3 Standard-IA (Infrequent Access) — lower storage cost, higher retrieval fee. For data accessed less frequently.
  • S3 One Zone-IA — lower cost but stored in a single AZ (less durable).
  • S3 Glacier Instant Retrieval — millisecond retrieval, for archives.
  • S3 Glacier Flexible Retrieval — minutes to hours retrieval, for backups.
  • S3 Glacier Deep Archive — lowest cost, 12+ hours retrieval, for long-term archives.

11–20: Storage & Databases

Q11 What is the difference between RDS and DynamoDB?
  • RDS (Relational Database Service) — managed relational databases (MySQL, PostgreSQL, Oracle, SQL Server, MariaDB, Aurora). Supports SQL, ACID transactions, joins.
  • DynamoDB — NoSQL key-value and document database. Fully managed, serverless, single-digit millisecond latency at any scale. Supports JSON, pay-per-request.
Choose RDS for complex queries, joins, and existing relational applications. Choose DynamoDB for high-scale, low-latency, flexible schema use cases.
Q12 What is Amazon Aurora?
Aurora is a MySQL and PostgreSQL-compatible relational database built for the cloud. It offers:
  • 5x better performance than standard MySQL.
  • 3x better performance than standard PostgreSQL.
  • Storage automatically scales up to 128 TB.
  • Six copies of data across 3 AZs.
  • Continuous backups to S3.
It's a drop-in replacement for MySQL/PostgreSQL with higher performance and availability.
Q13 What is Amazon Redshift?
Redshift is a fully managed, petabyte-scale data warehouse service. It uses columnar storage and massively parallel processing (MPP) to run complex analytical queries efficiently. Use cases: business intelligence, analytics, and data warehousing.
-- Redshift query example
        SELECT product_name, SUM(sales) as total_sales
        FROM sales_data
        GROUP BY product_name
        ORDER BY total_sales DESC
        LIMIT 10;
Q14 What is Amazon ElastiCache?
ElastiCache is a fully managed in-memory caching service, supporting Redis and Memcached engines. It improves application performance by caching frequently accessed data, reducing database load, and providing sub-millisecond latency. Common use cases: session storage, database query caching, real-time analytics.
Q15 What is the difference between EBS, EFS, and S3?
  • EBS — block storage, single AZ, attached to one EC2 instance (or multi-attach), low latency.
  • EFS (Elastic File System) — file storage, multi-AZ, scalable, POSIX-compliant, can be mounted by multiple EC2 instances simultaneously.
  • S3 — object storage, region-level, accessed via API/HTTP, 11 9's durability, unlimited storage.
Choose EBS for databases, EFS for shared file systems, S3 for backups, data lakes, and static content.
Q16 What is AWS Storage Gateway?
Storage Gateway is a hybrid cloud storage service that connects on-premises environments to AWS cloud storage. It supports three types:
  • S3 File Gateway — presents S3 as NFS/SMB file shares.
  • Volume Gateway — presents iSCSI block storage volumes.
  • Tape Gateway — replaces physical tape backups with virtual tapes in S3/Glacier.
Q17 What is Amazon RDS Read Replica?
A Read Replica is a copy of an RDS database that allows read-only queries to be offloaded from the primary DB instance. Benefits:
  • Improved read performance for read-heavy applications.
  • Can be promoted to a standalone primary DB.
  • Cross-region replication available.
-- Create a read replica using AWS CLI
        aws rds create-db-instance-read-replica \
          --db-instance-identifier my-replica \
          --source-db-instance-identifier my-primary-db
Q18 What is the difference between RDS Multi-AZ and Read Replica?
  • Multi-AZ — provides high availability. A standby replica in another AZ is automatically promoted during failure. Failover is automatic and seamless (for disaster recovery).
  • Read Replica — provides read scaling. It's a read-only copy used to offload read traffic. Failover is manual (can be promoted).
Multi-AZ is for high availability; Read Replicas are for performance scaling.
Q19 What is Amazon DynamoDB Accelerator (DAX)?
DAX is an in-memory cache for DynamoDB that delivers up to 10x performance improvement. It sits between your application and DynamoDB, caching read requests with microsecond latency. It's fully managed and ideal for read-intensive, latency-sensitive workloads.
Q20 What is the difference between SQL and NoSQL in AWS?
  • SQL (RDS, Aurora, Redshift) — structured schema, ACID transactions, complex joins, vertical scaling.
  • NoSQL (DynamoDB, ElastiCache, DocumentDB) — flexible schema, horizontal scaling, high throughput, lower latency for simple queries.
Choose SQL for structured data and complex queries; choose NoSQL for high-scale, flexible data models.

21–30: Networking & Security

Q21 What is Amazon VPC?
VPC (Virtual Private Cloud) is a logically isolated section of the AWS cloud where you can launch resources in a virtual network. You have complete control over:
  • IP address range (CIDR block).
  • Subnets (public and private).
  • Route tables, internet gateways, NAT gateways.
  • Security groups and network ACLs.
VPC is the foundation of AWS networking and security.
Q22 What is the difference between a Security Group and a Network ACL?
  • Security Group — operates at the instance level (ENI). Stateful (return traffic automatically allowed). Supports allow rules only. Evaluated before NACL.
  • Network ACL — operates at the subnet level. Stateless (must define both inbound and outbound rules). Supports allow and deny rules. Evaluated in rule number order.
// Security Group: allow inbound HTTP from anywhere
        Inbound: 0.0.0.0/0, port 80, allow
        Outbound: (automatic, all traffic allowed)
        
        // Network ACL: allow inbound HTTP
        Inbound: 0.0.0.0/0, port 80, allow
        Outbound: 0.0.0.0/0, port 1024-65535, allow (ephemeral ports)
Q23 What is an Internet Gateway and a NAT Gateway?
  • Internet Gateway (IGW) — horizontally scaled, redundant VPC component that allows communication between your VPC and the internet. Attached to the VPC.
  • NAT Gateway — allows instances in private subnets to initiate outbound traffic to the internet, but prevents inbound traffic from the internet. It's managed and highly available.
Use IGW for public subnets; use NAT Gateway for private subnets that need internet access.
Q24 What is VPC Peering and when would you use it?
VPC Peering is a networking connection between two VPCs that enables routing traffic using private IP addresses. It can be within the same AWS account, across accounts, or across regions. Use cases:
  • Connecting applications across different VPCs.
  • Sharing resources (e.g., shared services VPC).
  • Multi-account architecture.
Note: Peering is non-transitive (no multi-hop routing). Use Transit Gateway for complex routing.
Q25 What is AWS Transit Gateway?
Transit Gateway is a network transit hub that connects VPCs, VPN connections, and on-premises networks. It simplifies network architecture by providing a single point of connectivity. Benefits:
  • Supports transitive routing between connected networks.
  • Scales up to thousands of VPC attachments.
  • Reduces network complexity.
It's a better choice than VPC Peering for large-scale networking.
Q26 What is Amazon Route 53 and its routing policies?
Route 53 is a scalable DNS and domain name registration service. Routing policies:
  • Simple — one record, one IP.
  • Weighted — distribute traffic proportionally.
  • Latency-based — route to the region with the lowest latency.
  • Failover — active-passive with health checks.
  • Geolocation — route based on user location.
  • Geoproximity — route based on geographic distance.
  • Multi-value — returns multiple healthy IPs.
Q27 What is AWS Shield and AWS WAF?
  • AWS Shield — managed DDoS protection service. Shield Standard is free and protects against common attacks. Shield Advanced provides 24/7 support, cost protection, and enhanced monitoring.
  • AWS WAF (Web Application Firewall) — protects web applications from common web exploits (SQL injection, XSS, etc.) by filtering HTTP/HTTPS traffic based on rules.
Use Shield for DDoS protection; use WAF for application-layer security filtering.
Q28 What is AWS Certificate Manager (ACM)?
ACM is a service that provisions, manages, and deploys SSL/TLS certificates for use with AWS services. It integrates with ELB, CloudFront, and API Gateway. Benefits:
  • Free public certificates.
  • Automatic renewal.
  • Centralized certificate management.
// Request a certificate via AWS CLI
        aws acm request-certificate \
          --domain-name example.com \
          --validation-method DNS
Q29 What is Amazon CloudFront?
CloudFront is a content delivery network (CDN) that distributes content globally with low latency and high transfer speeds. It caches content at edge locations worldwide. Use cases:
  • Delivering static and dynamic web content.
  • Streaming video and audio.
  • API acceleration.
  • Protecting origin servers from direct traffic.
Q30 What is the difference between a public subnet and a private subnet?
  • Public Subnet — has a route to an Internet Gateway (IGW), allowing instances to be directly accessible from the internet. Instances get public IPs.
  • Private Subnet — no route to IGW. Instances cannot be accessed directly from the internet. They use NAT Gateway/VPN for outbound internet access.
Public subnets are for web servers; private subnets are for databases and application servers.

31–40: IAM & Access Control

Q31 What is IAM and why is it important?
IAM (Identity and Access Management) is an AWS service that helps you securely control access to AWS resources. It provides:
  • Users — individual identities with permanent credentials.
  • Groups — collections of users with shared permissions.
  • Roles — assumed by users, services, or applications to grant temporary permissions.
  • Policies — JSON documents defining permissions (what actions are allowed/denied on which resources).
IAM is the cornerstone of AWS security — following the principle of least privilege.
Q32 What is the difference between an IAM role and an IAM user?
  • IAM User — a permanent identity with long-term credentials (access key + secret key). Used by individuals or applications with fixed access needs.
  • IAM Role — a temporary identity that can be assumed by users, applications, or AWS services. Provides temporary security credentials via STS.
Use roles for cross-account access, service-to-service access (e.g., EC2 to S3), and temporary access scenarios.
Q33 What is the principle of least privilege in IAM?
The principle of least privilege means granting only the minimum permissions required for a user, role, or application to perform its intended function. This reduces the risk of accidental or malicious misuse. Best practices:
  • Start with no permissions and add only what's needed.
  • Use managed policies where possible.
  • Regularly review and audit permissions.
  • Use IAM Access Analyzer to identify unused permissions.
Q34 What is an IAM policy and its structure?
An IAM policy is a JSON document that defines permissions. Structure:
  • Version — policy language version (e.g., "2012-10-17").
  • Statement — array of permission statements.
  • Sid — optional statement ID.
  • Effect — "Allow" or "Deny".
  • Action — list of AWS service actions (e.g., "s3:GetObject").
  • Resource — list of ARNs the action applies to.
  • Condition — optional conditions (e.g., IP range, date).
{
          "Version": "2012-10-17",
          "Statement": [
            {
              "Effect": "Allow",
              "Action": "s3:GetObject",
              "Resource": "arn:aws:s3:::my-bucket/*"
            }
          ]
        }
Q35 What is AWS STS and when would you use it?
STS (Security Token Service) is a web service that enables you to request temporary, limited-privilege credentials for AWS identities. Use cases:
  • Cross-account access — allowing users from one account to access resources in another.
  • Federation — allowing external identities (AD, Google, etc.) to access AWS.
  • EC2 Instance Profiles — granting EC2 instances temporary permissions to access other AWS services.
  • MFA-protected API access.
// Assume a role via STS CLI
        aws sts assume-role \
          --role-arn arn:aws:iam::123456789012:role/my-role \
          --role-session-name my-session
Q36 What is the difference between a managed policy and an inline policy?
  • Managed Policy — standalone policy that can be attached to multiple users, groups, or roles. Managed by AWS (AWS-managed) or by you (customer-managed).
  • Inline Policy — embedded directly into a single user, group, or role. It's exclusive to that entity and cannot be reused.
Managed policies are recommended for reusability and easier management.
Q37 What is AWS Organizations?
AWS Organizations is a management service that allows you to centrally govern multiple AWS accounts. Features:
  • Consolidated Billing — combine usage across accounts for volume discounts.
  • Service Control Policies (SCPs) — centrally enforce permission boundaries.
  • Account Management — create, invite, and manage accounts.
  • Hierarchical Structure — organize accounts into Organizational Units (OUs).
Q38 What is AWS Key Management Service (KMS)?
KMS is a managed service that makes it easy to create and control encryption keys used to encrypt data. Features:
  • Centralized key management.
  • Integration with many AWS services (S3, EBS, RDS, etc.).
  • Key rotation (automatic).
  • Access controls via IAM.
  • Audit capabilities with CloudTrail.
// Encrypt data using KMS via CLI
        aws kms encrypt \
          --key-id alias/my-key \
          --plaintext fileb://data.txt \
          --output text \
          --query CiphertextBlob > encrypted.b64
Q39 What is AWS Secrets Manager?
Secrets Manager is a service that helps you protect access to your applications, services, and IT resources by securely storing and rotating secrets (e.g., database credentials, API keys, passwords). Features:
  • Automatic rotation of secrets.
  • Fine-grained access controls with IAM.
  • Audit logging with CloudTrail.
  • Integration with RDS, Redshift, and other services.
It's more feature-rich than Parameter Store for secrets management.
Q40 What is the difference between KMS and Secrets Manager?
  • KMS — focuses on encryption key management. It encrypts and decrypts data using cryptographic keys.
  • Secrets Manager — focuses on storing and managing sensitive information (secrets) with automatic rotation. It may use KMS for encryption.
Use KMS for encryption key management; use Secrets Manager for storing and rotating application secrets.

41–50: Architecture & DevOps

Q41 What are the five pillars of the AWS Well-Architected Framework?
  • Operational Excellence — run and monitor systems effectively (automation, observability).
  • Security — protect data, systems, and assets (IAM, encryption, compliance).
  • Reliability — recover from failures, meet business requirements (HA, DR, fault tolerance).
  • Performance Efficiency — use resources efficiently (right-sizing, scaling, caching).
  • Cost Optimization — avoid unnecessary costs (right-sizing, spot, reserved instances).
Q42 What is the difference between high availability and disaster recovery?
  • High Availability (HA) — ensuring that a system remains operational and accessible with minimal downtime. Achieved through redundancy (multi-AZ, load balancing, auto-scaling).
  • Disaster Recovery (DR) — the process of restoring systems and data after a catastrophic failure (e.g., region outage). Includes RTO and RPO.
HA focuses on uptime; DR focuses on recovery after a disaster.
Q43 What is RTO and RPO?
  • RTO (Recovery Time Objective) — the maximum acceptable amount of time to restore a system after a failure. Shorter RTO = faster recovery.
  • RPO (Recovery Point Objective) — the maximum acceptable amount of data loss measured in time. Shorter RPO = less data loss.
These are key metrics in DR planning. RDS Multi-AZ and backups help achieve low RTO/RPO.
Q44 What is AWS CloudFormation?
CloudFormation is an Infrastructure as Code (IaC) service that allows you to model and provision AWS resources using templates (JSON/YAML). Benefits:
  • Consistent, repeatable deployments.
  • Version-controlled infrastructure.
  • Automated rollbacks.
  • Resource dependencies are handled automatically.
// CloudFormation YAML snippet
        Resources:
          MyEC2Instance:
            Type: AWS::EC2::Instance
            Properties:
              InstanceType: t2.micro
              ImageId: ami-0abcdef1234567890
Q45 What is the difference between CloudFormation and Terraform?
  • CloudFormation — AWS-native IaC service. Deep integration with AWS, uses AWS-specific syntax (JSON/YAML). Only supports AWS resources.
  • Terraform — open-source IaC tool by HashiCorp. Supports multiple cloud providers (AWS, Azure, GCP, etc.) and uses HCL (HashiCorp Configuration Language).
Choose CloudFormation for pure AWS environments; choose Terraform for multi-cloud or hybrid scenarios.
Q46 What is AWS CodePipeline?
CodePipeline is a fully managed CI/CD service that automates the build, test, and deployment phases of your application release process. It integrates with:
  • Source: CodeCommit, GitHub, S3.
  • Build: CodeBuild, Jenkins.
  • Deploy: CodeDeploy, Elastic Beanstalk, ECS, S3.
It enables rapid and reliable application delivery with automated pipelines.
Q47 What is AWS CodeDeploy?
CodeDeploy is a deployment service that automates application deployments to EC2 instances, on-premises servers, and Lambda functions. Deployment strategies:
  • In-place — stops and restarts the application on each instance.
  • Blue/Green — deploys to a new environment, then switches traffic.
  • Canary — gradually rolls out changes to a subset of users.
// appspec.yml for CodeDeploy
        version: 0.0
        os: linux
        files:
          - source: /
            destination: /var/www/html
        hooks:
          AfterInstall:
            - location: scripts/restart.sh
              timeout: 300
Q48 What is AWS CloudWatch and what does it monitor?
CloudWatch is a monitoring and observability service for AWS resources and applications. It provides:
  • Metrics — collect and track operational data (CPU, memory, disk, custom metrics).
  • Logs — collect, monitor, and analyze log files.
  • Alarms — trigger actions based on metric thresholds.
  • Dashboards — visualize metrics in customizable dashboards.
  • Events — respond to changes in AWS resources (EventBridge).
Q49 What is the difference between CloudWatch and CloudTrail?
  • CloudWatch — monitors performance and operational metrics of AWS resources (e.g., CPU utilization, request count).
  • CloudTrail — records API calls made to AWS services for auditing, security analysis, and troubleshooting.
CloudWatch tells you what is happening; CloudTrail tells you who did what and when.
Q50 What is AWS Config and how is it used?
AWS Config is a service that enables you to assess, audit, and evaluate the configurations of your AWS resources. Features:
  • Continuously records resource configuration changes.
  • Evaluates configurations against desired rules (e.g., S3 bucket public access).
  • Provides a history of configuration changes.
  • Integrates with CloudTrail for compliance auditing.
It helps with compliance, governance, and change management.

  Pro Tip: Hands-on experience is crucial for AWS interviews. Set up a personal AWS account (free tier), build small projects, and practice deploying architectures. Understanding the why behind service choices is just as important as knowing the what.

Ready to master real-world AWS skills?

Learn AWS hands-on with mentor-led, live sessions.

Explore Course