📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

Tell me about a time your cloud costs jumped unexpectedly. How did you find out, how did you track down what was driving the cost, what did you do immediately, and what guardrails did you put in place afterwards?

A STAR story for an unexpected Azure bill increase: Cost Management analysis by resource and meter, common culprits (logging volume, autoscale, forgotten resources), quick fixes, and FinOps guardrails.

Mid-Level RealWorldScenario Intermediate azure cost-management finops log-analytics real-world star-story

🎯 Key points

  • Found via budget or anomaly alert (or finance); stated the size (e.g. 3x in a month)
  • Azure Cost Analysis grouped by service, resource and meter at daily granularity to find the step change
  • Correlated the step with a change: deploy, config (log level, sampling), autoscale rule, new environment
  • Root cause explained: Debug logging and no sampling multiplied billable GB ingested
  • Fixed the root cause through Azure App Configuration (log levels, sampling); daily cap only as a backstop
  • Balanced telemetry and cost: keep all requests and exceptions, sample traces, cheaper log plans and retention for verbose tables
  • Guardrails: budgets and anomaly alerts to the team channel, enforced tags (Azure Policy at management-group level), cost in the PR checklist and monthly review
  • Communicated: told finance the cause, fix and forecast; numbers before, peak and after

⏱ 30-second answer

