Fun with Learning Technology
LearnCoursesQuestionsTracksToolsNewsExplorePractice
Fun with Learning Technology

A new problem, explained clearly, every day.

Subscribe
Learn
  • Lessons
  • Topics
  • News
  • Tools
  • Courses
  • Career tracks
  • Everything
Site
  • About
  • Contact
  • Support
  • Privacy
  • Terms
Get the daily one

One email per new problem. No spam.

Request a tutorial

Requests shape what gets made next.

© 2026 Fun with Learning TechnologyRSS
Home›Courses›AWS›AWS Interview Questions

Interview Prep

AWS Interview Questions

This guide covers core AWS architectural principles and common interview scenarios designed to test your ability to build scalable and secure systems. Understanding these foundational patterns is crucial for moving beyond simple resource creation toward building enterprise-grade, cost-effective infrastructure. You should master these concepts when preparing for technical roles that require deep knowledge of resource lifecycle management and automated cloud operations.

Identity and Access Management Strategy

In a technical interview, you will likely be asked how to securely manage service-to-service communication. The foundational principle here is the 'Principle of Least Privilege,' which dictates that every identity must possess only the minimum permissions necessary to perform its intended task. When you configure IAM roles for compute instances, you must avoid using hardcoded security keys, as these are static and prone to leakage. Instead, leverage instance profiles that dynamically inject temporary security tokens into the environment. This works by having the service assume a role, which grants a temporary STS session token that automatically rotates. This decoupling of credentials from your application logic ensures that even if an underlying process is compromised, the blast radius is restricted to the specific actions authorized by that role. Always prioritize managed policies over inline policies for better versioning and reusability across your environment.

# Example of attaching an IAM Role to an instance profile via infrastructure code
resource "aws_iam_role" "app_role" {
  name = "web_server_role"
  assume_role_policy = jsonencode({
    Version = "2012-10-17"
    Statement = [{ Action = "sts:AssumeRole", Effect = "Allow", Principal = { Service = "ec2.amazonaws.com" } }]
  })
}

Designing for High Availability

High availability is not a checkbox but a structural design choice meant to eliminate single points of failure. When interviewers ask about designing for uptime, focus on how compute and database resources are distributed across multiple Availability Zones (AZs). By spreading resources across physically isolated data centers, you ensure that a local power or network issue in one facility does not take your entire application offline. To achieve this, you must use load balancers that sit in front of your auto-scaling groups, actively performing health checks to identify and shift traffic away from unhealthy nodes. The reason this works is that the control plane manages the health of the entire fleet, constantly reconciling the desired state with the actual state. When you architect for failure, you ensure that the system can automatically recover from localized outages without manual intervention, thereby maintaining service continuity for end users at all times.

# Defining an Auto Scaling Group across multiple subnets for resilience
resource "aws_autoscaling_group" "web_fleet" {
  vpc_zone_identifier = ["subnet-az1", "subnet-az2"]
  min_size            = 2
  max_size            = 5
  target_group_arns   = [aws_lb_target_group.main.arn]
}

Scalable Data Storage Patterns

Choosing the right storage architecture involves understanding the trade-offs between consistency, availability, and latency. Relational databases are the gold standard for transactional integrity, ensuring that complex queries remain performant through proper indexing and normalization. However, as your read load grows, you will reach the physical limits of a single primary node. The standard strategy here is to implement read replicas, which offload query pressure from the main database. This works because read replicas asynchronously replicate data, allowing the main instance to focus exclusively on write operations. When interviewers question how to handle massive write volumes, suggest horizontal partitioning or shifting to a NoSQL approach. By distributing the data across a partition key, you eliminate the bottleneck of a single disk or CPU. This pattern scales linearly with your data requirements, ensuring that your storage layer never becomes the primary constraint of your application performance.

# Provisioning an RDS instance with a read replica for improved read performance
resource "aws_db_instance" "primary" {
  allocated_storage = 20
  engine            = "postgres"
  instance_class    = "db.t3.medium"
}
resource "aws_db_instance" "replica" {
  replicate_source_db = aws_db_instance.primary.identifier
  instance_class      = "db.t3.medium"
}

Event-Driven Architecture

Transitioning from monolithic request-response cycles to event-driven architectures is a key indicator of seniority. The core objective is decoupling producers from consumers, which allows each part of your system to evolve independently. Using a message queue as an intermediary allows your application to handle traffic spikes by buffering incoming requests that the backend can then process at a controlled rate. The mechanism works by placing a persistent store between the service that sends the event and the worker that processes it, effectively smoothing out load spikes that would otherwise crash a synchronously coupled system. When you discuss this in an interview, emphasize how this pattern increases system fault tolerance; if the processing service fails, the messages remain safely queued until the service is restored, ensuring no data loss occurs during periods of instability.

