Quiz: Cloud Cost Optimization

Twelve questions. Answers with explanations follow — work through them first.


1. Chapter 1's job cost $3,840.00 a night instead of $74.88 because of a CAST in a WHERE clause. What made the defect survive for months?

  • A. The job failed intermittently and nobody investigated
  • B. Cost defects are silent — no error, no alert, no failed test — and the bill arrives 30 days later, aggregated by service, to somebody else
  • C. The engineer who wrote it left the company
  • D. The cluster was reserved, so the cost was fixed

2. You spend three weeks reducing a query's CPU time by 75%, on BigQuery's on-demand pricing. The cost changes by:

  • A. 75%
  • B. Roughly 40%
  • C. Nothing, if it scans the same bytes
  • D. It depends on cluster size

3. --estimate prices the Chapter 1 fix at 126.5× on the per-TiB meter, 128.6× per warehouse-second, and 51.3× per node-hour. Why is the node-hour ratio the smallest?

  • A. Node-hour pricing has a volume discount
  • B. The fixed job still provisions 24 nodes for 1.3 hours — you pay for machines that exist, not for the work they do
  • C. The per-TiB meter double-counts compressed data
  • D. The measurement is on different data

4. §33.3 argues you should report which number?

  • A. The ratio, because it is more memorable
  • B. The annual dollars, with the ratio as supporting detail
  • C. The monthly dollars
  • D. Both, weighted equally

5. Kestrel's storage is 2.1% of the bill and compute plus warehouse is 91.1%. §33.4 argues storage optimization is popular for three reasons. Which is not one of them?

  • A. It is easy to reason about — gigabytes times a price
  • B. It produces satisfying percentages
  • C. It upsets nobody
  • D. It has the largest effect on the bill

6. 36.4% of Kestrel's bill had no owner, and all of it was waste. Why is that correlation not a coincidence?

  • A. Untagged resources are billed at a higher rate
  • B. A resource is unowned for the same reason it is wasted — nobody is watching it
  • C. Waste is deliberately hidden by teams
  • D. Tagging systems fail on high-cost resources

7. Case Study 1: the unattributed share fell from 36.4% to 4.1% in two months. What caused it?

  • A. A script that found idle resources
  • B. A stricter tagging policy in Terraform
  • C. Charging the unattributed spend to the platform team's budget
  • D. Tag propagation in the orchestrator

8. Of Kestrel's unattributed spend, 87% was resolved by deletion and 13% by tagging. What does that suggest?

  • A. The tagging system was broken
  • B. When somebody finally has to claim a resource, most of the time nobody wants it
  • C. Deletion is easier than tagging
  • D. The teams were avoiding responsibility

9. §33.8: auto-suspend is $3,024,000 per engineer-week and small-file compaction is $1,065.60. What does the chapter conclude about compaction?

  • A. Do not do it
  • B. Do it, but justify it on query latency and Chapter 31's deletion story, not on cost
  • C. Do it first because small files also affect correctness
  • D. Automate it so it costs no engineering time

10. §33.10's commitment trap. Beyond paying for capacity you no longer need, what is the second, more insidious effect of over-committing?

  • A. The discount rate drops in year two
  • B. A commitment converts a future efficiency into a sunk cost, so teams stop pursuing savings they cannot benefit from
  • C. Reserved capacity cannot be used by spot workloads
  • D. It complicates cost attribution

11. In Case Study 2, a window widened from one day to ten, cost went 10×, and seven monitoring systems stayed green for thirty nights. What made the regression invisible?

  • A. The job ran on a schedule nobody watched
  • B. The output was byte-for-byte identical, and autoscaling absorbed the extra work so the SLA was still met — by eight minutes
  • C. The cost was spread across several pipelines
  • D. The monitoring system was misconfigured

12. Case Study 2's pull-request bot blocks a merge until someone adds a cost-reviewed label, rather than blocking the change outright. Why?

  • A. Hard gates are difficult to implement
  • B. Some changes genuinely should cost ten times more, and a gate that says no to legitimate work is removed within a quarter
  • C. The estimate is not accurate enough to gate on
  • D. Finance owns the budget decision, not engineering

---

Answers

1 — B. Cost defects are silent, and the feedback arrives 30 days later to somebody else.

The job succeeded every night. No error, no failed assertion, no alert. Three properties follow and they shape the whole chapter: cost defects are silent; they are cheap to create and expensive to find (four characters, four months, $458,000); and cost is not visible where it is created — the engineer writing the query sees no number, and the bill goes to a different person in a different month. Note that the engineer was not careless: they were being defensive about a type mismatch, which is ordinarily good practice.

