Learn AWS Architect core architecture, production scenario-based questions, incident response, and real-world engineering solutions.
❓ Q1: What is AWS CloudFormation?
Click on the dropdown below to reveal the technical answer.
Answer: AWS CloudFormation is an AWS-native Infrastructure as Code (IaC) service. It allows you to model, provision, and manage AWS and third-party resources in a safe, repeatable, and automated manner using declarative template files written in JSON or YAML format.
❓ Q2: What are the uses of CloudFormation?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q3: What is the difference between CloudFormation and Terraform?
Click on the dropdown below to reveal the technical answer.
Answer:
| Feature | AWS CloudFormation | HashiCorp Terraform |
|---|---|---|
| Provider Support | Exclusively AWS (and some custom third-party extensions). | Cloud-agnostic (AWS, Azure, GCP, Kubernetes, SaaS tools). |
| Language | JSON or YAML. | HashiCorp Configuration Language (HCL). |
| State Management | Handled natively and automatically by AWS under the hood. | Stored in a state file (.tfstate) managed by the engineer (stored locally or in remote backends like S3/DynamoDB). |
| Tool Type | Managed cloud service. | Client-side CLI tool. |
| Ecosystem & Modules | Nested stacks and StackSets. | Huge community registry of pre-built reusable modules. |
❓ Q4: What is the AWS Shared Responsibility Model?
Click on the dropdown below to reveal the technical answer.
Answer: The AWS Shared Responsibility Model outlines the division of security duties between AWS and the customer:
❓ Q5: What responsibilities belong to AWS vs the customer?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q6: What is the difference between Security Groups and NACLs?
Click on the dropdown below to reveal the technical answer.
Answer:
| Feature | Security Group (SG) | Network ACL (NACL) |
|---|---|---|
| Placement | Attached at the Instance/ENI level. | Attached at the Subnet level. |
| Statefulness | Stateful (Return traffic is automatically allowed). | Stateless (Outbound return traffic must be explicitly allowed). |
| Rules Support | Allow rules only (default denies all other traffic). | Allow AND Deny rules (e.g., block specific IP addresses). |
| Evaluation | Evaluates all rules before deciding to allow traffic. | Evaluates rules sequentially in numerical order (lowest number first). |
❓ Q7: What is the difference between Stateful and Stateless firewalls?
Click on the dropdown below to reveal the technical answer.
Answer:
1024-65535).❓ Q8: When should Security Groups be used?
Click on the dropdown below to reveal the technical answer.
Answer: Use Security Groups for instance-specific, fine-grained access control:
❓ Q9: When should NACLs be used?
Click on the dropdown below to reveal the technical answer.
Answer: Use NACLs as a broad subnet-level firewall/guardrail:
❓ Q10: Which service automatically allows return traffic?
Click on the dropdown below to reveal the technical answer.
Answer: Security Groups automatically allow return traffic because they are stateful firewalls.
❓ Q11: How do you create a Public Subnet?
Click on the dropdown below to reveal the technical answer.
Answer:
0.0.0.0/0 to an Internet Gateway (IGW) attached to the VPC."Auto-assign public IPv4 address" for instances launched within that subnet.❓ Q12: How do you create a Private Subnet?
Click on the dropdown below to reveal the technical answer.
Answer:
0.0.0.0/0 (isolated private subnet).0.0.0.0/0 targeting a NAT Gateway placed in a public subnet (private subnet with outbound internet access)."Auto-assign public IPv4 address" is disabled.❓ Q13: What is the purpose of an Internet Gateway?
Click on the dropdown below to reveal the technical answer.
Answer: An Internet Gateway (IGW) is a horizontally scaled, redundant, and highly available VPC component that enables communication between resources in your VPC and the public internet. It provides a target in VPC route tables for internet-routable traffic and performs Network Address Translation (NAT) for instances assigned public IPv4 addresses.
❓ Q14: What is the purpose of a NAT Gateway?
Click on the dropdown below to reveal the technical answer.
Answer: A NAT Gateway (Network Address Translation) allows instances in a private subnet to connect outbound to the internet or other AWS services (e.g., for security updates, patch downloads, or API integrations) but prevents the internet from initiating inbound connections to those instances.
❓ Q15: How do you provide Internet access to a private EC2 instance for updates only?
Click on the dropdown below to reveal the technical answer.
Answer:
0.0.0.0/0 -> Target nat-xxxxxxxx (the NAT Gateway ID).❓ Q16: Why keep databases in private subnets?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q17: How do you allow an EC2 instance to access an S3 bucket?
Click on the dropdown below to reveal the technical answer.
Answer:
ec2.amazonaws.com) to assume the role.s3:GetObject, s3:PutObject on the target bucket ARN).❓ Q18: Why use IAM Roles instead of Access Keys?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q19: What is the Principle of Least Privilege?
Click on the dropdown below to reveal the technical answer.
Answer: The Principle of Least Privilege (PoLP) is a security standard where users, service accounts, and applications are granted only the minimum level of access and permissions required to perform their designated tasks, and absolutely nothing more.
❓ Q20: Why is Least Privilege important?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q21: How do you monitor AWS resources?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q22: What is Amazon CloudWatch?
Click on the dropdown below to reveal the technical answer.
Answer: Amazon CloudWatch is a monitoring and management service designed for developers, system administrators, and DevOps engineers. It collects system-level performance metrics, gathers application log files, tracks events, and allows you to set alarms to automate responses to resource utilization spikes.
❓ Q23: How do you view live logs in AWS?
Click on the dropdown below to reveal the technical answer.
Answer:
aws logs tail <log-group-name> --follow in the command terminal.❓ Q24: What is AWS CloudTrail?
Click on the dropdown below to reveal the technical answer.
Answer: AWS CloudTrail is an auditing and compliance service that records all API actions taken within an AWS account. It logs the caller identity, the time of the call, the source IP address, the request parameters, and the response. It answers the question: "Who did what, when, and from where in my AWS account?"
❓ Q25: How do you configure CloudWatch Alarms?
Click on the dropdown below to reveal the technical answer.
Answer:
CPUUtilization for an EC2 instance).❓ Q26: How do CloudWatch Alarms work with SNS?
Click on the dropdown below to reveal the technical answer.
Answer:
When a monitored metric breaches the defined threshold, the CloudWatch Alarm transitions to the ALARM state. CloudWatch automatically publishes an alert payload to the associated SNS (Simple Notification Service) Topic. SNS then broadcasts that alert to all registered subscribers (e.g., sending emails to developers, triggers a PagerDuty web hook, or executing an AWS Lambda script to auto-remediate the issue).
❓ Q27: How would you deploy and scale a web application with increasing traffic?
Click on the dropdown below to reveal the technical answer.
Answer: Deploy a multi-AZ scalable web application:
❓ Q28: Why use an Application Load Balancer (ALB)?
Click on the dropdown below to reveal the technical answer.
Answer:
/api vs /static), host headers, or query parameters.❓ Q29: What is an Auto Scaling Group?
Click on the dropdown below to reveal the technical answer.
Answer: An Auto Scaling Group (ASG) is a collection of EC2 instances managed as a logical unit. It maintains a defined number of instances by monitoring instances' health and automatically replacing terminated ones. It scales the number of instances up or down dynamically based on user traffic and performance metrics.
❓ Q30: How does Auto Scaling work with CloudWatch?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q31: Why not use a single EC2 instance?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q32: Why use ECS instead of EC2?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q33: Why use EKS instead of ECS?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q34: When should you choose EC2, ECS, or EKS?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q35: How do you manage multiple environments (Dev, QA, Prod) in Terraform?
Click on the dropdown below to reveal the technical answer.
Answer:
environments/dev/main.tf and environments/prod/main.tf). This isolates state files entirely.terraform workspace select dev). Not recommended for prod isolation because variables and configs are shared, increasing human error risks.❓ Q36: What are Terraform modules?
Click on the dropdown below to reveal the technical answer.
Answer:
A Terraform Module is a container for multiple resources that are used together. It is simply a directory containing .tf files. Modules allow you to package, parameterize, and reuse infrastructure blocks (e.g., a standardized VPC setup or autoscaling group configuration) across different projects and environments, enforcing DRY (Don't Repeat Yourself) principles.
❓ Q37: What are .tfvars files?
Click on the dropdown below to reveal the technical answer.
Answer:
.tfvars files are configuration files used to pass values to variables defined in your Terraform code. They allow you to separate logic from configuration parameters. For example, you can have a single variables.tf file, but use dev.tfvars (containing instance_type = "t3.micro") and prod.tfvars (containing instance_type = "c5.large") to deploy different sizes of servers.
❓ Q38: Why use separate Terraform state files?
Click on the dropdown below to reveal the technical answer.
Answer:
terraform plan and terraform apply.❓ Q39: What is remote state storage?
Click on the dropdown below to reveal the technical answer.
Answer:
By default, Terraform writes state data to a local file (terraform.tfstate). Remote state storage writes the state file to a shared, remote location (such as Amazon S3, Google Cloud Storage, or Terraform Cloud). This enables teams to collaborate, secure state from local leakage, and leverage automated locking.
❓ Q40: Why use S3 and DynamoDB for Terraform state?
Click on the dropdown below to reveal the technical answer.
Answer:
.tfstate file. It supports encryption at rest and versioning, allowing you to roll back to a previous state file if the current one is corrupted.terraform apply is executed, Terraform locks the state file using a DynamoDB table entry, preventing other engineers from executing concurrent plans that could corrupt the state file.❓ Q41: What are Terraform Workspaces?
Click on the dropdown below to reveal the technical answer.
Answer: Terraform Workspaces allow you to manage multiple distinct state files (representing different environments) using the exact same configuration directory. When in a workspace, Terraform appends the workspace name to the state path. While useful for creating transient, short-lived test environments, they are generally avoided for separating production and development stacks due to overlapping configuration risk.
❓ Q42: How do you use Bash scripts in a CI/CD pipeline?
Click on the dropdown below to reveal the technical answer.
Answer: Bash scripts are used in pipelines to automate sequential, repetitive, or CLI-based tasks:
docker build and pushing to Amazon ECR).❓ Q43: How do you automatically detect errors in a pipeline?
Click on the dropdown below to reveal the technical answer.
Answer:
set -e inside custom Bash steps to terminate scripts immediately upon command failure.stderr) for failure key phrases using regex.❓ Q44: What does set -e do in a Bash script?
Click on the dropdown below to reveal the technical answer.
Answer:
set -e (commonly referred to as "exit immediately") instructs the Bash interpreter to exit the script execution immediately if any command, pipeline, or subshell returns a non-zero exit status (failure). This stops the script from executing subsequent lines with incorrect variables, preventing cascading errors.
❓ Q45: What is an exit code?
Click on the dropdown below to reveal the technical answer.
Answer:
An exit code (or return status) is an integer value between 0 and 255 returned by a system process to its parent process upon termination:
0 represents a successful execution.1 to 255 represents a specific error or failure type (e.g., 1 for general errors, 127 for command not found).❓ Q46: How do you fail a CI/CD pipeline when a step fails?
Click on the dropdown below to reveal the technical answer.
Answer:
set -e enabled so they terminate on failure.exit 1 (or another non-zero code) within conditionals.❓ Q47: Write a Bash script to detect errors automatically.
Click on the dropdown below to reveal the technical answer.
Answer:
Here is a production-grade Bash script script that handles errors automatically using set -e and trap handlers:
#!/bin/bash
# Exit immediately if any command returns a non-zero exit code
set -e
# Treat unset variables as errors when executing
set -u
# Ensure pipelines return the exit status of the last command that failed
set -o pipefail
# Error handler function
cleanup_error() {
local exit_code=$?
echo "❌ ERROR: Script failed at line $1 with exit code $exit_code"
# Perform cleanups (e.g., remove temp files) here
exit "$exit_code"
}
# Trap any ERR signal and call cleanup_error with the line number
trap 'cleanup_error $LINENO' ERR
echo "🚀 Starting deployment pipeline steps..."
# Simulate a successful command
mkdir -p /tmp/build_dir
echo "Standard compile successful."
# Simulate checking a requirement (this will fail if database is offline)
# If this command returns a non-zero status, the script exits immediately
# rather than proceeding to publish a broken build.
curl -s --fail http://localhost:8080/health || false
echo "✅ Pipeline completed successfully!"
❓ Q48: What is the difference between Cron and Systemd Timers?
Click on the dropdown below to reveal the technical answer.
Answer:
| Feature | Cron Jobs | Systemd Timers |
|---|---|---|
| Scheduler type | Classic Unix background daemon (crond). | Integrated systemd component. |
| Granularity | Down to 1 minute. | Down to milliseconds (extremely precise). |
| Logging | Sends mail or logs to syslog; hard to track output. | Outputs stream directly to journalctl for clean tracking. |
| Triggers | Absolute calendar times only (e.g., 5 PM daily). | Calendar times OR relative events (e.g., 5 mins after boot). |
| Dependencies | Cannot define dependencies easily. | Can depend on other services/units being active first. |
❓ Q49: When should you use Cron?
Click on the dropdown below to reveal the technical answer.
Answer: Use Cron for simple, legacy tasks that do not require complex system integrations or granular scheduling:
❓ Q50: When should you use Systemd Timers?
Click on the dropdown below to reveal the technical answer.
Answer: Use Systemd Timers for modern system automation tasks:
journalctl.❓ Q51: How do you check if Nginx is running?
Click on the dropdown below to reveal the technical answer.
Answer:
systemctl status nginx
ps aux | grep nginx
# or
pgrep -x nginx
curl -I http://localhost
❓ Q52: How do you start, stop, and restart Nginx?
Click on the dropdown below to reveal the technical answer.
Answer:
sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
sudo systemctl reload nginx
❓ Q53: How do you check Nginx logs?
Click on the dropdown below to reveal the technical answer.
Answer:
tail -f /var/log/nginx/access.log
tail -f /var/log/nginx/error.log
journalctl -u nginx --tail 50 -f
❓ Q54: How do you check which ports are open on a server?
Click on the dropdown below to reveal the technical answer.
Answer: Use one of the following tools:
ss command:
sudo ss -tulnp
netstat command:
sudo netstat -tulnp
lsof command:
sudo lsof -i -P -n
(Options: -t = TCP, -u = UDP, -l = Listening sockets only, -n = Numeric IPs, -p = Show process IDs)
❓ Q55: What is the difference between ss, netstat, and lsof?
Click on the dropdown below to reveal the technical answer.
Answer:
ss (Socket Statistics): A modern command that queries socket statistics directly from kernel space (using netlink interface). It is much faster and more efficient than netstat under high load.netstat (Network Statistics): A legacy tool that reads /proc/net/ files. Deprecated on most modern Linux distributions because it is slow and resource-heavy.lsof (List Open Files): Lists all open files on the system. Because "everything is a file" in Unix-like systems, running lsof -i displays network connections associated with running processes.❓ Q56: How do you check if a specific port is listening?
Click on the dropdown below to reveal the technical answer.
Answer:
ss:
sudo ss -tulnp | grep :80
nc (netcat):
nc -zv localhost 80
lsof:
sudo lsof -i :80
❓ Q57: What is the difference between ALB, NLB, and CLB?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q58: What is the difference between Route 53 and a Load Balancer?
Click on the dropdown below to reveal the technical answer.
Answer:
example.com to 1.2.3.4).❓ Q59: What is the difference between EBS and EFS?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q60: What is the difference between S3, EBS, and EFS?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q61: What is the difference between RDS and DynamoDB?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q62: What is a VPC and why do we need it?
Click on the dropdown below to reveal the technical answer.
Answer: A Virtual Private Cloud (VPC) is a logically isolated virtual network dedicated to your AWS account. You need it to define your own IP space, secure resources, create public/private boundaries, and control network routing to prevent unauthorized external access to your infrastructure.
❓ Q63: What is CIDR notation?
Click on the dropdown below to reveal the technical answer.
Answer:
CIDR (Classless Inter-Domain Routing) is a format used to represent IP addresses and their associated routing masks (e.g., 10.0.0.0/24 means the first 24 bits represent the network address, leaving 8 bits for hosts, resulting in $2^8 = 256$ IP addresses).
❓ Q64: What is a Bastion Host?
Click on the dropdown below to reveal the technical answer.
Answer: A Bastion Host (or Jump Box) is a highly secured EC2 instance placed in a public subnet. Administrators connect to the Bastion host first (e.g., via SSH or Systems Manager Session Manager) and then use it as a proxy tunnel to connect to servers residing in private subnets, ensuring private instances never expose ports to the internet directly.
❓ Q65: What is Blue-Green Deployment?
Click on the dropdown below to reveal the technical answer.
Answer: A deployment strategy that uses two identical production environments:
❓ Q66: What is Canary Deployment?
Click on the dropdown below to reveal the technical answer.
Answer: A deployment strategy where the new application version is rolled out to a tiny fraction of servers or users (e.g., 5% of traffic) first. Once verified as stable (no error spikes), the new version is incrementally rolled out to the remaining 95% of users.
❓ Q67: What is Docker and why do we use containers?
Click on the dropdown below to reveal the technical answer.
Answer: Docker is a containerization platform. We use containers to package an application along with its OS filesystem, libraries, and configurations into a single standardized image. This ensures the application runs identically on a developer's laptop, a QA server, and in production.
❓ Q68: What is Kubernetes?
Click on the dropdown below to reveal the technical answer.
Answer: Kubernetes (K8s) is an open-source container orchestration system that automates the deployment, scaling, clustering, scheduling, health-monitoring, and networking of containerized applications across fleets of host nodes.
❓ Q69: What happens when an EC2 instance fails?
Click on the dropdown below to reveal the technical answer.
Answer:
❓ Q70: How would you troubleshoot a website that is down on AWS?
Click on the dropdown below to reveal the technical answer.
Answer: Follow a systematic diagnostic flow:
nslookup or dig to confirm Route 53 points to the correct endpoint.sudo ss -tulnp)./var/log/nginx/error.log) and application runtime logs for crash errors.