Free practice questions

Technical
Interview questions

Prepare for technical interviews with questions by technology, clear explanations, step-by-step solutions and code you can run.

AWS questions
50 questions
25
25 concept questions
25
25 coding questions

AWS technical questions

Master AWS Core Architecture, IAM, EC2, S3, VPC, Serverless, CloudFormation, Boto3 Python, CLI & Terraform.
Total 50 Questions
Part A: Core concept & theory questions
Questions 01 to 25 • Theoretical Foundations
25 Concept Questions

AWS is Amazon's cloud platform. Instead of buying servers, I rent computing, storage, databases and networking over the internet and pay for what I use.

A region is a geographic area, like Mumbai (ap-south-1). An availability zone is a separate data center inside that region. Spreading an app across zones keeps it alive if one data center fails.

AWS secures the cloud itself: hardware, data centers and the core services. I secure what I put in the cloud: my data, access rules, OS patches on EC2 and configuration.

Identity and Access Management controls who can do what in an account. It has users, groups, roles and policies.

A user is a long-term identity with credentials, usually for a person. A role has no permanent password, and something temporary, like an EC2 instance or a Lambda function, assumes it to get short-lived credentials.

A JSON document that lists allowed or denied actions on resources. By default everything is denied, and an explicit deny always beats an allow.

Give only the permissions needed for a job and nothing more. It limits the damage if credentials leak.

Elastic Compute Cloud gives me virtual servers. I pick the instance type, OS and storage, and I'm responsible for what runs inside.

On-Demand is pay as you go. Reserved Instances and Savings Plans give a discount for a 1 or 3 year commitment. Spot uses spare capacity at a big discount but can be interrupted.

Simple Storage Service stores objects like images, backups and logs in buckets. It's very durable, scales without limit and is accessed over HTTP.

Standard is for frequent access. Standard-IA and One Zone-IA are for rare access. Intelligent-Tiering moves data automatically. Glacier classes are cheap archives with slower retrieval.

EBS is a block disk attached to one EC2 instance. S3 is object storage accessed by API. EFS is a shared network file system that many instances can mount.

A Virtual Private Cloud is my own isolated network in AWS, where I control IP ranges, subnets, routing and firewalls.

A public subnet has a route to an internet gateway, so its resources can be reached from the internet. A private subnet has no direct route, and usually goes out through a NAT gateway.

A security group is a stateful firewall on an instance and only has allow rules. A network ACL is a stateless firewall on a subnet and has both allow and deny rules.

It spreads incoming traffic across several targets. ALB works at layer 7 (HTTP) and routes by path or host. NLB works at layer 4 for very high speed. Both check target health.

It adds or removes EC2 instances automatically based on rules like CPU load or a schedule, so the app stays responsive and costs stay down.

Relational Database Service runs databases like MySQL and PostgreSQL for me. AWS handles backups, patching and failover, and I manage the data and queries.

Multi-AZ keeps a standby copy in another zone for automatic failover, so it's about availability. A read replica is a copy that serves read traffic, so it's about performance.

A fully managed NoSQL key-value and document database with very fast, predictable performance at any scale. It's good for simple lookups by key.

A serverless service that runs my code in response to events, like an upload or an API call. I don't manage servers and pay only for the run time.

A service for creating, securing and managing HTTP APIs. It's often placed in front of Lambda functions.

SQS is a queue where consumers pull messages one by one. SNS is publish-subscribe, where one message is pushed to many subscribers. They're often combined.

CloudWatch collects metrics and logs and triggers alarms, so it shows how things are performing. CloudTrail records API calls, so it shows who did what and when.

CloudFormation builds AWS resources from a template file, which is infrastructure as code. The Well-Architected Framework is a set of best-practice pillars: operational excellence, security, reliability, performance efficiency, cost optimization and sustainability.

Part B: Coding questions & algorithm solutions
Questions 01 to 25 • Runnable Solution Scripts
25 Coding Questions

Run aws configure to store access key/secret and aws sts get-caller-identity to inspect current IAM principal.

AWS Solution
aws configure
aws sts get-caller-identity

Use aws s3api create-bucket with LocationConstraint configuration parameter.

AWS Solution
aws s3api create-bucket --bucket my-demo-bucket-2026 \
  --region ap-south-1 \
  --create-bucket-configuration LocationConstraint=ap-south-1

Use high-level aws s3 cp, ls, and rm commands.

AWS Solution
aws s3 cp report.pdf s3://my-demo-bucket-2026/
aws s3 ls s3://my-demo-bucket-2026/
aws s3 cp s3://my-demo-bucket-2026/report.pdf ./copy.pdf
aws s3 rm s3://my-demo-bucket-2026/report.pdf

Use s3api put-bucket-versioning and put-public-access-block.

