Keep the code in version control rather than in a local notebook or an ad hoc query tab, parameterize dates instead of hard coding them, and record which source tables and which snapshot or run date the numbers came from. Document the definitions and any manual exclusions inline. If the underlying tables are mutable, save the aggregated output alongside the code so the published figures remain verifiable.
Why interviewers ask this
Reproducibility is what separates an analyst whose work can be trusted and built on from one whose numbers quietly evaporate the moment they are questioned. Interviewers want version control, parameterized inputs, and clear awareness that source data mutates, so rerunning the same query months later can legitimately return different numbers unless you captured the state at the time.
How to structure your answer
- Put the query or notebook in version control, not on a laptop.
- Parameterize dates and filters rather than hard coding them.
- Record source tables, run date, and any manual exclusions.
- Save the output aggregate, since sources mutate over time.
- Write down definitions where the next person will find them.
Example answer
The main thing is that the code lives somewhere other than my machine, so a repository rather than an untitled notebook or a query tab I will close by Friday. Dates get parameterized, because hard coding a date range means the next person quietly reruns it over a different window and gets a different answer with no warning. I record which tables I used and when I ran it, and crucially any manual decision, so if I excluded test accounts or one anomalous week, that is written down in the file rather than living in my memory. The subtle problem is that source tables mutate. Someone reruns my query in March and gets different numbers, not because I was wrong but because a type 1 dimension was overwritten or late data arrived. So for anything published I save the aggregated output next to the code. That way when someone questions a figure six months later, I can show what the data looked like at the time and what changed since.
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 handle a source table that gets overwritten daily?
- What would you include in a README for an analysis?
- How do you version control notebooks in a reviewable way?
Related data analyst 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