# Creating a Simple Queue Service to buffer incoming requests
resource "aws_sqs_queue" "task_queue" {
  name                      = "processing-queue"
  message_retention_seconds = 86400 # Retain for 24 hours
  visibility_timeout_seconds = 30   # Time for worker to process
}

Security at the Network Perimeter

The final layer of defense for any architecture is the network perimeter. Interviewers will test your understanding of how to protect sensitive subnets. The secret is to use security groups as stateful firewalls around compute instances, while using Network Access Control Lists (NACLs) as stateless sub-level traffic filters. Security groups are stateful, meaning that if you allow an inbound request, the response is automatically permitted regardless of outbound rules. This works because the underlying infrastructure tracks the flow state of individual packets. Conversely, NACLs are stateless, meaning you must explicitly define both inbound and outbound rules for every traffic flow. By layering these defenses, you create a "defense-in-depth" strategy where the compromise of one perimeter does not lead to total system exposure. This structure provides fine-grained control over which services can talk to each other, ensuring that internal microservices are isolated from the public internet.

# Defining a security group rule that restricts access to port 443
resource "aws_security_group" "web_sg" {
  ingress {
    from_port   = 443
    to_port     = 443
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }
}

Key points

  • Always apply the principle of least privilege when assigning IAM roles to services.
  • Distribute compute resources across multiple Availability Zones to ensure high availability.
  • Utilize read replicas to offload read-heavy traffic from the primary database instance.
  • Implement decoupling through message queues to buffer traffic spikes and prevent system crashes.
  • Prefer stateful security groups over stateless NACLs for managing application-level traffic flow.
  • Use auto-scaling groups to reconcile the desired capacity with actual load automatically.
  • Avoid storing sensitive credentials in plain text or hardcoded within source control repositories.
  • Design systems for graceful failure to ensure that local outages do not affect the overall user experience.

Common mistakes

  • Mistake: Confusing S3 consistency with eventual consistency. Why it's wrong: S3 now offers strong read-after-write consistency for all operations. Fix: Assume immediate consistency for all object uploads and deletes.
  • Mistake: Misunderstanding IAM role assumption. Why it's wrong: Users assume roles are static permissions attached to users, rather than temporary credentials. Fix: Treat IAM roles as transient security tokens assigned to entities that need permission escalation.
  • Mistake: Treating EC2 instances as persistent servers. Why it's wrong: Instances can be terminated, making local storage volatile. Fix: Design for stateless applications and offload state to persistent storage like EFS, RDS, or DynamoDB.
  • Mistake: Over-provisioning RDS instances. Why it's wrong: RDS can be scaled vertically or horizontally via read replicas. Fix: Start small and use Performance Insights to monitor needs before upgrading instance classes.
  • Mistake: Neglecting the Shared Responsibility Model. Why it's wrong: Assuming AWS manages data encryption and access control for all services. Fix: Recognize that AWS manages the 'security of the cloud' while the customer manages 'security in the cloud'.

Interview questions

What is the primary difference between AWS Lambda and Amazon EC2?

AWS Lambda is a serverless compute service that executes code in response to events without requiring you to manage underlying infrastructure. You only pay for the request count and duration of code execution. Conversely, Amazon EC2 provides resizable virtual server capacity, giving you full control over the operating system, networking, and security configurations. You choose Lambda when you need event-driven scalability and zero administration, whereas you select EC2 when you require specific hardware configurations, long-running processes, or deep customization of the server environment.

How does an Application Load Balancer differ from a Network Load Balancer in AWS?

An Application Load Balancer operates at Layer 7 of the OSI model, making routing decisions based on request content like HTTP headers, path patterns, or hostnames, which is ideal for microservices and web applications. A Network Load Balancer operates at Layer 4, handling millions of requests per second with ultra-low latency by routing based on IP addresses and TCP/UDP ports. You choose an Application Load Balancer for flexible, content-aware routing, while you use a Network Load Balancer for high-performance throughput and extreme scalability requirements.

Explain the purpose of an IAM Role and how it differs from an IAM User.

An IAM User is a long-term identity linked to a specific person or service, typically utilizing static access keys or passwords. An IAM Role is an identity with specific permissions that does not have credentials associated with it; instead, it is assumed dynamically by users, applications, or AWS services. Using roles is the security best practice because they provide temporary security credentials, reducing the risk associated with long-lived keys. For example, a role attached to an EC2 instance allows the code running there to securely access S3 buckets without hardcoding any sensitive credentials.