AWS Solution
aws s3api put-bucket-versioning --bucket my-demo-bucket-2026 \
  --versioning-configuration Status=Enabled

aws s3api put-public-access-block --bucket my-demo-bucket-2026 \
  --public-access-block-configuration \
  BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true

Define JSON lifecycle rule with Transitions and Expiration blocks and apply via put-bucket-lifecycle-configuration.

AWS Solution
/* lifecycle.json */
{
  "Rules": [{
    "ID": "archive-then-delete",
    "Status": "Enabled",
    "Filter": { "Prefix": "" },
    "Transitions": [{ "Days": 90, "StorageClass": "GLACIER" }],
    "Expiration": { "Days": 365 }
  }]
}

# CLI Command:
aws s3api put-bucket-lifecycle-configuration --bucket my-demo-bucket-2026 \
  --lifecycle-configuration file://lifecycle.json

Define JSON IAM policy allowing s3:GetObject and s3:ListBucket on bucket ARN and wildcard objects.

AWS Solution
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": ["s3:GetObject", "s3:ListBucket"],
    "Resource": [
      "arn:aws:s3:::my-demo-bucket-2026",
      "arn:aws:s3:::my-demo-bucket-2026/*"
    ]
  }]
}

Use aws iam create-user and attach-user-policy.

AWS Solution
aws iam create-user --user-name asha
aws iam attach-user-policy --user-name asha \
  --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess

Define assume-role trust document specifying Principal Service ec2.amazonaws.com.

AWS Solution
/* trust.json */
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Principal": { "Service": "ec2.amazonaws.com" },
    "Action": "sts:AssumeRole"
  }]
}

# CLI Command:
aws iam create-role --role-name ec2-s3-read \
  --assume-role-policy-document file://trust.json

Create SSH key pair, authorize HTTP port 80 globally and SSH port 22 for a restricted IP.

AWS Solution
aws ec2 create-key-pair --key-name demo-key \
  --query 'KeyMaterial' --output text > demo-key.pem
chmod 400 demo-key.pem

aws ec2 create-security-group --group-name web-sg --description "Web access"
aws ec2 authorize-security-group-ingress --group-name web-sg \
  --protocol tcp --port 80 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress --group-name web-sg \
  --protocol tcp --port 22 --cidr 203.0.113.10/32

Use aws ec2 run-instances with image ID, instance type, key name, security group, and tags.

AWS Solution
aws ec2 run-instances \
  --image-id ami-0abcdef1234567890 \
  --instance-type t3.micro \
  --key-name demo-key \
  --security-groups web-sg \
  --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=web01}]' \
  --count 1

Shell script installing Nginx, enabling service, and creating initial index.html.

AWS Solution
#!/bin/bash
dnf update -y
dnf install -y nginx
systemctl enable --now nginx
echo "<h1>Hello from AWS</h1>" > /usr/share/nginx/html/index.html

Query instance IDs using describe-instances filter, then run stop-instances and terminate-instances.

AWS Solution
aws ec2 describe-instances \
  --filters Name=instance-state-name,Values=running \
  --query "Reservations[].Instances[].[InstanceId,InstanceType,PublicIpAddress]" \
  --output table

aws ec2 stop-instances --instance-ids i-0123456789abcdef0
aws ec2 terminate-instances --instance-ids i-0123456789abcdef0

Create VPC, add subnet, create IGW, and attach IGW to VPC.

AWS Solution
VPC=$(aws ec2 create-vpc --cidr-block 10.0.0.0/16 --query Vpc.VpcId --output text)
SUBNET=$(aws ec2 create-subnet --vpc-id $VPC --cidr-block 10.0.1.0/24 \
  --query Subnet.SubnetId --output text)
IGW=$(aws ec2 create-internet-gateway --query InternetGateway.InternetGatewayId --output text)
aws ec2 attach-internet-gateway --internet-gateway-id $IGW --vpc-id $VPC

Launch managed RDS MySQL db instance with Secrets Manager password management.

AWS Solution
aws rds create-db-instance \
  --db-instance-identifier demo-db \
  --engine mysql \
  --db-instance-class db.t3.micro \
  --allocated-storage 20 \
  --master-username admin \
  --manage-master-user-password \
  --no-publicly-accessible

Use create-table, put-item, and get-item CLI commands.

AWS Solution
aws dynamodb create-table --table-name Orders \
  --attribute-definitions AttributeName=orderId,AttributeType=S \
  --key-schema AttributeName=orderId,KeyType=HASH \
  --billing-mode PAY_PER_REQUEST

aws dynamodb put-item --table-name Orders \
  --item '{"orderId":{"S":"101"},"total":{"N":"499"}}'

aws dynamodb get-item --table-name Orders --key '{"orderId":{"S":"101"}}'

Define lambda_handler receiving event and context, returning status 200 JSON payload.

