Stop 15 · Interview PreparationArchitecture & Design · 3/3

Cost Optimization Scenarios

Part of the Cloud Computing Roadmap

In short

"Our cloud bill doubled last month. What do you do?" There's no trick answer. They want a calm, step-by-step investigation instead of "switch everything to spot instances".

'Our cloud bill doubled, how would you investigate?' — testing Phase 4 and Phase 12's cost optimization and monitoring knowledge applied to a diagnostic scenario.

The blob character holds a very long paper bill while looking up at a steaming water geyser.

Think of it like this

Who left the geyser on?

The electricity bill at home suddenly doubles. You don't sell the fridge in panic. You check the meter, compare with last month, and walk room to room. Ah, the new geyser has been on all day. Fix that first, then think about LED bulbs.

Watch it happen

Investigating a bill that doubled

Confirm
Break down
Find spike
Root cause
Fix
Prevent

1/6Is it real? Check for a one-time charge, a yearly commitment or support fee landing this month.

The big ideas

What you need to know

Tags make costs visible

Tag resources by team, project and environment. Without tags, "who owns this?" takes days to answer.

Data transfer hides

Traffic between zones, regions and out to the internet is billed per GB. It often explains a mystery spike.

Quick wins vs long wins

Deleting waste is fast. Right-sizing, commitments and re-architecture take longer but save more over time.

Catch it early

Budgets and anomaly alerts turn a month-end shock into a message on day two.

See it in code

Walk through the code

bash
1# Unattached EBS volumes: still billed, used by nobody2aws ec2 describe-volumes --filters Name=status,Values=available \3  --query "Volumes[].[VolumeId,Size,CreateTime]" --output table4 5# Elastic IPs not attached to anything (still billed)6aws ec2 describe-addresses \7  --query "Addresses[?AssociationId==null].PublicIp" --output text8 9# NAT gateways: hourly charge plus a per-GB processing charge10aws ec2 describe-nat-gateways \11  --query "NatGateways[].[NatGatewayId,State,VpcId]" --output table

1/3Volumes with status available are attached to no instance. Snapshot if unsure, then delete.

Three classic waste checks. In an interview, naming these shows you've actually looked at a real bill.

Save yourself the pain

Common mistakes

Oops

Jumping to "buy reserved instances" before knowing what caused the spike.

Do this instead

Find the cause first. Commitments discount steady usage; they don't fix a forgotten resource.

Oops

Deleting resources you think are unused without checking owners.

Do this instead

Check tags and ask owners, or snapshot first. Saving money by deleting prod data is a bad story.

Your mission

Practise the investigation

~30 min

Quick check

The bill jumped on the 12th. Line items show NAT gateway data processing went up 10x. A likely cause?

Go deeper

  1. 1Practice a structured approach: identify the biggest cost drivers first, then investigate each.
  2. 2Prepare to discuss right-sizing, reserved pricing, and storage tiering as concrete levers.
  3. 3Practice presenting a cost optimization recommendation with an estimated savings figure.

More architecture & design at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge