AWS interview questions ask more than service names. You need to choose a service, protect it, connect it and explain what happens when it fails. Java developers also need to show how their app gets credentials, opens connections and reports problems.
This page gives 26 AWS interview questions and answers. Cloud service limits and prices change, so the focus here is on choices that last. Check the official AWS documentation for current limits before using a design.
How AWS interview questions change by role
| Level or role | Main focus | Good practice |
|---|---|---|
| Fresher | IAM, EC2, S3, VPC | Draw and build a small app |
| Java developer | Roles, SDK, containers, logs | Deploy one Java service |
| Experienced | Failures, data, cost | Review a past decision |
| 5 years | Recovery and safe change | Design across account and network limits |
For a service choice before learning one cloud in depth, see AWS vs Azure.
AWS basics interview questions and answers
Q1. What is a Region, and what is an Availability Zone?
30-second answer: A Region is a geographic area. It contains separate Availability Zones, which have one or more data centres. Using more than one zone helps an app survive a zone failure.
Data does not automatically copy to another Region for every service. Choose a Region by law, user distance, cost and the services you need.
Q2. What is the shared responsibility model?
30-second answer: AWS protects the cloud's physical base. Customers protect their data, access and settings. The exact split depends on the service.
With EC2, you look after the guest operating system. With Lambda, AWS manages that layer, but you still own your code, permissions and data.
Q3. What is the difference between an IAM user and an IAM role?
30-second answer: An IAM user is a fixed identity. A role is taken by a trusted person, app or service and gives temporary credentials.
Use roles for AWS workloads and, where possible, central login for people. Do not put a permanent access key in code.
Q4. How does IAM decide whether an action is allowed?
30-second answer: Requests are denied by default. A fitting allow can permit the request, but an explicit deny wins. Other limits, such as organization policies, can also restrict it.
Check the policy type and whether the request is in one account or two. Access across accounts normally needs both sides to allow it, with service-specific exceptions.
Q5. How do security groups and network ACLs differ?
30-second answer: A security group acts at a network interface, is stateful and has allow rules. A network ACL acts at a subnet, is stateless and has allow and deny rules.
Because a network ACL is stateless, allow the return traffic too. Security groups handle normal return traffic automatically.
Q6. What makes a subnet public?
30-second answer: Its route table has a route to an internet gateway for internet traffic. An instance normally also needs a public IP and allowed network rules to be reached.
A resource in a private subnet may make outgoing IPv4 requests through a NAT gateway. A VPC endpoint can reach supported AWS services without that public path.
Q7. When would you use S3, EBS and EFS?
30-second answer: S3 stores objects such as files and backups. EBS is block storage for EC2. EFS is a shared file system for Linux workloads.
Use EBS for a server's database disk, S3 for a user's uploaded file and EFS when several servers need normal file access. Compare delay, sharing and cost.
Q8. How do EC2, ECS and Lambda differ?
30-second answer: EC2 gives a virtual server. ECS runs containers. Lambda runs event-based code without server management by you.
Choose from run time, control, traffic and team skill. ECS can run on EC2 or Fargate. A long worker that needs custom system tools may not fit Lambda.
Interview note: "Lambda is always cheaper" is wrong. Compare the real traffic, memory and other service charges.
AWS interview questions for Java developers
The next seven answers connect AWS with daily Java work. Know one example from your own app.
Q9. How should a Java app get AWS credentials?
30-second answer: Give its EC2, ECS or Lambda workload a role. Let the SDK's default provider chain obtain and refresh temporary credentials.
Do not add an access key to Java code, Git or a container image. Give the role only the actions and resources the app needs.
Q10. How do you use an SDK client safely in Java?
30-second answer: Create a client once, reuse it and close it when the app stops. Set suitable timeouts and retries.
The next example uses the AWS SDK for Java 2.x.
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3.S3Client;
public class Storage implements AutoCloseable {
private final S3Client s3 = S3Client.builder()
.region(Region.AP_SOUTH_1)
.build();
@Override
public void close() {
s3.close();
}
}
The default credential chain is used because the code does not set credentials. Real calls need permission and should have tests for failures.
Q11. How do you let a browser upload a large file to S3?
30-second answer: The Java backend checks the user and creates a short-lived presigned upload URL. The browser sends the file straight to S3.
Choose a safe object key on the server, set bucket CORS rules and check the uploaded file before use. A presigned URL does not give a user more access than its signer had.
Q12. How can a Java service reach RDS in a private subnet?
30-second answer: Place both in connected networks and allow the app's security group in the database rules. Use the database endpoint and a connection pool.
Keep the database private. The pool size across all app copies must fit the database limit. Never store a password in the image; use a secret store or a supported IAM login method.
Q13. Why can Java Lambda start slowly, and what can help?
30-second answer: A new environment must load the runtime, classes and app code. A smaller package, less startup work and more memory may help. SnapStart can help supported Java runtimes by using a saved snapshot.
Measure cold starts and normal runs separately. With SnapStart, avoid assuming random values, network connections or temporary credentials made during setup are safe to reuse without care.
Q14. How do you process an SQS message without doing the work twice?
30-second answer: Assume a message may arrive more than once. Save its unique id with the result in one database transaction, or use another safe idempotent method.
Set visibility time longer than the normal work, extend it when needed and delete the message only after success. A dead-letter queue keeps repeated failures for later checks.
Q15. How do you trace a request across Java services?
30-second answer: Pass a trace or request id through calls and logs. Collect metrics and traces so one slow step can be found.
CloudWatch shows logs and metrics. A supported OpenTelemetry setup can send trace data to AWS tools. Remove passwords and personal data from logs. Review load balancing questions for the service-entry side.
Common mistake: Logging a whole request to make debugging easy. It may store secrets and private data for months.
AWS interview questions and answers for experienced
Q16. How does an Application Load Balancer differ from a Network Load Balancer?
30-second answer: An ALB understands HTTP requests and can route by host or path. An NLB handles TCP, UDP or TLS connections and suits low-level traffic needs.
Use an ALB when /api and /images need different HTTP targets. Use an NLB when the protocol is not HTTP and its features match the need. Test health checks too.
Q17. How do RDS Multi-AZ and read replicas differ?
30-second answer: Multi-AZ supports high availability and failover. A read replica copies data for read work, usually with some delay.
The exact Multi-AZ behaviour differs by deployment type. Do not send a read that needs the newest write to a delayed replica. A failover does not replace a tested backup.
Q18. How do SQS, SNS and EventBridge differ?
30-second answer: SQS holds work for consumers. SNS sends a message to many subscribers. EventBridge routes events by rules and connects many sources and targets.
Use SNS with several SQS queues when each consumer needs its own copy and retry path. Check size, ordering and delivery needs instead of choosing by name alone.
Q19. How do you protect data in S3?
30-second answer: Block public access unless it is truly needed, give least access, encrypt data and log important access. Turn on versioning when recovery needs it.
A bucket policy can also require TLS. Versioning helps after some accidental changes, but old versions cost storage and need a lifecycle plan. Encryption does not fix a broad access rule.
Q20. How would you lower an AWS bill?
30-second answer: I find the largest costs and their owners first. Then I remove unused resources, choose a better size and set storage and log retention rules. I check the effect after each change.
Budget alerts give notice but usually do not stop resources. Long-term discounts may help steady use, but compare commitment terms with real usage. Do not put a price from memory into an interview answer.
AWS interview questions and answers for experienced scenario based
Q21. A private EC2 app cannot reach an S3 bucket. What do you check?
30-second answer: Check the exact error, app role, bucket policy, encryption-key permission, DNS, route and endpoint policy. Separate a timeout from an access-denied reply.
A timeout suggests a path issue first. AccessDenied usually means the request reached a policy decision, but more than one policy can matter. Test one layer at a time.
Q22. A load balancer shows 502 errors. What do you do?
30-second answer: Check whether targets are healthy, accept the right protocol and stay open. Match ALB access logs to app logs and find whether targets closed or sent a bad reply.
Compare one good request with one bad request. Adding more instances will not fix a wrong port or app that sends broken headers.
Q23. Messages in SQS are growing. How do you respond?
30-second answer: Check arrival rate, worker success, oldest message age, visibility time and database limits. Add workers only if the next system can handle them.
Find repeated failed messages and send them to a dead-letter queue after a chosen retry limit. Keep work safe to repeat before raising worker count.
Q24. One Availability Zone fails. How should the web app keep working?
30-second answer: Run app copies in at least two zones behind a load balancer. Use an available database setup and enough spare capacity for the remaining zone to handle the load.
Test the failure. Also check NAT gateways, queues and any service the app depends on. "Multi-AZ" in one service does not make the whole app survive.
AWS interview questions for 5 years experience
Q25. How would you recover an app after a Region failure?
30-second answer: Start with the allowed data loss and downtime. Choose backup and restore, a small ready copy, or active service in another Region based on those limits and cost.
Copy data, images, settings and keys as needed. Practise changing DNS and sending traffic. A backup that has never been restored is not a tested recovery plan.
Q26. How would you split a company into AWS accounts?
30-second answer: Separate important workloads or environments, then use an organization for central rules and billing. Use temporary access for people and a separate place for security logs.
Account limits reduce the effect of mistakes. A service control policy limits maximum permissions but does not grant them. Set an owner for each account and test the move in small steps.
Pro tip: At five years, add the operations answer: who gets an alert, what they check and how they undo a bad change.
How to practise AWS interview questions
Build one small Java app with a load balancer, app, private database and logs. Draw each network path. Remove one permission, stop one app copy and restore one backup in a test account. Check the official price before making resources and delete them after practice.
Next, revise Linux commands, DevOps interview questions and Spring Boot questions at five years. If you need a full Java path, see the Java full stack course. Be ready to draw your own AWS work and explain one failure it can survive.
Frequently Asked Questions
Which AWS services should a beginner learn first?
Do I need an AWS certificate to get an interview?
Can I practise AWS without spending money?
What AWS topics should Java developers prepare?
How should I answer an AWS scenario question?
Want to Build Your Career in Java Full Stack with AI?
Join CodeBegun and train with working industry engineers — See the Java Full Stack course in Hyderabad