AWS Solution
import json

def lambda_handler(event, context):
    name = (event.get("queryStringParameters") or {}).get("name", "friend")
    return {
        "statusCode": 200,
        "headers": {"Content-Type": "application/json"},
        "body": json.dumps({"message": f"Hello, {name}!"}),
    }

Parse S3 event Records array for bucket name and URL-unquoted object key.

AWS Solution
import urllib.parse

def lambda_handler(event, context):
    for record in event["Records"]:
        bucket = record["s3"]["bucket"]["name"]
        key = urllib.parse.unquote_plus(record["s3"]["object"]["key"])
        print(f"New file: s3://{bucket}/{key}")

Use boto3.client(\"s3\") to upload_file and iterate list_objects_v2 response.

AWS Solution
import boto3

s3 = boto3.client("s3")
s3.upload_file("report.pdf", "my-demo-bucket-2026", "docs/report.pdf")

resp = s3.list_objects_v2(Bucket="my-demo-bucket-2026")
for obj in resp.get("Contents", []):
    print(obj["Key"], obj["Size"])

Instantiate boto3.resource(\"dynamodb\").Table and execute put_item and get_item.

AWS Solution
import boto3

table = boto3.resource("dynamodb").Table("Orders")
table.put_item(Item={"orderId": "102", "total": 899})

item = table.get_item(Key={"orderId": "102"}).get("Item")
print(item)

Send SQS message with body, receive message with visibility wait time, and delete after processing.

AWS Solution
import boto3

sqs = boto3.client("sqs")
url = sqs.get_queue_url(QueueName="tasks")["QueueUrl"]

sqs.send_message(QueueUrl=url, MessageBody="resize image 42")

msgs = sqs.receive_message(QueueUrl=url, MaxNumberOfMessages=1, WaitTimeSeconds=5)
for m in msgs.get("Messages", []):
    print(m["Body"])
    sqs.delete_message(QueueUrl=url, ReceiptHandle=m["ReceiptHandle"])

Define AWS::S3::Bucket resource in YAML format with versioning and public access block.

AWS Solution
AWSTemplateFormatVersion: "2010-09-09"
Resources:
  DataBucket:
    Type: AWS::S3::Bucket
    Properties:
      VersioningConfiguration:
        Status: Enabled
      PublicAccessBlockConfiguration:
        BlockPublicAcls: true
        BlockPublicPolicy: true
        IgnorePublicAcls: true
        RestrictPublicBuckets: true
Outputs:
  BucketName:
    Value: !Ref DataBucket

# Deploy Command:
aws cloudformation deploy --template-file bucket.yaml --stack-name demo-bucket

Define provider \"aws\" and resource \"aws_instance\" block in HCL syntax.

AWS Solution
provider "aws" {
  region = "ap-south-1"
}

resource "aws_instance" "web" {
  ami           = "ami-0abcdef1234567890"
  instance_type = "t3.micro"

  tags = {
    Name = "web01"
  }
}

# Commands: terraform init -> terraform plan -> terraform apply

Use aws cloudwatch put-metric-alarm specifying CPUUtilization metric and threshold.

AWS Solution
aws cloudwatch put-metric-alarm \
  --alarm-name high-cpu \
  --namespace AWS/EC2 --metric-name CPUUtilization \
  --dimensions Name=InstanceId,Value=i-0123456789abcdef0 \
  --statistic Average --period 300 --evaluation-periods 2 \
  --threshold 80 --comparison-operator GreaterThanThreshold \
  --alarm-actions arn:aws:sns:ap-south-1:123456789012:alerts

Configure GitHub Actions workflow using OIDC role assumption and aws s3 sync.

AWS Solution
permissions:
  id-token: write
  contents: read

steps:
  - uses: actions/checkout@v4
  - uses: aws-actions/configure-aws-credentials@v4
    with:
      role-to-assume: arn:aws:iam::123456789012:role/github-deploy
      aws-region: ap-south-1
  - run: aws s3 sync ./build s3://my-demo-bucket-2026 --delete

Delete S3 bucket, terminate EC2 instances, delete RDS instance, delete DynamoDB table, and delete CloudFormation stack.

AWS Solution
aws s3 rb s3://my-demo-bucket-2026 --force
aws ec2 terminate-instances --instance-ids i-0123456789abcdef0
aws rds delete-db-instance --db-instance-identifier demo-db --skip-final-snapshot
aws dynamodb delete-table --table-name Orders
aws cloudformation delete-stack --stack-name demo-bucket

No Matching Questions Found

Try searching for keywords like "JWT", "Express", "useEffect", "PDO", "GIL", or "schema".

Technical Panel Preparation

Ready to Benchmark Your Technical Skills?

Connect with DigitalXNode expert interviewers for technical mock interviews, domain assessment, and enterprise job placement.

1