What is EC2 (Elastic Compute Cloud)?

Why Interviewers Ask This

This is a classic screening question for AWS / Cloud Computing roles. Hiring managers ask it early in interviews to gauge your baseline understanding and determine if you can communicate technical concepts clearly.

Answer

Amazon EC2 (Elastic Compute Cloud) provides resizable virtual servers (instances) in the cloud. You can launch instances within minutes and pay only for the compute time you use — no upfront hardware investment. Key concepts: Instance types: different combinations of CPU, memory, storage, and networking. Families: General Purpose (t3, m5), Compute Optimized (c5, c6g), Memory Optimized (r5, x1), Storage Optimized (i3, d2), Accelerated Computing (p3, g4 — GPU). Instance sizes: nano, micro, small, medium, large, xlarge, 2xlarge, etc. Amazon Machine Image (AMI): the template for the root volume — OS, application, configuration. Choose from: AWS-provided (Amazon Linux, Ubuntu, Windows Server), Marketplace AMIs, or custom AMIs. Pricing models: On-Demand (per second/hour, no commitment); Reserved Instances (1 or 3-year commitment, up to 75% discount); Savings Plans (flexible commitment to usage, up to 66% discount); Spot Instances (use spare capacity, up to 90% discount — can be interrupted with 2-min notice); Dedicated Hosts (physical server dedicated to you — compliance/licensing). Key features: Elastic Load Balancing, Auto Scaling, security groups (virtual firewalls), Elastic IP addresses (static public IPs), EC2 User Data (bootstrap scripts on launch), Instance metadata service. Instance states: pending → running → stopping → stopped → terminated.

Pro Tip

This topic has AWS / Cloud Computing-specific nuances that differ from general programming. Highlighting those nuances in your answer shows expertise rather than generic knowledge.