What is the function of Amazon S3 Versioning, and why should it be enabled in production environments?

Amazon S3 Versioning keeps multiple variants of an object in the same bucket, allowing you to preserve, retrieve, and restore every version of every object stored. It is critical for production because it acts as a safeguard against accidental overwrites or malicious deletions. If a user inadvertently deletes a file, S3 simply inserts a delete marker; you can then remove that marker to restore access to the previous version. This provides a fundamental layer of data recovery and protection for business-critical storage architectures.

Compare the use cases for Amazon RDS versus Amazon DynamoDB.

Amazon RDS is a managed relational database service that supports structured data using SQL, providing ACID compliance and complex join capabilities, making it ideal for traditional business applications and ERP systems. Amazon DynamoDB is a fully managed NoSQL database service that provides consistent single-digit millisecond latency at any scale using key-value or document models. You should choose RDS when you require relational integrity and complex queries, whereas you choose DynamoDB for massive scale, unpredictable traffic patterns, and high-velocity read/write operations where a schema-less approach is beneficial.

Describe the implementation of a Blue/Green deployment strategy using AWS services.

A Blue/Green deployment minimizes downtime by running two identical production environments. The 'Blue' environment represents the current live version, while the 'Green' environment hosts the new version. You use Route 53 to manage weighted DNS routing to shift traffic from Blue to Green gradually. If testing in the Green environment reveals issues, you immediately shift traffic back to Blue. This pattern ensures high availability and reliable rollbacks, often orchestrated via AWS CodeDeploy to automate the deployment lifecycle and status checks of the instances.

All AWS interview questions →

Check yourself

1. An application requires high-performance block storage that can be attached to multiple EC2 instances simultaneously. Which solution should be used?

  • A.Amazon EBS
  • B.Amazon EFS
  • C.Instance Store
  • D.Amazon S3
Show answer

B. Amazon EFS
EFS provides a managed NFS file system that supports simultaneous connections from multiple instances. EBS is limited to a single instance connection. Instance Store is ephemeral and local, while S3 is object storage, not block storage.

2. A web application's traffic fluctuates drastically throughout the day. Which approach provides the most cost-effective scalability for EC2 instances?

  • A.Manually scaling instances based on a fixed schedule
  • B.Using an Auto Scaling group with a target tracking policy
  • C.Provisioning for peak load at all times
  • D.Using a single large instance class to handle all traffic
Show answer

B. Using an Auto Scaling group with a target tracking policy
Target tracking scaling policies automatically adjust capacity to maintain a specific metric, ensuring cost efficiency. Manual schedules are static and inflexible. Provisioning for peak is wasteful, and a single instance creates a bottleneck.

3. A developer needs to ensure that data stored in S3 is encrypted at rest automatically. Which is the most appropriate configuration?

  • A.Client-side encryption using a local library
  • B.Configuring S3 Bucket Keys
  • C.Enabling Server-Side Encryption (SSE-S3 or SSE-KMS)
  • D.Using an S3 access point for each object
Show answer

C. Enabling Server-Side Encryption (SSE-S3 or SSE-KMS)
Server-Side Encryption is handled by S3 transparently at the platform level. Client-side encryption adds overhead to the application. Bucket keys optimize performance but are not the primary mechanism for encryption. Access points are for network control, not encryption.

4. What is the primary benefit of using a VPC Endpoint instead of an Internet Gateway for private instance access to S3?

  • A.It provides faster upload speeds for individual objects
  • B.It eliminates the need for an IAM role
  • C.It ensures traffic never leaves the AWS private network
  • D.It reduces the cost of every request to S3
Show answer

C. It ensures traffic never leaves the AWS private network
VPC Endpoints allow private communication with AWS services within the internal network, improving security and performance. It does not replace IAM roles. While it saves on NAT Gateway data processing charges, the primary benefit is network isolation.

5. If an RDS instance experiences a sudden spike in read requests, which architectural change is best suited to improve performance without affecting write performance?

  • A.Converting the database to Multi-AZ
  • B.Scaling up to a larger instance class
  • C.Creating an RDS Read Replica
  • D.Migrating data to an S3 bucket
Show answer

C. Creating an RDS Read Replica
Read Replicas are specifically designed to offload read-heavy traffic from the primary instance. Multi-AZ is for high availability and failover, not read performance. Scaling up increases costs for both read and write operations. S3 is not a relational database replacement.

Take the full AWS quiz →

← PreviousAWS CDK and CloudFormation — IaCNext →AWS Architecture Design Questions

AWS

24 lessons, free to read.

All lessons →

Track your progress

Sign in to mark lessons done, score quizzes and keep notes.

Open in the app