Measure before cutting. Pull query history grouped by user, tool, and warehouse to find where the spend actually is, since it is usually a small number of queries or a dashboard refreshing far too often. Then attack the top items: add partition filters, materialize repeated heavy joins, reduce dashboard refresh frequency, right size and auto suspend compute, and set expiry on scratch tables.
Why interviewers ask this
Cost work is a large part of the modern data engineering job, and interviewers want evidence you approach it with data rather than blanket rules. They are listening for the specific offenders (dashboards on aggressive refresh, SELECT star on wide tables, unpartitioned scans, idle warehouses) and for guardrails that stop the problem returning.
How to structure your answer
- Start with query history and attribute spend by user, tool, and job.
- Rank by total cost, not by how slow a query feels.
- Fix the biggest offenders with pruning, materialization, and scheduling.
- Right size compute and enforce auto suspend.
- Put guardrails in place so the saving persists.
Example answer
First I get the data, because everyone has a theory and the theory is usually wrong. Every major warehouse exposes query history with bytes scanned or credits consumed, so I group by user, by service account, and by warehouse over the last month and sort by total cost. The pattern I keep finding is that a handful of things dominate. Last time, 40% of the spend was one BI dashboard refreshing every fifteen minutes against a raw event table for an audience of about six people, none of whom looked at it more than daily. Moving that to a pre aggregated table refreshed hourly cut the bill by more than a third on its own. After that it is the usual list: queries missing the partition filter, SELECT star on very wide tables, warehouses sized XL because someone was in a hurry, and no auto suspend so they idle all night. Then guardrails, so query timeouts, per user byte limits, and a cost dashboard the team actually sees weekly.
Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.
See how it worksFollow-up questions to expect
- How would you attribute cost back to individual teams?
- When is a materialized view the wrong solution?
- How do you stop cost creeping back up after a cleanup?
Related data engineer questions
Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.
Predict my questions