Practice Questions

Elastic Compute Cloud (EC2)

Instance Types

EC2 instance types define the combination of CPU, memory, storage, and network performance. The naming convention is: family + generation + size (e.g., m5.large — general purpose, 5th gen, large).

Spot instance key facts:

Instance Families

Family Use case Examples
General Purpose (M, T) Balanced CPU/memory/network; web servers, small databases m6i, t3
Compute Optimized (C) CPU-intensive: batch, HPC, gaming servers, ML inference c6i, c5
Memory Optimized (R, X, z1d) Large in-memory datasets: in-memory DBs, real-time analytics, SAP HANA r6i, x2idn
Storage Optimized (I, D, H) High sequential read/write to local NVMe; data warehousing, Hadoop, OLTP i4i, d3
Accelerated Computing (P, G, Inf) GPU workloads: ML training, graphics rendering, video encoding p4, g5, inf2
HPC Optimized (Hpc) High-performance computing requiring low-latency networking hpc6a

Exam tip: The key question is always "what is the bottleneck?" If it's CPU → C family. If it's RAM → R/X family. If it's local disk IOPS → I family. If it's GPU → P/G family.

Purchasing Options

Option Commitment Discount vs On-Demand Best for
On-Demand None Baseline (0%) Short-term, unpredictable, spiky workloads
Reserved Instances (1-year) 1 year Up to ~40% Steady-state workloads running most of the time
Reserved Instances (3-year) 3 years Up to ~72% Long-term predictable baseline with no expected change
Savings Plans 1 or 3 years Up to ~72% Flexible alternative to RIs — commits to $ spend/hour, not specific instances
Spot None (can be interrupted) Up to ~90% Fault-tolerant, interruptible, flexible workloads
Dedicated Instances None Premium over On-Demand Single-tenant hardware without visibility into physical server
Dedicated Hosts On-Demand or Reserved Premium BYOL licensing; visibility into sockets and cores required

Reserved Instance types:

Payment options for RIs: