Overview
Cloud computing is renting computing resources (servers, storage, databases, networking, and higher-level services) on demand over the internet, paying for what you use instead of buying and running your own hardware. Key characteristics are self-service provisioning, elasticity (scale up and down quickly), broad network access, resource pooling, and metered billing.
Services come in layers: IaaS (virtual machines and networks), PaaS (managed platforms like App Engine or managed databases), SaaS (complete applications like Gmail), and serverless/FaaS (run functions without managing servers). The shared responsibility model defines what the provider secures (physical infrastructure) and what you secure (your data, identities, and configuration).
You do not build a power plant to turn on lights; you plug in and pay for the kilowatt-hours you use. Cloud computing does the same for servers and storage.
When to use it
- Launching products quickly without buying hardware.
- Workloads with variable or unpredictable demand.
- Global reach through multiple regions.
- Using managed services instead of operating databases and queues yourself.
Where it shows up in interviews
Recognize it when: should we run VMs, containers, or serverless?
- Design a startup's backend on AWS
- Migrate an on-prem app to the cloud
Recognize it when: traffic varies 10x between day and night.
- Design a ticket sale platform
- Design a batch analytics platform
Where it is used in real software
Migrated fully to AWS to scale globally and use elastic capacity for streaming and encoding.
AWS, Microsoft Azure, and Google Cloud dominate the market, each with 200+ services.
Enterprises often keep some workloads on-premises and use multiple clouds for resilience or regulatory needs.
Key terms
- IaaS / PaaS / SaaS
- Infrastructure / Platform / Software as a Service.
- Serverless
- Run code or use services without managing servers; pay per use.
- Region / availability zone
- Geographic area / isolated data centers within a region.
- Elasticity
- Automatically adding and removing capacity.
- Shared responsibility
- Provider secures the cloud; you secure what you run in it.
How it works, step by step
- 1Pick regions
Close to users and compliant with data residency.
- 2Design across availability zones
Survive a data center failure.
- 3Prefer managed services
Databases, queues, and caches reduce operations.
- 4Automate with code
Infrastructure as Code and CI/CD.
- 5Control cost and security
Tagging, budgets, least-privilege IAM, encryption.
Service models: who manages what
Layers you manage vs the provider
| Layer | On-premises | IaaS | PaaS | SaaS |
|---|---|---|---|---|
| Application | You | You | You | Provider |
| Runtime and OS | You | You | Provider | Provider |
| Virtualization and servers | You | Provider | Provider | Provider |
| Networking and data center | You | Provider | Provider | Provider |
NOWLayer: Application | On-premises: You | IaaS: You | PaaS: You | SaaS: Provider
Moving right trades control for less operational work. Most modern systems mix IaaS, PaaS, and serverless.
Implementation
# List regions and availability zonesaws ec2 describe-regions --query "Regions[].RegionName"aws ec2 describe-availability-zones --region us-east-1 --query "AvailabilityZones[].ZoneName" # Budget alert to avoid surprise billsaws budgets create-budget --account-id 123456789012 --budget '{ "BudgetName": "monthly", "BudgetLimit": {"Amount": "500", "Unit": "USD"}, "TimeUnit": "MONTHLY", "BudgetType": "COST"}'Complexity and performance
vs weeks for hardware.
Service dependent.
Trade-offs
On-demand is flexible but can cost more than owned hardware for large, stable workloads; reserved and savings plans reduce cost.
Managed services save operations but tie you to a provider's APIs.
Variants and related techniques
Shared provider infrastructure, dedicated infrastructure, or a mix.
Run workloads near users (CloudFront Functions, Cloudflare Workers).
Common mistakes
- Lift and shift without redesign.
Fix: Adopt elasticity and managed services to get cloud benefits.
- No cost monitoring.
Fix: Tag resources, set budgets, and review spending regularly.
- Public storage buckets and broad IAM.
Fix: Least privilege and block public access by default.
Interview questions
What is the difference between IaaS, PaaS, and SaaS?
IaaS provides virtual machines, storage, and networks you manage; PaaS provides a managed runtime where you deploy code; SaaS is a complete application you use. Each step up removes operational work and control.
What is the shared responsibility model?
The provider is responsible for the security of the cloud (hardware, facilities, hypervisor); the customer is responsible for security in the cloud (data, IAM, network rules, OS patches on VMs, application code).
Practice problems
| Problem | Difficulty | What it trains |
|---|---|---|
| Map a web app to IaaS vs PaaS vs serverless | Easy | Service models. |
| Design a multi-AZ deployment for an API | Medium | Regions and zones. |