Q1. What is the difference between EC2, Lambda, and ECS/EKS?
EC2 provides virtual servers — you manage the OS, runtime, scaling, and availability. Full control but high operational overhead. Lambda is serverless functions — you provide code, AWS manages all infrastructure. Functions run on demand, scale automatically, and bill per execution (great for event-driven workloads). ECS (Elastic Container Service) runs Docker containers on EC2 clusters (with Fargate, AWS manages the underlying servers). EKS is managed Kubernetes. Choose EC2 for full control, Lambda for event-driven or sporadic workloads, ECS/Fargate for containerised microservices without Kubernetes complexity, EKS when you need Kubernetes capabilities.