AWS interview questions are part of almost every backend, DevOps and cloud engineer interview, because Amazon Web Services runs a large share of the world’s apps. This post gives you 110 of the most asked questions, grouped from basic to advanced, and every one of them now has a full answer in simple English, with policies, commands and design examples.
Cloud rounds often mix in containers and pipelines, so keep our Docker interview questions, Kubernetes interview questions and CI/CD interview questions close by. The answers here match AWS services and limits as of late 2026.
What Do AWS Interview Questions Cover?
AWS (Amazon Web Services) is a cloud platform. Instead of buying servers, you rent computing power, storage, databases and many other services, and you pay only for what you use.
Think of electricity at home. You do not build a power plant; you plug in and pay the monthly bill based on use. AWS gives you servers and storage the same way, ready in minutes.
Most AWS interview questions test seven areas: core ideas, IAM and security, compute, storage, databases, networking and monitoring. Senior rounds add architecture design, cost control and real outage scenarios.
How to Use These AWS Interview Questions
Do not try to learn 110 answers by heart. Instead, use the list in three passes.
- First, read each question and try to answer it in two or three sentences before you read the answer.
- Next, practise those out loud, with a real example from a project or the AWS Free Tier.
- Finally, try the CLI commands and policy from the hands-on section in a test account.
The table below shows how interview rounds usually use these questions.
| Round | Focus | Question range |
|---|---|---|
| Phone screen | Cloud basics, regions, IAM | Q1 to Q37 |
| Technical round | Compute, serverless, storage, databases | Q38 to Q87 |
| Senior or architect round | Networking, messaging, cost, scenarios | Q88 to Q110 |
| Hands-on test | Write a policy or design an app | Hands-on section |
How a Typical AWS Architecture Works
Many interview design questions start from the same three-tier web app. Users reach a load balancer, the load balancer sends traffic to app servers in private subnets, and the app servers talk to a managed database.