My story is the [team's Azure subscription] going from [A$8k] to [A$24k] a month. Cost Analysis grouped by meter at daily granularity showed a step on [date] in Log Analytics data ingestion: a release had set the log level to Debug in production and Application Insights sampling was off, so we were ingesting [400 GB] a day. I put the log level back through App Configuration, re-enabled adaptive sampling and set a daily cap as a safety net. Ingestion dropped [90%] within a day. Afterwards I added budgets with anomaly alerts, tagging by team and environment, and a release checklist item for telemetry volume. The trade-off: daily caps protect the bill but drop telemetry when you most need it, so they're a backstop, not the control.

🗣 Full answer (senior)

How I would answer this in an interview

"At [company], [finance] emailed to ask why our team's Azure subscription had gone from about [A$8,000] to [A$24,000] in a month. We had a budget, but its alert went to a mailbox nobody read, so we found out [three weeks] late.

I opened Azure Cost Analysis, grouped by service and then by meter, with daily granularity. Almost all of the increase was one meter, Log Analytics data ingestion, and it stepped up on [date]. That date matched a release. In that release someone had set Logging:LogLevel:Default to Debug to chase a bug and it went to production, and adaptive sampling had been turned off in the Application Insights setup at the same time. A KQL query on the Usage table showed we'd gone from about [20 GB] to [400 GB] a day, mostly EF Core command logs and request traces.

I set the log level back to Information through Azure App Configuration so we didn't need a release, re-enabled sampling for traces while keeping all exceptions and requests, and set a daily cap on the workspace slightly above normal as a backstop. Ingestion was back to [~25 GB] a day within [24] hours. Then I fixed the process: budgets per subscription with alerts to our team channel, cost anomaly alerts, tags for team and environment enforced with Azure Policy, and a PR checklist item for logging and telemetry changes. The next month's bill was [A$8,500]. My lesson: cost is a production metric, and it needs an owner and an alert like latency does."


Where to look

Tool What it tells you
Cost Analysis (group by resource, service, meter; daily) Which resource and meter, and when it stepped
Cost anomaly alerts Unusual daily spend automatically
Log Analytics Usage table Ingestion by table and solution
Azure Advisor cost recommendations Idle and oversized resources
Activity log Who created or scaled what, when

Usual culprits

Culprit Typical cause
Log/telemetry ingestion Debug level in prod, sampling off, high-cardinality metrics
Compute Autoscale max reached and never scaling in; oversized SKUs
Forgotten resources Load-test environments, premium databases left on
Data egress Cross-region traffic, large downloads
Storage transactions Chatty polling, small-file workloads

Production example

Template: subscription [A$8k] → [A$24k]/month; Log Analytics ingestion [20] → [400 GB/day] after a release set Debug logging and disabled sampling; fixed in [24 h] via config; next month [A$8.5k]; budgets and anomaly alerts now go to the team channel.

🔍 What the interviewer is checking

Checks whether you own cost as a production concern, can find the real driver with Azure tooling, fix it without harming reliability, and put fast feedback in place.

Green flags

  • Cost Analysis by meter and day; correlates with a change
  • Fixes safely (sampling, levels, scale rules) instead of turning things off
  • Budgets, anomaly alerts, tagging, policy
  • Result in dollars and detection time

Red flags

  • "Not my job, finance handles it"
  • Turns off monitoring to save money
  • No numbers

📚 Learn in depth

1. What the interviewer is really assessing

Cost stories test ownership beyond code: do you treat cost as a production metric, can you use the tooling to find the driver, and do you fix it without hurting reliability or observability. In Australian companies with tight cloud budgets this is asked more and more, often by engineering managers.

2. The analysis funnel

Bill up 3x
  -> Cost Analysis: group by service (which service?)
  -> group by resource (which instance?)
  -> group by meter (which charge: ingestion, vCore hours, egress?)
  -> daily granularity (when did it step?)
  -> correlate with deploys, config changes, Activity log
  -> root cause -> fix -> guardrail

3. Why telemetry is a frequent culprit

Log Analytics charges by GB ingested (with commitment tiers and a cheaper Basic/Auxiliary log plan for some tables). Debug logging can multiply volume 10–50×. Application Insights sampling reduces trace volume while keeping statistical accuracy, and exceptions can be excluded from sampling. Daily caps stop ingestion when reached, which protects the bill but blinds you.

4. Frameworks for telling it

STAR. Lead the Result with money, because that's what the audience cares about. For an engineering manager, a CAR version that ends with the guardrail works well.

5. How it is scored

Weak: "we deleted some stuff." Good: found the resource. Strong: found the meter and the change that caused it, fixed safely. Excellent: alerts, ownership, tagging and policy so cost regressions are caught in days, not months.

6. Adapting the story

Also answers "a time you saved the company money", "a time you took ownership of something outside your role" and "a time you improved a process". Non-technical version: "A logging setting left on after a release tripled our cloud bill. I found it, switched it off without a release, and set up alerts so we'd know within a day next time."

Try it yourself

  1. Open Cost Analysis for a subscription you can access; group by meter with daily granularity for the last 90 days.
  2. Run Usage | where TimeGenerated > ago(30d) | summarize sum(Quantity) by DataType in a Log Analytics workspace.
  3. Create a budget with an alert to a Teams/Slack webhook via an action group.
  4. Turn on adaptive sampling in a sample app and compare ingestion.
  5. Write and time your STAR version.

💻 Code

The fixes in this example: log levels and sampling controlled centrally through Azure App Configuration, so production can be corrected without a release.

using Azure.Identity;
using Microsoft.Extensions.Configuration.AzureAppConfiguration;

var builder = WebApplication.CreateBuilder(args);

// Production log levels live in App Configuration (label = environment) and refresh at runtime.
builder.Configuration.AddAzureAppConfiguration(o => o
    .Connect(new Uri(builder.Configuration["AppConfig:Endpoint"]!), new DefaultAzureCredential())
    .Select("Logging:*", labelFilter: builder.Environment.EnvironmentName)
    .ConfigureRefresh(r => r.Register("Logging:Sentinel", refreshAll: true)
                            .SetRefreshInterval(TimeSpan.FromMinutes(1))));
builder.Services.AddAzureAppConfiguration();

// Application Insights with adaptive sampling left ON (the release had turned it off).
builder.Services.AddApplicationInsightsTelemetry(o => o.EnableAdaptiveSampling = true);

var app = builder.Build();
app.UseAzureAppConfiguration(); // picks up refreshed settings, e.g. Logging:LogLevel:Default = Information
app.Run();
// Which tables drove ingestion, per day (GB)
Usage
| where TimeGenerated > ago(45d) and IsBillable == true
| summarize GB = sum(Quantity) / 1024 by DataType, bin(TimeGenerated, 1d)
| order by TimeGenerated desc, GB desc
STAR template
S: [Subscription/service] cost went from [A] to [B] per month; found by [who/how].
T: I [took on] finding the cause and stopping it.
A: Cost Analysis by [meter, daily]; step on [date] matched [change]; fixed via [config/scale/delete];
   added [budgets, anomaly alerts, tags, policy, checklist]; updated [finance] with cause and forecast.
R: Back to [C]/month; detection time from [weeks] to [a day]; saved [amount/year].

Illustrative only: Log Analytics ingestion 20 -> 400 GB/day after Debug logging shipped; fixed in 24 h.

⚠ Common mistakes

  • Mistake: Looking only at the monthly total by resource group. Why it is wrong: You can't see when or which meter. Instead: Group by meter with daily granularity.
  • Mistake: Turning off telemetry to save money. Why it is wrong: You lose the ability to run production. Instead: Keep requests and exceptions, sample traces, set levels per category, move verbose tables to cheaper plans and shorter retention.
  • Mistake: Relying on a daily cap as the fix. Why it is wrong: It silently drops data mid-incident and leaves the root cause in place. Instead: Fix the settings; keep the cap as a backstop above normal with an alert when hit.
  • Mistake: Hard-coding production log levels in appsettings.json. Why it is wrong: Fixing them needs a release, and a debugging change can ship by accident. Instead: Environment-labelled settings in Azure App Configuration with runtime refresh and review.
  • Mistake: Untagged or inconsistently tagged resources. Why it is wrong: Cost can't be attributed to a team or environment, so nobody owns the spike and orphans live for ever. Instead: Required tags (team, environment, cost centre) enforced by Azure Policy, ideally at management-group level.
  • Mistake: Budget alerts to an unread mailbox. Why it is wrong: You find out from finance weeks later. Instead: Route to the team channel or on-call.
  • Mistake: Deleting resources you don't own. Why it is wrong: You might delete someone's environment. Instead: Use tags and the Activity log to find the owner.
  • Mistake: Going quiet with finance, or blaming whoever set Debug. Why it is wrong: Finance needs a forecast, and it was a missing guardrail. Instead: Send the cause, fix and expected next bill; fix the config process.
  • Mistake: No money in the result. Why it is wrong: The audience cares about dollars. Instead: Before, peak, after, annualised saving.

🏛 Senior insight: trade-offs

Seniors treat cost as a non-functional requirement with an owner, like latency. The strong answer finds the meter and the change, fixes it without blinding operations, and creates fast feedback (anomaly alerts in days, cost visible per team). Mention the trade-off between observability and cost explicitly, because over-correcting is a common failure.

Guardrail Catches Cost Limitation
Budgets + alerts to team channel Monthly overrun Free Late if threshold is monthly only
Cost anomaly alerts Daily spikes Free Needs someone to act
Tagging + Azure Policy Ownership, orphaned resources Setup Tags must be enforced
Daily cap on Log Analytics Runaway ingestion Free Drops data when hit
Auto-shutdown / TTL on non-prod Forgotten test environments Low Teams must opt in or policy enforces

🔗 Follow-ups the interviewer may ask

  1. When: Candidate mentions Cost Management or a tripled bill. Why: Checks the full technical playbook for finding the runaway resource and guardrails.
    How to answer

    I treat it like an incident. In Cost Management → Cost analysis I group by service, then resource, then meter, with daily granularity, to find what grew and the day it started. Then I correlate that date with the release history and the Activity Log to find the deployment or config change behind it. Common culprits are Log Analytics ingestion from debug logging, a SKU scaled up and never scaled down, autoscale with no sensible maximum, forgotten test resources, and recursive triggers.

    I stop the bleeding first (daily cap, scale down, disable the loop), then fix the root cause, then add guardrails: budgets with action groups, cost anomaly alerts, required tags, Azure Policy for allowed SKUs, and OpenTelemetry sampling. The trade-off is that guardrails like hard caps can drop data or block scaling, so they must be set deliberately, not as a reflex.

  2. When: Candidate mentions metrics or telemetry driving the cost. Why: Checks understanding of metric cardinality as a cost driver.
    How to answer

    Cardinality is the number of unique label combinations; each is a separate time series. A user_id label multiplies a metric's series by the number of active users, and on a histogram that is again multiplied by every bucket, so 20 routes × 5 status codes × 17 buckets × 50,000 users is 85 million series.

    I confirm it with prometheus_tsdb_head_series (or the Azure Monitor workspace's active series and ingestion metrics), find the metric with topk(10, count by (__name__) ({__name__=~".+"})), and the label with count(count by (user_id) (...)). I stop the bleeding without a deploy by dropping the label in the OpenTelemetry Collector or with Prometheus labeldrop, then remove the tag in code and move per-user questions to traces and logs.

    The trade-off: per-user detail is real value, but metrics are the wrong place for unbounded data.

  3. When: Candidate mentions compute SKUs or choosing a cheaper hosting option. Why: Checks hosting trade-offs on cost, control and scaling.
    How to answer

    I choose by how much platform the team wants to run:

    • App Service: one or a few web apps, always on, deployment slots, almost no ops. Paid per plan instance.
    • Azure Functions: event-driven or spiky work (queues, timers, blobs); Flex Consumption scales per event and to zero.
    • Container Apps: containerised microservices on managed Kubernetes with KEDA scaling, revisions and scale to zero, without touching the cluster.
    • AKS: full Kubernetes when you need its API, custom networking or many services and have a platform team.

    The trade-off is control versus operations: each step towards AKS gives more control and more work. I start with the simplest option that meets the requirements and move only when I hit a concrete limit.

🛠 Real-world problems: how you handle them

Debug logging in production triples the Azure bill
Situation
[Team subscription] running [the orders platform] on [App Service and Azure SQL in Australia East], normally about [A$8,000] a month. [Finance] flagged a [A$24,000] month. I [volunteered / was asked] to investigate.
Signals
Finance email; a budget alert that had gone to an unmonitored mailbox [three weeks] earlier; Cost Analysis showing Log Analytics as the top service; no performance symptoms in the app.
Investigation
Cost Analysis grouped by meter, daily: Log Analytics 'Data Ingestion' stepped from [~A$70] to [~A$1,000] a day on [date]. Ruled out compute and SQL (flat). Matched the date to release [x.y]; the diff showed `Logging:LogLevel:Default` = Debug in production settings and adaptive sampling disabled. `Usage` table: ingestion [20] to [400 GB/day], mostly `AppTraces` (EF Core commands) and `AppRequests`.
Resolution
Mitigation: set log level to Information (and EF Core command logging to Warning) via Azure App Configuration, no release needed; re-enabled adaptive sampling, excluding exceptions; set a workspace daily cap at [40 GB] as a backstop with an alert when reached. Ingestion back to [~25 GB/day] within [24] hours. Real fix: production log levels moved to environment-specific config with review; telemetry setup moved into a shared package with sampling on by default.
Prevention
Budgets per subscription with alerts at 80%/100% to the team channel; cost anomaly alerts; tags for team/environment enforced by Azure Policy; a PR checklist item for logging and telemetry changes; monthly cost review in the team's ops meeting.

How to tell it (STAR)

**S:** At [company], finance asked why our team's Azure bill had gone from about [A$8,000] to [A$24,000] in a month. **T:** I [took it on] to find the cause and stop it. **A:** In Cost Analysis I grouped by meter, day by day, and found Log Analytics ingestion had jumped twentyfold on the day of a release. The release had switched production logging to Debug and turned off sampling. I put the log level back through configuration without a release, re-enabled sampling while keeping every exception, and added a daily cap as a backstop. Then I set up budgets and anomaly alerts to our team channel, enforced tagging, and added telemetry changes to our PR checklist. **R:** Ingestion dropped [90%] within a day, the next bill was [A$8,500], and our detection time went from [three weeks] to [one day].

More in Production Incidents

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me