2 — C. Nothing, if it scans the same bytes.

On a per-byte-scanned meter you pay for data read, and CPU efficiency is free. This is the most common way cost optimization effort is wasted, and the reverse happens too: reducing bytes scanned tenfold on a per-node-hour meter can barely move the bill, because the cluster is provisioned for the peak and runs for the same wall-clock hour. The five-minute check nobody does: open the bill, find the line your work affects, and read the unit.

3 — B. You pay for machines that exist, not for the work they do.

The fixed job still runs 24 nodes for 1.3 hours regardless of how little data it reads, so the meter bills a floor the other two do not. Note the twist: the node-hour meter shows the smallest ratio and by far the largest dollar saving — $3,765.12 a night against $26.04 and $79.38.

4 — B. The annual dollars, with the ratio as supporting detail.

A 200× improvement on a $4/month line is a fact about a query; $1,374,269 a year is a fact about the business, and the two get funded differently. Kestrel's own postmortem led with 51.3× and buried the annual figure, and the fix was prioritized only because somebody put the dollars in a subject line.

5 — D. It has the largest effect on the bill.

It has close to the smallest: deleting every byte Kestrel stores saves $644.76 a month, while suspending one unused warehouse saves $5,040.00 — nearly eight times more, in about a minute. Two honest qualifications: storage drives compute, so compaction and partitioning are storage changes with compute payoffs; and at petabyte scale with light query traffic the ratio inverts. Check your own split — but the default assumption should be that your bill is a compute bill.

6 — B. A resource is unowned for the same reason it is wasted.

Nobody claims the dev cluster because everybody uses it occasionally; nobody claims REPORTING_WH because it was created for a migration that finished. The untagged population is not a random sample — it is systematically the old resources, the ones created under pressure during incidents, and the ones created by automation nobody reviews. Which makes the attribution exercise a waste-finding exercise, and that is the reason to do it even if you never produce a per-team budget.

7 — C. Charging the unattributed spend to the platform team's budget.

The number sat at 36.4% for two months while everyone agreed it was too high. The script (A) had been writable for nineteen months and nobody had written it, because nobody would have been the one to act on its output. Charging it gave the number an owner (§30.4 applied to a liability rather than a table), made investigation cheaper than absorption, and gave other teams a reason to tag — because an untagged resource now had a person who wanted it claimed. B and D are real improvements that fix the future.

8 — B. When somebody has to claim a resource, most of the time nobody wants it.

This is the case study in one line. It also implies something about a low unattributed share: it may mean your tagging is good, or it may mean nobody has been forced to claim anything. The useful reading of 87% is that the attribution exercise is mostly a deletion exercise wearing an accounting costume.

9 — B. Do it, justified on latency and deletion rather than on cost.

Compaction was worth six weeks at Kestrel — for query performance and because Chapter 31's row-level deletes depend on the table format work that came with it. Its $2,131 a year of GET savings is a rounding error, and attaching a weak cost argument to work with a strong non-cost argument invites the rejection of both. The sequencing lesson matters too: the project was approved after $132,192 of cheap wins had been delivered, which is a better argument than any projection.

10 — B. A commitment converts a future efficiency into a sunk cost.

Once you are paying for three years of capacity regardless, the team's incentive to reduce usage disappears — the saving accrues to nobody. Kestrel came close to reserving against a Spark footprint that the Chapter 21 migration reduced by 61% in the same quarter, which would have made a successful migration look like it saved nothing. The three rules: commit to the floor, not the current level; never commit in the six months before a planned migration; and do the engineering first, let it settle a quarter, then commit to what remains.

11 — B. Identical output, and autoscaling kept the SLA met by eight minutes.

Every monitor in the book measures time, correctness, or volume — none measures money. The output was byte-for-byte identical because the extra nine days of input were re-processed and discarded by the same daily aggregation, so every data-shaped assertion was blind by construction. And the deeper finding: without autoscaling the job would have run 13 hours, missed the SLA by eight hours, and been caught on night one. A reliability feature, working exactly as designed, removed the only accidental cost signal the platform had. Every autoscaled workload needs a work-volume or cost signal, because it has traded its latency signal away.

12 — B. Some changes genuinely should cost ten times more.

A new pipeline, a widened backfill, a model needing more history. A gate that blocks legitimate work is removed within a quarter, and then you have nothing. The label forces exactly one thing: a human has seen the number — which is sufficient, because in Case Study 2 the engineer would have seen +$245,981 annualized and asked whether ten days was really needed. It was not: the analyst wanted a ten-day rolling average of a daily metric, computable from ten days of output at no extra cost. An unexpected cost number is usually a signal that somebody built the wrong thing.