π Day 21 of 30 β DevOps Interview Preparation Challenge

Series: 30 Days DevOps Interview Preparation
Author: Tathagat Gaikwad
25 Docker & AWS Interview Questions with Detailed Answers
π Introduction
If youβre preparing for a DevOps Engineer interview, two areas you will always be tested on are:
Docker β because containerization is at the core of modern DevOps.
AWS β because it is the most widely adopted cloud provider.
In this blog, weβll go through 25 commonly asked Docker and AWS questions, explained with both theory and practical insights.
π³ Docker Interview Questions
Q1: What is Docker?
π Docker is a containerization platform that packages applications and dependencies together into a lightweight, portable container. It ensures the app runs consistently across environments.
Q2: What is the difference between Docker containers and Virtual Machines?
VMs β Require a hypervisor, each VM runs a full OS (heavyweight).
Docker Containers β Share the host OS kernel, lightweight, faster startup.
Q3: Difference between Docker Image and Container?
Image β Blueprint for containers (read-only).
Container β Running instance of an image (read-write).
Q4: How do you persist data in Docker?
π By using Volumes or Bind Mounts. Volumes are managed by Docker and are the recommended approach for persistence.
Q5: What are common instructions in a Dockerfile?
FROM
β Base imageCOPY
/ADD
β Copy files into imageRUN
β Execute commands while buildingEXPOSE
β Ports to be exposedCMD
β Default command
Q6: What is Docker Compose?
π A tool to define and run multi-container applications using a YAML file (docker-compose.yml
). Example: web + database running together.
Q7: How do you reduce Docker image size?
Use smaller base images (like
alpine
)Use multi-stage builds
Clean up caches and unused packages
Q8: Difference between COPY
and ADD
in Dockerfile?
COPY
β Copies files/folders only.ADD
β Can copy files, extract.tar
, and fetch remote URLs.
Q9: How do you monitor Docker containers?
Commands:
docker ps
,docker stats
Tools: Prometheus + cAdvisor, ELK stack, or Docker Desktop dashboard
Q10: What is the difference between ENTRYPOINT and CMD?
ENTRYPOINT
β Defines the executable (main process).CMD
β Provides default arguments to ENTRYPOINT.
βοΈ AWS Interview Questions
Q11: What is IAM in AWS?
π IAM (Identity and Access Management) is a service to manage users, groups, roles, and permissions securely.
Q12: Difference between Security Groups and NACLs?
Security Groups β Instance-level firewall, stateful (return traffic is allowed).
NACLs β Subnet-level firewall, stateless (rules must be defined for both inbound & outbound).
Q13: How do you achieve high availability with EC2?
π Use Auto Scaling Groups + Load Balancers (ELB/ALB) across multiple Availability Zones (AZs).
Q14: What is the difference between S3 Standard and S3 Glacier?
S3 Standard β Frequent access, low latency.
S3 Glacier β Archival storage, very low cost, but retrieval takes minutes to hours.
Q15: Explain Spot, Reserved, and On-Demand EC2 instances.
On-Demand β Flexible, pay per hour/second.
Reserved β 1β3 year commitment, cheaper.
Spot β Cheapest, but AWS can reclaim anytime.
Q16: What is AWS CloudFormation?
π Infrastructure as Code (IaC) tool to provision and manage AWS resources using YAML/JSON templates.
Q17: Difference between Elastic Beanstalk and ECS?
Elastic Beanstalk β PaaS for simple app deployments (abstracts infra).
ECS β Container orchestration (you manage containers).
Q18: What is AWS EKS?
π Elastic Kubernetes Service β Managed Kubernetes cluster service on AWS.
Q19: How do you secure sensitive data in AWS?
π Use Secrets Manager or SSM Parameter Store instead of hardcoding credentials.
Q20: Difference between ELB and ALB?
ELB (Classic Load Balancer) β Layer 4 & 7, basic routing.
ALB (Application Load Balancer) β Layer 7, path-based & host-based routing, better for microservices.
Q21: How do you connect on-premises servers to AWS?
π Use VPN, AWS Direct Connect, or hybrid networking.
Q22: Difference between RDS and DynamoDB?
RDS β Relational (SQL-based).
DynamoDB β NoSQL (key-value, document-based).
Q23: What is AWS Lambda used for?
π Serverless compute β runs code without managing servers, triggered by events (S3 upload, API Gateway, CloudWatch events).
Q24: How do you manage logs in AWS?
π Use CloudWatch Logs, store logs in S3, and analyze with Athena.
Q25: What is an Auto Scaling Policy?
π Rules that automatically scale EC2 instances up/down based on metrics like CPU, memory, or custom CloudWatch alarms.
π― Interview Preparation Tips
β Donβt just memorize answers β Practice hands-on with Docker containers and AWS Free Tier.
β Expect follow-up scenario-based questions (e.g., βHow would you set up HA for a web app?β).
β Use the STAR Method (Situation, Task, Action, Result) to explain real-world experiences.
β Stay updated β Docker & AWS services evolve quickly, so always check official docs.
π Conclusion
We covered 25 must-know Docker & AWS questions with detailed answers that will help you in your next DevOps interview.
π‘ Which of these questions do you think interviewers ask most often? Letβs discuss in the comments!
#DevOps #Docker #AWS #InterviewPreparation #30DaysOfDevOps #Cloud
Subscribe to my newsletter
Read articles from Tathagat Gaikwad directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