The app runs in two Availability Zones, so one data centre can fail without taking the app down. Static files sit in S3 behind CloudFront, and an Auto Scaling group adds or removes servers as traffic changes.
Basic AWS Interview Questions with Answers
These AWS interview questions check that you know the core cloud ideas and terms. Freshers should be able to answer all of them, so link each answer to a real example if you can.
Q1. What is cloud computing, and what are its main benefits?
Cloud computing means renting computing resources, such as servers, storage, databases and networking, over the internet from a provider like AWS, instead of buying and running your own hardware. You create resources in minutes and pay only for what you use.
The main benefits are these.
- No upfront hardware cost: you pay as you go, like an electricity bill.
- Speed: a new server is ready in minutes, not weeks.
- Elasticity: add capacity for a big sale, then remove it after.
- Global reach: run your app close to users around the world.
- Managed services: the provider runs databases, backups and patching for you.
- Reliability: build across several data centres for high availability.
Q2. What are IaaS, PaaS and SaaS, with an AWS example of each?
These are three cloud service models. They differ in how much the provider manages for you.
| Model | You manage | Provider manages | AWS example |
|---|---|---|---|
| IaaS (Infrastructure as a Service) | OS, runtime, app, data | Hardware, network, virtualisation | Amazon EC2 |
| PaaS (Platform as a Service) | App and data | Also OS, runtime, scaling | AWS Elastic Beanstalk, AWS Lambda |
| SaaS (Software as a Service) | Only your use and data | Everything | Amazon Connect, Amazon WorkMail |
A pizza analogy helps. IaaS is buying ingredients and cooking at home, PaaS is ordering a pizza and serving it yourself, and SaaS is eating at the restaurant. Serverless services like Lambda are often called “function as a service”, which sits between PaaS and SaaS.
Q3. What is AWS, and why do companies use it?
AWS (Amazon Web Services) is Amazon’s cloud platform. It offers more than 200 services, from basic servers and storage to databases, machine learning, analytics and IoT, in data centres around the world.
Companies use it because it has the widest range of services, a large global footprint, mature security and compliance, a big community and job market, and pay-as-you-go pricing. Startups can begin small and grow, and large companies can move data centres to the cloud.
Q4. What is a Region?
A Region is a separate geographic area where AWS has data centres, such as ap-south-1 (Mumbai), us-east-1 (North Virginia) or eu-west-1 (Ireland). Each Region is fully independent of the others.
Most resources live in one Region, and data does not leave the Region unless you copy it. Some services are global, such as IAM, Route 53 and CloudFront. Prices and available services can differ by Region.
Q5. What is an Availability Zone, and why should apps use more than one?
An Availability Zone (AZ) is one or more data centres inside a Region, with its own power, cooling and network. AZs in a Region are a few kilometres apart and connected with fast, low-latency links. Most Regions have three or more AZs, such as ap-south-1a, 1b and 1c.
Apps should use at least two AZs, because a whole AZ can fail, for example from a power or network problem. If your servers and database run in two AZs, the app keeps running when one goes down. This is the basic building block of high availability on AWS.
Q6. What are edge locations and Local Zones?
Edge locations are small AWS sites in many cities around the world. CloudFront uses them to cache content close to users, and Route 53 and AWS Global Accelerator use them too. There are hundreds of them, far more than Regions.
Local Zones are small extensions of a Region placed in a big city, so you can run compute and storage very close to users there, with single-digit millisecond latency. They suit things like live video, gaming and real-time apps. Wavelength Zones do the same inside telecom 5G networks.
Q7. How do you choose a Region for an app?
Think about four main things.
- Data rules (compliance): some laws require data to stay in a country, such as Indian or EU rules.
- Latency: pick a Region close to most of your users.
- Services: check the services you need are available there, because new ones often launch in a few Regions first.
- Cost: prices differ by Region, and
us-east-1is often one of the cheapest.
For disaster recovery, you may also choose a second Region for backups or a standby copy.
Q8. What is the shared responsibility model?
The shared responsibility model explains which security tasks belong to AWS and which belong to you. AWS is responsible for security “of” the cloud. You are responsible for security “in” the cloud.
| AWS is responsible for | You are responsible for |
|---|---|
| Physical data centres and hardware | Your data and who can access it |
| The host operating system and virtualisation | IAM users, roles and policies |
| The global network | Security groups and network settings |
| Managed service infrastructure | Guest OS patching on EC2 |
| Encryption choices and app code |
The split moves with the service. With EC2, you patch the OS. With Lambda or S3, AWS handles much more, but you still own your data, permissions and code.
Q9. What is the AWS Free Tier?
The AWS Free Tier lets you try AWS for free within certain limits, so you can learn and build small projects. Accounts created since July 2025 get a free plan with AWS credits that can be used across many services for up to six months, and they can earn more credits by trying key services.
Some services also have “always free” amounts that never expire, such as a monthly number of free Lambda requests and some DynamoDB storage. Always set a billing budget and alarm on a learning account, because charges start once you go past the free amounts or upgrade.
Q10. What are the main ways to access AWS: console, CLI, SDK and APIs?
Every AWS action is an API call underneath, and there are several ways to make those calls.
- Management Console: the website, good for learning and exploring.
- Command Line Interface (CLI): the
awscommand in a terminal, good for scripts and automation. - AWS SDKs: libraries for languages such as Go, Python, Java and JavaScript, for use inside apps.
- Infrastructure as code: CloudFormation, CDK and Terraform create resources from files.
- AWS CloudShell: a browser terminal with the CLI already set up.
aws s3 ls # list buckets
aws ec2 describe-instances --region ap-south-1
aws sts get-caller-identity # which account and role am I using?
Q11. What is an ARN (Amazon Resource Name)?
An ARN is a unique ID for an AWS resource, used in IAM policies, API calls and logs. It follows a fixed pattern.
arn:partition:service:region:account-id:resource
arn:aws:s3:::shop-uploads/images/*
arn:aws:lambda:ap-south-1:123456789012:function:resize-image
arn:aws:iam::123456789012:role/app-role
Some parts can be empty. For example, S3 bucket ARNs have no Region or account, and IAM ARNs have no Region because IAM is global.
Q12. What is AWS Organizations, and what are member accounts?
AWS Organizations lets you manage many AWS accounts together from one management account. The other accounts are member accounts, and you can group them into organisational units (OUs), such as “Production”, “Development” and “Security”.
It gives you one combined bill (consolidated billing), shared volume discounts, central security rules with Service Control Policies, and easy creation of new accounts. Most companies with more than a few people use it.
Q13. Why do companies use many AWS accounts instead of one?
An AWS account is a strong boundary for security, billing and limits. So companies split work across many accounts.
- Security: a mistake or breach in a dev account cannot touch production data.
- Blast radius: service limits and outages in one account do not affect others.
- Billing: costs are easy to see per team or product.
- Permissions: simpler IAM, because each account has a clear purpose.
A common setup has separate accounts for production, staging, development, logging, security and shared networking, all managed with AWS Organizations.
Q14. What is AWS Control Tower?
AWS Control Tower sets up and governs a secure multi-account AWS environment, called a landing zone, following AWS best practices. It builds on AWS Organizations.
It creates core accounts for logging and security, sets up IAM Identity Center for single sign-on, applies guardrails (controls) such as “disallow public S3 buckets”, and gives an “account factory” to create new, pre-configured accounts. So it saves weeks of manual setup for companies starting with many accounts.
Q15. What is the AWS Well-Architected Framework, and what are its six pillars?
The Well-Architected Framework is AWS’s set of best practices for designing good cloud systems. It has six pillars.
| Pillar | Focus |
|---|---|
| Operational excellence | Run and improve systems, automation, monitoring |
| Security | Protect data and systems, least privilege, encryption |
| Reliability | Recover from failure, scale, multi-AZ |
| Performance efficiency | Use the right resources and keep up with demand |
| Cost optimisation | Avoid waste and pay only for what you need |
| Sustainability | Reduce the environmental impact of your workloads |
You can review a workload against these pillars with the free Well-Architected Tool. Mentioning the pillars in a design answer shows structured thinking.
Q16. What is high availability, and how is it different from fault tolerance?
High availability (HA) means a system stays up most of the time and recovers quickly from failures, maybe with a short blip. For example, an RDS Multi-AZ database fails over to a standby in about a minute or two.
Fault tolerance means the system keeps working with no interruption at all when a part fails, because every part has a live duplicate. It costs more. So HA accepts a short recovery time to save money, and fault tolerance aims for zero impact.
Q17. What is scalability, and what is elasticity?
Scalability is the ability of a system to handle more load by adding resources, such as handling 10 times more users with more servers. Elasticity is the ability to add and remove resources automatically as load goes up and down, so you never pay for much more than you need.
For example, an Auto Scaling group that grows from 2 to 20 servers during a festival sale and back to 2 at night is elastic. The cloud makes elasticity easy, because you only pay for capacity while it runs.
Q18. What is the difference between vertical and horizontal scaling?
Vertical scaling (scale up) means making one server bigger, such as moving from a t3.medium to an m7i.2xlarge. Horizontal scaling (scale out) means adding more servers and spreading the load with a load balancer.
| Feature | Vertical scaling | Horizontal scaling |
|---|---|---|
| How | Bigger instance | More instances |
| Limit | Largest instance size | Almost no hard limit |
| Downtime | Usually a restart | None, add servers live |
| App changes | Usually none | App must be stateless |
| AWS tool | Change instance type | Auto Scaling group + load balancer |
So scale out stateless web and API servers, and scale up things that are hard to split, such as some databases.
Q19. What are RTO and RPO in disaster recovery?
They are the two key targets for recovering from a disaster.
- RTO (Recovery Time Objective): how long the system can be down. For example, “back online within 1 hour”.
- RPO (Recovery Point Objective): how much data you can afford to lose, measured in time. For example, “lose at most 5 minutes of data”.
Lower RTO and RPO need more expensive designs. A shop might accept an RTO of 4 hours for its blog, but need near-zero RPO for its orders database.
Q20. What are the main disaster recovery strategies: backup and restore, pilot light, warm standby and multi-site?
AWS describes four main strategies, from cheapest and slowest to most expensive and fastest.
| Strategy | What runs in the recovery Region | RTO and RPO | Cost |
|---|---|---|---|
| Backup and restore | Only backups | Hours | Lowest |
| Pilot light | Core parts like a replicated database, servers off | Tens of minutes | Low |
| Warm standby | A small but working copy of the full system | Minutes | Medium |
| Multi-site active/active | Full system serving traffic in both Regions | Near zero | Highest |
Pick the strategy that matches the business RTO and RPO. AWS Elastic Disaster Recovery and AWS Backup help with several of these.
IAM and Security AWS Interview Questions with Answers
Security questions come up in every round. So prepare these AWS interview questions with care, and always come back to one idea: give every person and app only the access it needs.
Q21. What is IAM?
IAM (Identity and Access Management) is the AWS service that controls who can sign in to your AWS account and what they can do. It answers two questions for every request: who are you (authentication), and are you allowed to do this (authorization).
IAM is global, not tied to a Region, and it is free. You use it to create users, groups and roles, and to attach policies that allow or deny actions such as s3:GetObject or ec2:StartInstances.
Q22. What is the difference between an IAM user, group and role?
These are the three main types of identity in IAM.
| Identity | What it is | Credentials | Typical use |
|---|---|---|---|
| User | One person or app with a permanent identity | Password and/or long-term access keys | Rare today, legacy or break-glass access |
| Group | A collection of users that share policies | None of its own | Give the same rights to many users |
| Role | An identity that anyone allowed can “assume” for a short time | Temporary credentials | EC2, Lambda, cross-account access, SSO users |
So the modern best practice is to use roles almost everywhere. People sign in through IAM Identity Center and get roles, and apps on AWS get roles automatically, so there are no long-lived keys to leak.
Q23. What is an IAM policy, and what are its main parts?
An IAM policy is a JSON document that lists permissions. Each statement says what is allowed or denied, on which resources, and under which conditions.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:PutObject"],
"Resource": "arn:aws:s3:::shop-uploads/images/*",
"Condition": {
"Bool": { "aws:SecureTransport": "true" }
}
}
]
}
The main parts are Effect (Allow or Deny), Action (the API calls), Resource (the ARNs the statement applies to) and an optional Condition (extra rules, such as requiring HTTPS or a source IP). Resource-based policies also have a Principal, which says who the policy applies to.
Q24. What is the difference between identity-based and resource-based policies?
Identity-based policies are attached to a user, group or role, and they say what that identity can do. Resource-based policies are attached to a resource, such as an S3 bucket, an SQS queue, a KMS key or a Lambda function, and they say who can access that resource.
| Feature | Identity-based | Resource-based |
|---|---|---|
| Attached to | User, group or role | A resource, such as an S3 bucket |
| Has a Principal field | No, the identity is the principal | Yes, says who is allowed |
| Cross-account access | Needs a role to assume | Can grant another account directly |
| Example | Role policy allowing dynamodb:GetItem | Bucket policy allowing CloudFront to read |
Within one account, access is allowed if either type allows it (and nothing denies it). Across accounts, usually both sides must allow it.
Q25. How does AWS evaluate an explicit deny against an allow?
AWS follows a simple order for every request.
- By default, everything is denied (implicit deny).
- If any applicable policy has an explicit
Denythat matches, the request is denied. An explicit deny always wins. - Otherwise, if some policy has a matching
Allow, the request is allowed, as long as every other layer also allows it.
Other layers can limit what is allowed, such as Service Control Policies, permission boundaries and session policies. So a user can only do something if an identity or resource policy allows it, nothing explicitly denies it, and none of the guardrails block it.
Q26. What is the principle of least privilege?
Least privilege means giving every user, role and app only the permissions it needs to do its job, and nothing more. For example, an app that only reads images from one S3 folder should get s3:GetObject on that folder, not s3:* on all buckets.
It limits damage if credentials are stolen or a bug runs wild. In practice, start small and add permissions when needed, use IAM Access Analyzer to generate policies from real usage and to find unused access, and avoid wildcards like "Action": "*" and "Resource": "*".
Q27. Why should you avoid using the root user, and how do you protect it?
The root user is the email login that created the AWS account. It has full, unrestricted access to everything, including closing the account and changing billing, and it cannot be limited by IAM policies. If it is stolen, the attacker owns the account.
So never use it for daily work, and protect it with these steps.
- Turn on MFA, ideally a hardware key or passkey.
- Delete any root access keys, and never create new ones.
- Use a strong, unique password and a group email address the company controls.
- Use root only for the few tasks that require it, such as some billing settings.
- With AWS Organizations, you can centrally manage and even remove root credentials for member accounts.
Q28. What is MFA, and where should you enforce it?
MFA (multi-factor authentication) means signing in with two things: something you know, such as a password, and something you have, such as a phone app code, a hardware security key or a passkey. A stolen password alone is then not enough.
Enforce it for the root user of every account, for every person who signs in to the console, and for sensitive actions such as deleting backups or changing IAM. IAM policies can require MFA with the condition aws:MultiFactorAuthPresent. With IAM Identity Center, set MFA for all users in one place.
Q29. What is an instance profile?
An instance profile is a container that attaches an IAM role to an EC2 instance. Apps on the instance then get temporary credentials for that role automatically, from the instance metadata service, without any keys stored on the server.
AWS SDKs and the CLI find these credentials by themselves. So never put access keys in config files on EC2. Also, require IMDSv2 (session tokens for the metadata service), which protects the credentials from some server-side request forgery attacks.
Q30. What is AWS STS, and what are temporary credentials?
AWS STS (Security Token Service) issues temporary security credentials. These are an access key, a secret key and a session token that expire after a set time, from 15 minutes to a few hours, and up to 12 hours for some roles.
You get them by assuming a role (AssumeRole), signing in with SSO, or swapping an outside identity token (AssumeRoleWithWebIdentity, used by GitHub Actions OIDC and Kubernetes pods). They are safer than long-term keys, because a leaked credential stops working soon by itself.
Q31. How does a role let one AWS account access another?
You create a role in the target account (account B) with two policies. The trust policy says which principal in account A is allowed to assume the role. The permissions policy says what the role can do in account B.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::111111111111:role/ci-deployer" },
"Action": "sts:AssumeRole"
}]
}
Then a user or role in account A calls sts:AssumeRole and gets temporary credentials for account B, and account A must also allow that call. This is how CI pipelines deploy into many accounts, and how central security teams read logs. For third parties, add an ExternalId condition to avoid the “confused deputy” problem.
Q32. What are Service Control Policies (SCPs)?
SCPs are policies in AWS Organizations that set the maximum permissions for accounts in an organisational unit. They do not give any permissions themselves. They only limit what IAM policies in those accounts can allow, even for the account’s own admin.
For example, an SCP can deny leaving the organisation, deny turning off CloudTrail, or deny using Regions outside India and Europe. They are strong guardrails. Resource Control Policies (RCPs) are a newer, similar feature that limits access to resources, such as S3 buckets, across the organisation.
Q33. What is IAM Identity Center?
IAM Identity Center (formerly AWS SSO) is the recommended way for people to sign in to AWS accounts. You connect it to your company directory, such as Microsoft Entra ID, Okta or Google Workspace, or use its built-in directory.
Admins create permission sets, such as “ReadOnly” or “Developer”, and assign them to users or groups in specific accounts. Users sign in once through a portal and pick the account and role. The CLI also supports it with aws sso login. So there are no IAM users with passwords or long-lived keys to manage.
Q34. What is AWS KMS, and what is envelope encryption?
AWS KMS (Key Management Service) creates and manages encryption keys and controls who can use them. Keys never leave KMS unencrypted, and every use is logged in CloudTrail. Most AWS services, such as S3, EBS, RDS and DynamoDB, use KMS to encrypt data at rest.
Envelope encryption is how KMS encrypts large data efficiently. KMS creates a data key, your data is encrypted locally with that data key, and the data key itself is encrypted with a KMS key (the “envelope”). You store the encrypted data key next to the data. To decrypt, you ask KMS to decrypt the small data key, then use it locally. So large data never travels to KMS.
Q35. What is the difference between Secrets Manager and Systems Manager Parameter Store?
Both store configuration and secrets, but they target different needs.
| Feature | Secrets Manager | Parameter Store |
|---|---|---|
| Main purpose | Secrets such as database passwords and API keys | Config values and simple secrets |
| Automatic rotation | Built in, such as for RDS passwords | Not built in |
| Cross-account sharing | Yes, with resource policies | Limited |
| Cost | Charged per secret per month and per API call | Standard parameters are free |
| Encryption | Always with KMS | SecureString type uses KMS |
So use Secrets Manager for credentials that should rotate, and Parameter Store for general config and feature flags.
Q36. What do CloudTrail, GuardDuty and Security Hub do?
These three services work together for security monitoring.
- CloudTrail: records API calls made in your account, such as who deleted a bucket and when. It is your audit log. Send an organisation trail to a separate, locked log account.
- GuardDuty: a threat detection service that uses machine learning and threat intelligence on CloudTrail, VPC flow logs, DNS logs and more. It finds things like stolen credentials being used, crypto mining or unusual API calls.
- Security Hub: collects findings from GuardDuty, Inspector, Macie and other tools in one place, and checks your setup against standards such as CIS and AWS Foundational Security Best Practices.
Q37. What is AWS WAF, and what is AWS Shield?
AWS WAF (Web Application Firewall) filters HTTP and HTTPS requests to CloudFront, Application Load Balancers, API Gateway and other services. You write rules, or use managed rule groups, to block attacks like SQL injection, cross-site scripting, bad bots and too many requests from one IP (rate limiting).
AWS Shield protects against DDoS (distributed denial of service) attacks. Shield Standard is free and automatic for all customers, and it protects against common network-layer attacks. Shield Advanced is a paid service with extra protection, a 24/7 response team and cost protection for scaling during an attack.
Compute AWS Interview Questions with Answers
Compute is the heart of most AWS interview questions. These cover servers, load balancers, scaling and containers, so practise drawing how they connect.
Q38. What is Amazon EC2?
Amazon EC2 (Elastic Compute Cloud) gives you virtual servers, called instances, in the cloud. You choose the CPU, memory, storage, operating system and network, start the instance in minutes, and pay per second while it runs.
You get full control of the server, so you can install anything. That also means you manage the OS, patches and scaling yourself, often with tools like Auto Scaling groups and Systems Manager. EC2 is the IaaS building block behind many other AWS services.
Q39. What are EC2 instance families, such as general purpose, compute and memory optimised?
EC2 instance types are grouped into families for different workloads. The name tells you a lot. For example, m7g.large means family m, generation 7, g for Graviton (ARM) processor, size large.
| Family | Letters | Best for |
|---|---|---|
| General purpose | t, m | Web servers, small databases, mixed workloads |
| Compute optimised | c | CPU-heavy work, such as batch jobs and game servers |
| Memory optimised | r, x, z | Large databases, in-memory caches |
| Storage optimised | i, d, im | Fast local disks, such as data warehouses |
| Accelerated computing | p, g, inf, trn | Machine learning, graphics, video |
The t family is burstable. It builds up CPU credits when idle and spends them during bursts, so it suits apps with low average CPU. Graviton (ARM) instances usually give better price-performance, and Go apps cross-compile for them easily.
Q40. What is an AMI?
An AMI (Amazon Machine Image) is a template used to launch EC2 instances. It contains the operating system, settings and any software you installed, plus the storage layout. AWS, other vendors and the community provide many AMIs, such as Amazon Linux 2023 and Ubuntu.
You can also create your own “golden AMI” with your app and agents already installed, so new instances start faster and the same way every time. Tools like EC2 Image Builder or Packer automate this. AMIs belong to a Region, but you can copy them to other Regions.
Q41. What are On-Demand, Reserved, Savings Plans and Spot Instances?
These are the main ways to pay for EC2. They trade flexibility for discount.
| Option | How it works | Discount | Best for |
|---|---|---|---|
| On-Demand | Pay per second, no commitment | None | Short or unpredictable work |
| Savings Plans | Commit to a set dollar amount per hour for 1 or 3 years | Large | Steady usage, flexible across instance types |
| Reserved Instances | Commit to a specific instance type for 1 or 3 years | Large | Steady usage of a known type, also RDS and others |
| Spot Instances | Use spare capacity, can be taken back with 2 minutes’ notice | Up to about 90% | Fault-tolerant, flexible jobs |
A common mix is Savings Plans for the steady base load, On-Demand for normal peaks, and Spot for batch and stateless work.
Q42. When are Spot Instances a good fit, and when are they a bad fit?
Spot Instances are a good fit for work that can be stopped and restarted without harm. Examples are batch processing, CI build runners, image and video rendering, big data jobs, and stateless web servers behind a load balancer, mixed with On-Demand instances.
They are a bad fit for anything that cannot handle sudden loss, such as a single database server, long jobs that cannot save progress, or the only instance of a critical service. To use Spot well, spread across many instance types and AZs, use Auto Scaling groups with mixed instances, and handle the 2-minute interruption notice.
Q43. What is the difference between stopping and terminating an instance?
Stopping an instance shuts it down, like turning off a computer. EBS volumes stay, so data on the root disk is kept, and you can start it again later. You stop paying for compute, but still pay for the EBS storage. When it starts again, it usually moves to new hardware and gets a new public IP unless you use an Elastic IP.
Terminating an instance deletes it for good. By default, the root EBS volume is deleted too, and anything on instance store disks is lost. You can turn on termination protection to avoid deleting important instances by mistake.
Q44. What is user data in EC2?
User data is a script or cloud-init config that runs automatically when an instance launches for the first time. It is used to install packages, download your app, set up config and start services.
#!/bin/bash
dnf update -y
dnf install -y nginx
systemctl enable --now nginx
It runs as root and by default only on the first boot. Do not put secrets in user data, because anyone with permission to describe the instance can read it. Fetch secrets from Secrets Manager or Parameter Store using the instance role instead.
Q45. What is an Elastic IP address?
An Elastic IP is a static public IPv4 address that belongs to your account until you release it. You can attach it to an instance or network interface, and move it to another instance if the first one fails, so the public address stays the same.
AWS charges for all public IPv4 addresses, including Elastic IPs, whether in use or not, because IPv4 addresses are scarce. So in most designs, use a load balancer or DNS names instead of Elastic IPs, and release any you do not need.
Q46. What is a security group?
A security group is a virtual firewall for EC2 instances, load balancers, RDS databases and other resources. It has inbound and outbound rules that allow traffic by protocol, port and source, such as “allow TCP 443 from anywhere” or “allow TCP 5432 from the app security group”.
Security groups are stateful, so if a request is allowed in, the response is allowed out automatically. They only have allow rules, and everything else is denied. A best practice is to reference other security groups as sources instead of IP addresses, for example only the app servers’ security group can reach the database.
Q47. What is Elastic Load Balancing, and what are ALB, NLB and Gateway Load Balancer?
Elastic Load Balancing spreads incoming traffic across many targets, such as EC2 instances, containers, IP addresses or Lambda functions, in several AZs. It removes unhealthy targets automatically.
| Type | Layer | Best for |
|---|---|---|
| Application Load Balancer (ALB) | Layer 7 (HTTP, HTTPS, gRPC) | Web apps and APIs, routing by path or host |
| Network Load Balancer (NLB) | Layer 4 (TCP, UDP, TLS) | Very high performance, static IPs, non-HTTP traffic |
| Gateway Load Balancer (GWLB) | Layer 3 | Third-party firewalls and inspection appliances |
The older Classic Load Balancer is legacy and should not be used for new apps.
Q48. When would you choose an ALB over an NLB?
Choose an ALB when you work with HTTP or HTTPS and need smart routing. It can route by URL path (/api to one service, /images to another), by host name, header or query string. It also supports WebSockets, gRPC, redirects, fixed responses, authentication with Cognito or OIDC, and AWS WAF.
Choose an NLB when you need raw TCP or UDP, extreme performance with very low latency, a static IP per AZ (or Elastic IPs), or when you must keep the client’s source IP. Examples are game servers, MQTT for IoT, or putting a private service behind AWS PrivateLink.
Q49. What is an Auto Scaling group?
An Auto Scaling group (ASG) manages a fleet of EC2 instances. You set a minimum, maximum and desired number of instances and a launch template that describes how to create them. The ASG keeps the desired number running across your chosen AZs.
If an instance fails a health check, the ASG replaces it automatically. With scaling policies, it adds instances when load rises and removes them when load falls. Attach it to a load balancer target group, so new instances get traffic once they are healthy.
Q50. What are target tracking, step and scheduled scaling policies?
These are the main ways an Auto Scaling group decides when to scale.
- Target tracking: you set a target, such as “average CPU at 50%”, and AWS adds or removes instances to stay near it. It is the simplest and most common.
- Step scaling: you set CloudWatch alarm thresholds with steps, such as “add 2 instances above 70% CPU, add 4 above 90%”.
- Scheduled scaling: change capacity at set times, such as scaling up at 9 AM on weekdays before office traffic.
- Predictive scaling: uses machine learning on past traffic to scale up before expected daily peaks.
You can combine them, such as scheduled scaling for known peaks plus target tracking for surprises.
Q51. What is a health check, and how does Auto Scaling use it?
A health check tests whether an instance is working. EC2 status checks look at the hardware and the OS. Load balancer health checks send requests, such as GET /healthz, to each target and mark it unhealthy if it fails several times in a row.
The load balancer stops sending traffic to unhealthy targets. If the ASG is set to use load balancer health checks, it also terminates unhealthy instances and launches new ones. A health check grace period gives new instances time to start before checks count.
Q52. What are ECS and EKS, and how are they different?
Both run containers on AWS. Amazon ECS (Elastic Container Service) is AWS’s own container orchestrator. Amazon EKS (Elastic Kubernetes Service) is managed Kubernetes.
| Feature | ECS | EKS |
|---|---|---|
| Orchestrator | AWS’s own | Standard Kubernetes |
| Learning curve | Simpler | Steeper |
| Portability | AWS only | Works with Kubernetes tools anywhere |
| Ecosystem | AWS integrations | Huge Kubernetes ecosystem (Helm, Argo CD) |
| Control plane cost | No extra charge | Hourly charge per cluster |
Both can run on EC2 instances or Fargate. Pick ECS for a simple, AWS-only setup, and EKS if you already use Kubernetes or need its ecosystem and portability.
Q53. What is AWS Fargate?
Fargate is a serverless compute engine for containers. You define the CPU and memory for each task (ECS) or pod (EKS), and AWS runs it without you creating or managing any EC2 instances. You pay for the vCPU and memory your containers use, per second.
It removes server work such as patching, scaling the cluster and choosing instance types. The trade-offs are a higher price per unit than well-used EC2, less control (no privileged containers or DaemonSets on EKS Fargate), and some limits on special hardware such as GPUs.
Q54. What is Elastic Beanstalk?
AWS Elastic Beanstalk is a platform as a service (PaaS) for web apps. You upload your code, for example a Go, Java, Node.js or Python app, or a Docker image, and Beanstalk creates and manages the EC2 instances, load balancer, Auto Scaling group and monitoring for you.
It is a quick way to get a simple app running without deep AWS knowledge, and you can still see and adjust the underlying resources. Many new projects today choose ECS with Fargate or Lambda instead, but Beanstalk still appears in interviews and older systems.
Serverless AWS Interview Questions with Answers
Serverless lets you run code without managing servers. These AWS interview questions cover Lambda, API Gateway and the services that tie event-driven apps together.
Q55. What is AWS Lambda?
AWS Lambda runs your code in response to events, without you managing any servers. You upload a function, written in Go, Python, Node.js, Java or other languages, or as a container image. AWS runs it when an event arrives, scales it automatically, and you pay only for the number of requests and the time your code runs.
Think of a light with a motion sensor. It only turns on when someone walks by and turns off after, so you pay only for the time it is on. Lambda works the same way for code. Go functions on Lambda use the provided.al2023 runtime with a binary named bootstrap.
package main
import (
"context"
"github.com/aws/aws-lambda-go/lambda"
)
type Order struct {
ID string `json:"id"`
Total float64 `json:"total"`
}
func handler(ctx context.Context, o Order) (string, error) {
return "processed order " + o.ID, nil
}
func main() {
lambda.Start(handler)
}
Q56. What are the main Lambda limits, such as the maximum run time?
Knowing the main limits helps you decide when Lambda fits.
| Limit | Value |
|---|---|
| Maximum run time (timeout) | 15 minutes |
| Memory | 128 MB to 10,240 MB (CPU grows with memory) |
Temporary disk (/tmp) | 512 MB by default, up to 10,240 MB |
| Request and response payload (synchronous) | 6 MB |
| Deployment package | 50 MB zipped upload, 250 MB unzipped, or 10 GB as a container image |
| Concurrent runs | Usually 1,000 per Region (new accounts may start lower), can be raised |
The 15-minute limit is the one interviewers ask about most. For longer work, split it into steps with Step Functions, or use ECS, Fargate or AWS Batch.
Q57. What is a cold start, and how do you reduce it?
A cold start happens when Lambda has no ready environment for your function. It must create one, download your code, start the runtime and run your setup code before handling the request. This adds extra latency, from tens of milliseconds to a few seconds. Later requests reuse the warm environment and are fast.
You can reduce cold starts in these ways.
- Use a fast-starting runtime. Go and Rust compiled binaries start very quickly.
- Keep the package small and avoid heavy setup work.
- Create SDK clients and database connections outside the handler, so warm calls reuse them.
- Use provisioned concurrency for latency-sensitive APIs.
- For Java, Python and .NET, use Lambda SnapStart, which starts from a saved snapshot.
- Avoid putting functions in a VPC unless needed. VPC cold starts are much better than they used to be, but extra setup still adds work.
Q58. What is provisioned concurrency?
Provisioned concurrency keeps a set number of Lambda environments initialised and ready all the time, so requests up to that number never hit a cold start. For example, 20 provisioned instances can serve 20 requests at the same moment with steady low latency.
You pay for provisioned concurrency for the whole time it is enabled, even with no traffic, so it costs more. Use it for user-facing APIs with strict latency needs, and schedule it with Application Auto Scaling to raise it during busy hours and lower it at night.
Q59. What triggers can start a Lambda function?
Many AWS services can start a Lambda function, in three main styles.
- Synchronous (wait for a response): API Gateway, Application Load Balancer, Lambda function URLs, Cognito triggers and direct
Invokecalls. - Asynchronous (fire and forget, with retries): S3 events (such as a file upload), SNS, EventBridge rules and schedules, CloudWatch Logs.
- Polling (Lambda reads a stream or queue): SQS, Kinesis, DynamoDB Streams, Amazon MQ and Kafka (MSK or self-managed).
For example, a user uploads a photo to S3, S3 triggers a Lambda function, and the function creates a thumbnail and saves it to another bucket.
Q60. What is Amazon API Gateway, and what are REST, HTTP and WebSocket APIs?
Amazon API Gateway is a managed service for creating, securing and running APIs at any scale. It sits in front of your backend, such as Lambda, HTTP services or other AWS services, and handles routing, authorisation, throttling, CORS and custom domains.
| API type | Best for | Notes |
|---|---|---|
| REST API | Feature-rich public APIs | API keys, usage plans, request validation, caching, WAF |
| HTTP API | Simple, low-cost APIs | Cheaper and faster, JWT authorisers, fewer features |
| WebSocket API | Real-time two-way apps | Chat, live dashboards, notifications |
Choose HTTP APIs for most Lambda backends unless you need REST API features. The default integration timeout is 29 seconds, so long work should be moved to a queue.
Q61. How do you give a Lambda function access to a DynamoDB table?
Use the function’s execution role. Every Lambda function has an IAM role that it assumes when it runs. You attach a least-privilege policy to that role that allows only the actions it needs on that one table.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": ["dynamodb:GetItem", "dynamodb:PutItem", "dynamodb:Query"],
"Resource": [
"arn:aws:dynamodb:ap-south-1:123456789012:table/Orders",
"arn:aws:dynamodb:ap-south-1:123456789012:table/Orders/index/*"
]
}]
}
The AWS SDK inside the function picks up the role’s temporary credentials automatically, so you never store access keys in code or environment variables.
Q62. What is AWS Step Functions?
AWS Step Functions is a service for building workflows that coordinate many steps, such as Lambda functions, ECS tasks and AWS API calls. You define the workflow as a state machine, with steps, choices, parallel branches, waits, retries and error handling, and you can see each run on a visual diagram.
For example, an order workflow can check stock, charge payment, wait for a warehouse callback and send an email, with retries and a refund step if something fails. Standard workflows can run for up to a year, while Express workflows are for fast, high-volume short runs. It is a common answer to “how do you get around Lambda’s 15-minute limit”.
Q63. What is Amazon EventBridge?
Amazon EventBridge is a serverless event bus. Services and apps send events to it, such as “order placed” or “EC2 instance stopped”, and rules match events by their content and send them to targets, such as Lambda, SQS, Step Functions or another account.
It lets services talk without knowing about each other, which is the heart of event-driven design. EventBridge also receives events from many AWS services and SaaS partners, has a scheduler for cron-like jobs, Pipes for connecting sources to targets, and a schema registry.
Q64. When should you not use Lambda?
Lambda is great for short, event-driven work with uneven traffic, but it is not right for everything.
- Long-running jobs over 15 minutes, such as big video processing.
- Steady, high traffic all day, where EC2 or containers are often cheaper.
- Very low, stable latency needs where cold starts are not acceptable and provisioned concurrency is too costly.
- Apps that hold state in memory or keep long-lived connections, such as some game servers.
- Special hardware or OS needs, such as GPUs or custom kernel settings.
- Many database connections without a proxy, because each concurrent function opens its own. RDS Proxy helps here.
The table below compares Lambda with EC2, which is a very common interview question.
| Feature | Amazon EC2 | AWS Lambda |
|---|---|---|
| What you manage | OS, patches, scaling | Only your code |
| Run time | As long as you like | Up to 15 minutes |
| Billing | Per second the server runs | Per request and run time |
| Scaling | Auto Scaling groups | Automatic per request |
| Best for | Steady load, long jobs | Events, spiky traffic, small APIs |

So use Lambda for event-driven tasks and APIs with uneven traffic. Choose EC2, ECS or EKS when work runs for a long time or needs full control of the machine.
Storage AWS Interview Questions with Answers
Every app stores files and data. So expect these AWS interview questions in most rounds, especially about S3 security and choosing between S3, EBS and EFS.
Q65. What is Amazon S3?
Amazon S3 (Simple Storage Service) is object storage for any amount of data, such as images, videos, backups, logs and static websites. You store files as objects in buckets, and reach them over HTTPS through the API, SDKs or CLI.
S3 is designed for 99.999999999% (eleven nines) durability, because it stores copies across several AZs. It scales without limits, a single object can be up to 5 TB, and it offers strong read-after-write consistency. You pay for the storage you use, the requests and data transferred out.
Q66. What are buckets, objects and keys?
A bucket is a container for objects. Its name is unique across all of AWS (within a partition), and it lives in one Region. An object is a file plus its metadata, such as content type and tags. A key is the object’s full name inside the bucket.
Bucket: shop-uploads
Key: images/2026/10/product-42.jpg
URL: https://shop-uploads.s3.ap-south-1.amazonaws.com/images/2026/10/product-42.jpg
S3 has no real folders. The slashes in the key are just part of the name, and the console shows them like folders using prefixes.
Q67. What are the S3 storage classes, such as Standard, Intelligent-Tiering, Glacier and Express One Zone?
Storage classes trade price against access speed and availability. You can set the class per object.
| Storage class | Best for | Notes |
|---|---|---|
| S3 Standard | Frequently used data | Default, multi-AZ |
| S3 Intelligent-Tiering | Unknown or changing access | Moves objects between tiers automatically for a small monitoring fee |
| S3 Standard-IA | Rarely used but needs fast access | Cheaper storage, fee per GB retrieved |
| S3 One Zone-IA | Rarely used, easy to recreate | Stored in one AZ only |
| S3 Express One Zone | Very fast, single-digit ms access | One AZ, for high-performance workloads |
| S3 Glacier Instant Retrieval | Archives needing millisecond access | Very cheap storage |
| S3 Glacier Flexible Retrieval | Archives, minutes to hours to restore | Cheaper |
| S3 Glacier Deep Archive | Long-term archives, hours to restore | Cheapest |
So use Standard for active data, Intelligent-Tiering when you are not sure, and Glacier classes for backups and compliance archives.
Q68. What are S3 lifecycle rules?
Lifecycle rules automatically move objects to cheaper storage classes or delete them after a set time, based on age, prefix or tags. They save money without any code.
For example, a log bucket rule might move logs to Standard-IA after 30 days, to Glacier Flexible Retrieval after 90 days, and delete them after 365 days. Rules can also delete old object versions and clean up incomplete multipart uploads, which otherwise cost money silently.
Q69. What is S3 versioning, and why turn it on?
Versioning keeps every version of an object in a bucket. When you overwrite a file, the old version is kept. When you delete a file, S3 adds a “delete marker” and keeps the old versions, so you can restore them.
Turn it on to protect against accidental deletes and overwrites, bugs that write bad data, and ransomware. It is also required for replication. Because old versions cost storage, add lifecycle rules to delete non-current versions after some days. For extra safety, S3 Object Lock can make objects impossible to delete for a set time.
Q70. How does S3 keep data private, with Block Public Access and bucket policies?
S3 buckets and objects are private by default. Several layers control access.
- Block Public Access: account-level and bucket-level settings that override any policy or ACL that would make data public. It is on by default for new buckets, and you should keep it on.
- Bucket policies: resource-based JSON policies that allow or deny access, such as allowing only a CloudFront distribution or one role.
- IAM policies: control what your users and roles can do with S3.
- Object Ownership “bucket owner enforced”: turns off old ACLs, which is the default now.
- Encryption: objects are encrypted at rest by default, and you can use KMS keys for more control.
To serve public files, keep the bucket private and put CloudFront in front with origin access control, instead of making the bucket public.
Q71. What is a presigned URL?
A presigned URL is a temporary link that lets someone download or upload one specific S3 object without AWS credentials. Your backend creates it using its own permissions, and it expires after a set time, such as 15 minutes.
It is the standard way to let users upload files directly to S3 from a browser or mobile app, so large files do not pass through your servers. It is also used to share private files for a short time.
aws s3 presign s3://shop-uploads/invoices/inv-1001.pdf --expires-in 900
Q72. What is S3 cross-region replication?
Cross-region replication (CRR) automatically copies new objects from a bucket in one Region to a bucket in another Region. Same-region replication (SRR) does the same within one Region, such as copying to another account. Versioning must be on for both buckets.
It is used for disaster recovery, lower latency for users in another part of the world, and compliance rules that need copies far apart. Replication is asynchronous, so most objects copy within seconds to minutes, and S3 Replication Time Control offers a time guarantee for an extra fee.
Q73. What is Amazon EBS?
Amazon EBS (Elastic Block Store) gives you block storage volumes that work like hard disks for EC2 instances. A volume lives in one AZ and attaches to an instance in the same AZ. The data stays even when the instance stops.
You use EBS for the operating system disk, databases you run yourself and any app that needs a normal file system on a fast disk. You can resize volumes and change their type while they are in use, and protect them with snapshots.
Q74. What are EBS volume types, such as gp3 and io2?
EBS volume types trade cost against performance.
| Type | Kind | Best for |
|---|---|---|
| gp3 | General purpose SSD | Most workloads, boot disks. Baseline 3,000 IOPS and 125 MB/s, can raise both separately |
| gp2 | Older general purpose SSD | Legacy, performance tied to size, move to gp3 |
| io2 Block Express | Provisioned IOPS SSD | Busy databases needing high, steady IOPS and very low latency |
| st1 | Throughput optimised HDD | Big sequential reads, such as logs and data processing |
| sc1 | Cold HDD | Rarely used data at the lowest cost |
So gp3 is the default choice and is usually cheaper than gp2. Choose io2 for critical databases that need guaranteed performance.
Q75. What is an EBS snapshot?
An EBS snapshot is a point-in-time backup of a volume, stored in S3 behind the scenes. The first snapshot copies all used data, and later snapshots only save the blocks that changed (incremental), which keeps cost down.
You can create new volumes from a snapshot, even in another AZ, copy snapshots to other Regions for disaster recovery, and share them with other accounts. Use Amazon Data Lifecycle Manager or AWS Backup to take and delete snapshots on a schedule.
Q76. What is the difference between EBS, EFS and S3?
These are AWS’s three main storage types, and they suit different needs.
| Feature | EBS | EFS | S3 |
|---|---|---|---|
| Type | Block storage (a disk) | File storage (NFS) | Object storage |
| Access | One EC2 instance (mostly) in one AZ | Many instances across AZs at once | Any client over HTTPS |
| Scaling | You pick the size | Grows and shrinks automatically | Unlimited |
| Best for | OS disks, self-run databases | Shared files, CMS uploads, containers | Backups, media, data lakes, static sites |
| Price | Medium | Higher per GB | Lowest per GB |
So use EBS for a server’s disk, EFS when many servers need the same files, and S3 for everything you access by URL or API.
Q77. What is an instance store, and when do you lose its data?
An instance store is temporary storage on disks physically attached to the host computer that runs your EC2 instance. It is very fast and included in the price of some instance types.
You lose the data when the instance stops, hibernates or terminates, or when the underlying disk fails. A simple reboot keeps it. So use instance store only for temporary data, such as caches, buffers and scratch space, or for data that is copied across several instances, like some distributed databases.
Database AWS Interview Questions with Answers
Every app needs a database, so these AWS interview questions compare the main managed options. Be ready to say which one you would pick for a given app, and why.
Q78. What is Amazon RDS, and which engines does it support?
Amazon RDS (Relational Database Service) runs relational databases for you. AWS handles setup, patching, backups, monitoring and failover, so you focus on your tables and queries instead of servers.
RDS supports these engines: PostgreSQL, MySQL, MariaDB, Oracle, Microsoft SQL Server and IBM Db2, plus Amazon Aurora (MySQL and PostgreSQL compatible). It gives you automated backups with point-in-time restore, read replicas, Multi-AZ high availability and encryption with KMS.
Q79. What is the difference between a Multi-AZ deployment and a read replica?
They solve different problems. Multi-AZ is for high availability, and read replicas are for scaling reads.
| Feature | Multi-AZ | Read replica |
|---|---|---|
| Purpose | Survive an AZ or instance failure | Spread read traffic |
| Replication | Synchronous | Asynchronous (small lag) |
| Can serve reads | Standby: no (Multi-AZ DB clusters: yes, with readable standbys) | Yes |
| Failover | Automatic, usually within a minute or two | Manual promotion |
| Location | Another AZ in the same Region | Same AZ, another AZ or another Region |
So production databases should use Multi-AZ. Add read replicas when read traffic grows, such as reports and dashboards, and remember the app might read slightly old data from a replica.
Q80. What is Amazon Aurora, and how is it different from standard RDS?
Amazon Aurora is AWS’s own cloud-built relational database, compatible with MySQL and PostgreSQL. It separates compute from storage. The storage layer keeps six copies of your data across three AZs and grows automatically up to a very large size.
Compared with standard RDS, Aurora usually gives higher performance, faster failover (often under 30 seconds), up to 15 low-lag read replicas sharing the same storage, and features like Global Database (copies across Regions with about a second of lag), Serverless v2 (capacity that scales automatically) and fast cloning. It costs more per hour than standard RDS for small workloads, so it suits bigger or more critical apps.
Q81. What is Amazon DynamoDB?
Amazon DynamoDB is a fully managed NoSQL key-value and document database. You get single-digit millisecond responses at any scale, with no servers to manage, and it scales automatically. Because it is serverless, you pay for reads, writes and storage.
It is a good fit for high-traffic apps with known access patterns, such as user sessions, shopping carts, gaming leaderboards, IoT data and serverless backends. It supports transactions, TTL for auto-expiring items, point-in-time recovery, global tables across Regions and DynamoDB Streams. Each item can be up to 400 KB.
Q82. What are partition keys and sort keys in DynamoDB?
Every DynamoDB table has a primary key. It is either just a partition key, or a partition key plus a sort key.
- Partition key: DynamoDB hashes it to decide which partition stores the item. It should have many different values, such as
user_id, so traffic spreads evenly. - Sort key: items with the same partition key are stored together, sorted by the sort key. It lets you query ranges, such as all orders of one user in October.
| user_id (partition key) | order_date#order_id (sort key) | total |
|---|---|---|
| U100 | 2026-10-02#A1 | 499 |
| U100 | 2026-10-20#A7 | 1250 |
| U200 | 2026-10-05#B3 | 300 |
Bad partition keys, such as status with only three values, create “hot partitions” that slow down the table.
Q83. What are on-demand and provisioned capacity in DynamoDB?
These are the two ways to pay for DynamoDB reads and writes.
- On-demand: pay per request, with no capacity planning. The table handles traffic changes automatically. Good for new apps, unpredictable traffic and spiky workloads. It is the recommended default for most tables today.
- Provisioned: you set read capacity units (RCU) and write capacity units (WCU), usually with auto scaling. It is cheaper for steady, predictable traffic, and you can buy reserved capacity for more savings.
You can switch a table between the two modes, with some limits on how often.
Q84. What are global secondary indexes and local secondary indexes?
Indexes let you query a table by attributes other than the primary key.
| Feature | Global secondary index (GSI) | Local secondary index (LSI) |
|---|---|---|
| Keys | Any partition key and sort key | Same partition key, different sort key |
| When created | Any time | Only when the table is created |
| Consistency | Eventually consistent reads | Can use strongly consistent reads |
| Capacity | Its own capacity | Shares the table’s capacity |
| Size limit | None | 10 GB per partition key value |
So GSIs are used much more often. For example, a GSI on email lets you find a user by email, even though the table key is user_id.
Q85. What is DynamoDB Streams?
DynamoDB Streams records every change to items in a table (insert, update and delete) in order, for 24 hours. Other services can read the stream and react to changes.
A common pattern is a Lambda function triggered by the stream. For example, when a new order is saved, the function sends a confirmation email, updates a search index or copies data to an analytics store. It is also how global tables replicate data between Regions. Kinesis Data Streams for DynamoDB is an option when you need longer retention.
Q86. What is Amazon ElastiCache, and when do you add a cache?
Amazon ElastiCache is a managed in-memory data store that supports Valkey, Redis OSS and Memcached. It returns data in under a millisecond, much faster than reading from a database. There is also a serverless option that scales automatically.
Add a cache when the same data is read again and again, such as product pages, user sessions, leaderboards or the results of slow queries, and when database load or latency is too high. A cache-aside pattern is common: the app checks the cache, and on a miss reads the database and stores the result with a TTL. For DynamoDB, DAX is a special in-memory cache.
Q87. How do you choose between RDS, Aurora and DynamoDB for a new app?
Start from your data and how you will query it.
| Choose | When |
|---|---|
| RDS (PostgreSQL or MySQL) | Relational data, joins, transactions, moderate scale, lower cost, team knows SQL |
| Aurora | Same as RDS, but higher performance, faster failover, many read replicas or global needs |
| DynamoDB | Simple, known access patterns by key, huge scale, very low latency, serverless apps |
For a typical business app, such as orders, invoices and users with relationships, start with RDS PostgreSQL or Aurora PostgreSQL. For a high-traffic serverless app where you always look things up by ID, DynamoDB is often the best fit. Many systems use both, plus ElastiCache.
Networking AWS Interview Questions with Answers
Networking is where many candidates get stuck. These AWS interview questions start simple and go deeper, so draw a small VPC on paper as you read.
Q88. What is a VPC?
A VPC (Virtual Private Cloud) is your own private, isolated network inside AWS. You choose its IP address range, such as 10.0.0.0/16, split it into subnets, and control traffic with route tables, gateways, security groups and network ACLs.
Think of a VPC as your own gated housing society inside a big city. You decide the roads (routes), the gates (gateways) and who can enter each building (security groups). Every account has a default VPC in each Region for quick starts, but production apps use custom VPCs designed for their needs.
Q89. What is the difference between a public and a private subnet?
A subnet is a range of IP addresses inside a VPC, and each subnet lives in one AZ. In short, a public subnet has a route to an internet gateway, so resources with public IPs can be reached from and can reach the internet. A private subnet has no direct route to the internet.
A typical design puts load balancers and NAT gateways in public subnets, and app servers and databases in private subnets. So the internet can only reach the load balancer, and the database is never directly exposed.
Q90. What is an internet gateway?
An internet gateway is a highly available VPC component that connects the VPC to the internet. It lets resources with public IP addresses in public subnets send and receive internet traffic.
You attach one internet gateway to a VPC, then add a route 0.0.0.0/0 -> igw-xxxx in the public subnet’s route table. It is free, and AWS scales it for you. An egress-only internet gateway is a similar component for IPv6 that allows only outbound connections.
Q91. What is a NAT gateway, and why do private subnets need one?
A NAT (network address translation) gateway lets resources in private subnets connect out to the internet, for example to download updates or call an outside API, while blocking connections coming in from the internet.
You place a NAT gateway in a public subnet and add a route 0.0.0.0/0 -> nat-xxxx in the private subnet’s route table. For high availability, use one NAT gateway per AZ. NAT gateways charge per hour and per GB processed, so they can be a surprise cost. Using VPC endpoints for AWS services such as S3 cuts that traffic.
Q92. What is a route table?
A route table is a set of rules (routes) that decides where network traffic from a subnet goes. Each route has a destination IP range and a target, such as an internet gateway, NAT gateway, VPC peering connection or Transit Gateway.
| Destination | Target | Meaning |
|---|---|---|
| 10.0.0.0/16 | local | Traffic inside the VPC stays local |
| 0.0.0.0/0 | igw-123 | Everything else goes to the internet (public subnet) |
| 0.0.0.0/0 | nat-456 | Everything else goes through NAT (private subnet) |
Every subnet is linked to exactly one route table. The most specific matching route wins.
Q93. What is the difference between a security group and a network ACL?
Both are firewalls, but they work at different levels.
| Feature | Security group | Network ACL |
|---|---|---|
| Applies to | Instance or network interface | Whole subnet |
| State | Stateful (return traffic allowed automatically) | Stateless (must allow both directions) |
| Rules | Allow only | Allow and deny |
| Rule order | All rules checked together | Numbered, checked in order, first match wins |
| Default | Deny all inbound, allow all outbound | Default NACL allows all |
So security groups are your main, everyday firewall. Network ACLs add an extra subnet-level layer, such as blocking a known bad IP range.
Q94. What is VPC peering, and what is a Transit Gateway?
VPC peering connects two VPCs privately, so resources talk using private IPs, even across accounts and Regions. It is simple and has no extra hourly charge. However, it is not transitive: if A peers with B and B peers with C, A cannot reach C through B. With many VPCs, the number of peerings grows very fast.
AWS Transit Gateway is a central hub that connects many VPCs, VPNs and Direct Connect links in a hub-and-spoke design. Each VPC connects once to the hub, and routing is managed centrally. So use peering for a few VPCs and Transit Gateway for many. CIDR ranges must not overlap in either case.
Q95. What are VPC endpoints, and why do they save money and add safety?
VPC endpoints let resources in your VPC reach AWS services privately, without going through the internet, an internet gateway or a NAT gateway.
- Gateway endpoints: for S3 and DynamoDB, added as a route in the route table. These are free.
- Interface endpoints (AWS PrivateLink): a private network interface in your subnet for many other services, such as SQS, Secrets Manager and ECR. Each one charges per hour and per GB.
They save money because traffic to S3 and other services no longer passes through NAT gateways, which charge per GB. They add safety because traffic stays on the AWS network, and endpoint policies can limit which buckets or actions are allowed.
Q96. What is Amazon Route 53, and what are its routing policies?
Amazon Route 53 is AWS’s highly available DNS service. It turns domain names into IP addresses, registers domains, and runs health checks on your endpoints. It also supports alias records that point straight to AWS resources, such as a load balancer or CloudFront distribution.
| Routing policy | What it does |
|---|---|
| Simple | One record, one or more values |
| Weighted | Split traffic by percentage, such as 90/10 for a canary |
| Latency | Send users to the Region with the lowest latency |
| Failover | Send traffic to a backup when the primary health check fails |
| Geolocation | Route by the user’s country or continent |
| Geoproximity | Route by distance, with an adjustable bias |
| Multivalue answer | Return several healthy IPs |
| IP-based | Route by the user’s IP range |
Q97. What is Amazon CloudFront?
Amazon CloudFront is AWS’s content delivery network (CDN). The service caches your content at hundreds of edge locations around the world, so users get images, videos, files and even API responses from a nearby location, with lower latency.
It works with origins such as S3 buckets, load balancers and any HTTP server. It also handles HTTPS certificates, integrates with AWS WAF and Shield for protection, and can run small functions at the edge with CloudFront Functions and Lambda@Edge. A common setup is a private S3 bucket behind CloudFront with origin access control.
Q98. How do you connect an on-premises network to AWS, with VPN or Direct Connect?
There are two main options, and many companies use both.
| Feature | Site-to-Site VPN | AWS Direct Connect |
|---|---|---|
| How | Encrypted tunnel over the public internet | Private, dedicated network link |
| Setup time | Minutes to hours | Weeks |
| Bandwidth | Up to about 1.25 Gbps per tunnel | 1, 10, 100 Gbps and more |
| Consistency | Varies with the internet | Steady, low latency |
| Cost | Low | Higher |
A common design uses Direct Connect as the main link for steady, high-volume traffic, and a VPN as a cheap backup. AWS Client VPN is a separate service for individual users connecting from laptops.
Messaging, Monitoring and Cost AWS Interview Questions with Answers
These AWS interview questions cover how services talk without waiting for each other, how you watch your system and how you keep the bill under control.
Q99. What is Amazon SQS, and what is the difference between standard and FIFO queues?
Amazon SQS (Simple Queue Service) is a fully managed message queue. One part of your system sends messages, and workers read and process them later, at their own pace. This decouples services and smooths out traffic spikes.
| Feature | Standard queue | FIFO queue |
|---|---|---|
| Order | Best effort, may be out of order | Strict order within a message group |
| Delivery | At least once, rare duplicates | Exactly-once processing within a time window |
| Throughput | Nearly unlimited | High, with limits per message group |
| Best for | Most background jobs | Orders, payments, where order matters |
A message can be up to 1 MiB, and messages are kept for up to 14 days. When a worker reads a message, it becomes hidden for the visibility timeout, and the worker deletes it after successful processing. Workers should be idempotent, because a message can arrive twice.
Q100. What is Amazon SNS, and how is it different from SQS?
Amazon SNS (Simple Notification Service) is a pub/sub messaging service. A publisher sends one message to a topic, and SNS pushes a copy to every subscriber at once, such as SQS queues, Lambda functions, HTTP endpoints, email or SMS.
The main difference is push versus pull. SNS pushes each message to many subscribers and does not keep it. SQS stores messages until one consumer pulls and deletes them. A common “fan-out” pattern combines them: an “order placed” message goes to an SNS topic, which sends copies to separate SQS queues for the email, stock and analytics services.
Q101. What is a dead-letter queue?
A dead-letter queue (DLQ) is a separate queue for messages that fail to be processed too many times. In SQS, you set a redrive policy, such as “after 5 failed receives, move the message to the DLQ”.
Without a DLQ, a bad message (a “poison message”) could fail forever, waste resources and block other work. With a DLQ, the main queue keeps flowing, and engineers can inspect the failed messages, fix the bug and send them back with the redrive feature. Lambda, SNS and EventBridge also support DLQs or failure destinations.
Q102. What is Amazon CloudWatch, and what are metrics, logs and alarms?
Amazon CloudWatch is AWS’s main monitoring service. It collects and shows data about your AWS resources and apps.
- Metrics: numbers over time, such as EC2 CPU, Lambda errors or your own custom metrics like orders per minute.
- Logs: text logs from Lambda, ECS, EC2 agents and other sources, which you can search with CloudWatch Logs Insights.
- Alarms: watch a metric and act when it crosses a threshold, such as sending an SNS alert or scaling an Auto Scaling group.
- Dashboards: charts of key metrics in one place.
CloudWatch also offers features like Synthetics canaries that test your website regularly, and Application Signals for app performance.
Q103. What is AWS X-Ray?
AWS X-Ray is a distributed tracing service. It follows a request as it travels through your system, such as from API Gateway to Lambda to DynamoDB, and shows a service map and a timeline of each step. So you can see which part is slow or failing.
Today, AWS recommends instrumenting apps with OpenTelemetry, using the AWS Distro for OpenTelemetry, and sending traces to X-Ray and CloudWatch. In Go, you add OpenTelemetry to your HTTP handlers and AWS SDK clients, and the trace ID flows through context.Context.
Q104. How do you track and lower your AWS bill, with tools such as Cost Explorer and Budgets?
First, see where the money goes, then cut waste.
- Cost Explorer: charts of spending by service, account, Region and tag, with forecasts.
- AWS Budgets: set a budget and get alerts when actual or forecast costs go over it.
- Cost Anomaly Detection: uses machine learning to alert you about unusual spending spikes.
- Cost allocation tags: tag resources by team, project and environment to see who spends what.
- Compute Optimizer and Trusted Advisor: suggest right-sizing and point out idle resources.
Common savings are deleting unused resources (old snapshots, unattached EBS volumes, idle load balancers), right-sizing instances, Savings Plans for steady use, Spot for flexible work, S3 lifecycle rules, Graviton instances, and VPC endpoints to cut NAT gateway charges.
Q105. What is infrastructure as code, with CloudFormation, AWS CDK or Terraform?
Infrastructure as code (IaC) means defining your cloud resources in code files, instead of clicking in the console. You keep the files in Git, review changes in pull requests and create the same setup again and again.
| Tool | Language | Notes |
|---|---|---|
| AWS CloudFormation | YAML or JSON templates | AWS native, manages stacks, drift detection |
| AWS CDK | Go, TypeScript, Python, Java, C# | Write real code, which turns into CloudFormation |
| Terraform (or OpenTofu) | HCL | Works across many clouds and services, large community |
So a team using only AWS may pick CloudFormation or CDK, and a team using several clouds or SaaS tools often picks Terraform. Run IaC through CI/CD, with a plan or change set reviewed before apply.
Scenario AWS Interview Questions with Answers
For each scenario, explain what you would check first, and why. Interviewers care more about your reasoning than a perfect diagram, so talk through trade-offs as you go.
Q106. Your website goes down when one Availability Zone fails. How do you redesign it?
The site has a single point of failure in one AZ. So spread every layer across at least two AZs, ideally three.
- First, put the web or app servers in an Auto Scaling group across subnets in two or three AZs.
- Next, put an Application Load Balancer in front, enabled in the same AZs, so it sends traffic only to healthy instances.
- Then move the database to RDS or Aurora with Multi-AZ, so it fails over automatically.
- Store sessions in ElastiCache or DynamoDB, not on the servers, so any server can handle any user.
- Put static files in S3 behind CloudFront, which are multi-AZ by design.
- Finally, test it by simulating an AZ failure, for example with AWS Fault Injection Service, and add alarms.
Q107. Your AWS bill doubled last month. How do you find the cause?
Start with data, then fix and prevent.
- First, open Cost Explorer and group costs by service, then by account, Region and usage type, and compare with the previous month.
- Next, drill into the service that grew. Common surprises are NAT gateway data processing, data transfer out, new EC2 or RDS instances left running, CloudWatch Logs ingestion, or a test that created many resources.
- Then use tags and CloudTrail to find who created the expensive resources and when.
- Fix the cause, such as stopping unused resources, adding VPC endpoints or reducing log volume.
- Finally, prevent it from happening again with AWS Budgets alerts, Cost Anomaly Detection, required tags and regular cost reviews.
Q108. An S3 bucket was made public by mistake. What do you do now, and how do you stop it next time?
Act fast, then investigate, then prevent.
- Contain: turn on Block Public Access for the bucket at once, and remove any public bucket policy or ACL.
- Investigate: check CloudTrail for who changed the setting and when, and check S3 server access logs or CloudTrail data events to see which objects were downloaded and by whom.
- Assess: find out what data was exposed, such as personal data or secrets, and involve the security and legal teams if needed.
- Rotate: if the bucket held keys or credentials, rotate them.
- Prevent: turn on Block Public Access at the account level, add an SCP that stops anyone from turning it off, use AWS Config rules and Security Hub to detect public buckets, and serve public content only through CloudFront.
Q109. A Lambda function times out when it calls an external API. How do you fix it?
First, find out why it is slow. Check CloudWatch Logs and X-Ray traces to see how long the API call takes and whether it ever succeeds.
Here are common causes and fixes.
- No internet access from a VPC: a function in a private subnet needs a NAT gateway (or a VPC endpoint for AWS services) to reach the internet. Without it, the call hangs until the timeout.
- The API is just slow: set a client timeout shorter than the Lambda timeout, retry with backoff, and raise the Lambda timeout if the work really needs more time.
- Too much work in one call: move the call to an asynchronous flow with SQS or Step Functions, so the user does not wait.
- API rate limits: add a queue to control the call rate.
- Low memory: more memory also gives more CPU and network, which can speed things up.
In Go, use a context with a deadline for the HTTP call, so the function fails cleanly before Lambda kills it.
Q110. Design a photo sharing app on AWS that can grow to one million users.
Start simple, use managed services, and make every layer scale on its own.
- Front end: a React or mobile app. Static web files in S3, served through CloudFront.
- API: API Gateway with Lambda functions, or ECS on Fargate behind an ALB, written in Go. Users sign in with Amazon Cognito.
- Uploads: the API returns a presigned S3 URL, and the client uploads the photo straight to S3.
- Processing: an S3 event triggers a Lambda function (or an SQS queue and workers) that creates thumbnails and checks content, then saves results to another prefix.
- Data: photo metadata, likes and follows in DynamoDB, with keys designed for “get a user’s photos” and “get a feed”. Use RDS or Aurora instead if you need complex relational queries.
- Speed: CloudFront caches images globally, and ElastiCache caches hot feeds and counts.
- Notifications: SNS and EventBridge for events such as new likes, with push notifications to phones.
- Reliability and security: multi-AZ by default, least-privilege IAM roles, private S3 bucket with origin access control, WAF on CloudFront, and backups for DynamoDB.
- Operations: IaC with CDK or Terraform, CI/CD pipelines, CloudWatch dashboards and alarms, and budgets to track cost per user.
Mention trade-offs too. Serverless keeps costs low at the start and scales automatically, while containers can be cheaper at steady high traffic.
Hands-On AWS Interview Questions Practice
Interviewers often ask you to write a least-privilege IAM policy. Here is one that lets an app read and upload files in one S3 folder only. It answers questions 23, 26 and 61.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListOnlyTheUploadsFolder",
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::shop-media-prod",
"Condition": { "StringLike": { "s3:prefix": "uploads/*" } }
},
{
"Sid": "ReadAndWriteUploads",
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:PutObject"],
"Resource": "arn:aws:s3:::shop-media-prod/uploads/*"
}
]
}
The first statement allows listing the bucket, but only keys that start with uploads/. The second allows reading and writing objects inside that folder and nowhere else. There is no s3:DeleteObject, so the app cannot delete files even if someone tricks it.
Next, these are AWS CLI commands you should know without looking them up.
aws sts get-caller-identity # which account and role am I using?
aws configure list # show the active profile and region
aws s3 ls s3://shop-media-prod/uploads/ # list files in a folder
aws s3 cp report.pdf s3://shop-media-prod/uploads/ # upload a file
aws s3 presign s3://shop-media-prod/uploads/report.pdf --expires-in 600 # 10-minute link
aws ec2 describe-instances --filters "Name=tag:app,Values=shop-api" # find servers by tag
aws logs tail /aws/lambda/resize-image --follow # follow Lambda logs live
aws cloudwatch describe-alarms --state-value ALARM # alarms that are firing now
Start any debugging session with aws sts get-caller-identity, because many “access denied” errors come from using the wrong account or role. The presign command answers question 71 in one line.
Common Mistakes in AWS Interview Questions
- Mixing up Regions and Availability Zones: a Region contains several zones.
- Saying security groups can deny traffic: they only have allow rules; NACLs can deny.
- Using the root user or long-lived keys: always prefer roles and temporary credentials.
- Designing in one zone: every design answer should survive the loss of one Availability Zone.
- Ignoring cost: interviewers like candidates who mention cost next to every design choice.
Best Practices for Answering AWS Interview Questions
- Start with the requirement, such as traffic, data size and budget, before naming services.
- Draw the flow from users to load balancer, servers, database and storage.
- Mention security and cost in every design answer, not as an afterthought.
- Use real numbers from your work, such as “we cut the bill by 30 percent with Savings Plans”.
- Link AWS to Docker, Kubernetes and CI/CD, because most teams use all four together.
Practice Task
To practise these AWS interview questions, open a Free Tier account and create an S3 bucket with Block Public Access turned on. Then create an IAM role with the policy above and test it with the CLI. Hint: try to delete a file with that role, and confirm you get an AccessDenied error.
Official Resources
- What is AWS? Overview of Amazon Web Services
- AWS Well-Architected Framework
- IAM user guide
- AWS Lambda developer guide
Quick Recap
- AWS interview questions focus on IAM, compute, storage, databases, networking and cost.
- A Region holds several Availability Zones, and good designs use at least two.
- Prefer IAM roles and least privilege, and never use the root user for daily work.
- Choose EC2 for long-running control and Lambda for short, event-driven work.
- Know when to pick S3, EBS or EFS, and RDS, Aurora or DynamoDB.
- Mention security and cost in every design answer.
- Every one of the 110 questions now has a full answer, with examples you can try.
What’s Next?
You now have question lists for Docker, Kubernetes, CI/CD and AWS. For the frontend side, read our React JS interview questions. Then see how Go apps are built and shipped with the Go deployment interview questions. For every topic in one place, browse the Go interview questions hub.


