How would you visually explore a time series to spot trend, seasonality, and level shifts during EDA?
Quick Overview
Asks how to explore a time series visually during exploratory data analysis to find its long-run trend, repeating seasonal cycles and sudden level shifts. It tests practical plotting and decomposition skills and the judgment to tell a real structural break from noise or a one-off outlier.
How would you visually explore a time series to spot trend, seasonality, and level shifts during EDA?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
How would you visually explore a time series to spot trend, seasonality, and level shifts during EDA?
Assume you have one metric recorded at a regular interval, such as daily sign-ups over two years, and you want to understand its structure before you model it.
```hint Separate the time scales
Each of the three patterns moves at a different speed. Think about which plot or transformation isolates the slow movement, which one isolates the repeating cycle, and which one makes a sudden jump stand out.
```
```hint Confirming a cycle
A line plot can suggest a weekly or yearly pattern without proving it. Consider a plot that shows how strongly the series is correlated with itself at a fixed lag, and what a trend does to that plot.
```
### What a Strong Answer Covers
- Starting from the raw series on a proper datetime axis and checking gaps, spikes and the sampling grain
- How to isolate the long-run trend from noise, including how the smoothing window is chosen
- At least two ways to expose and confirm seasonality
- How to recognize a level shift and tell it apart from a trend or a one-off outlier
- A decomposition step and what the residual tells you
### Follow-up Questions
- How would you choose the smoothing window when daily data has both a weekly and a yearly cycle?
- When would you use a multiplicative decomposition, or log the series before decomposing it?
- You see what looks like a level shift in March. How would you test whether it is real?
- How would a change in how the metric was logged show up in these plots, and how would you tell it apart from a real change in behavior?
Overview: Asks how to explore a time series visually during exploratory data analysis to find its long-run trend, repeating seasonal cycles and sudden level shifts. It tests practical plotting and decomposition skills and the judgment to tell a real structural break from noise or a one-off outlier.
How would you visually explore a time series to spot trend, seasonality, and level shifts during EDA?
Assume you have one metric recorded at a regular interval, such as daily sign-ups over two years, and you want to understand its structure before you model it.
What a Strong Answer Covers Guidance
Starting from the raw series on a proper datetime axis and checking gaps, spikes and the sampling grain
How to isolate the long-run trend from noise, including how the smoothing window is chosen
At least two ways to expose and confirm seasonality
How to recognize a level shift and tell it apart from a trend or a one-off outlier
A decomposition step and what the residual tells you
Follow-up Questions Guidance
How would you choose the smoothing window when daily data has both a weekly and a yearly cycle?
When would you use a multiplicative decomposition, or log the series before decomposing it?
You see what looks like a level shift in March. How would you test whether it is real?
How would a change in how the metric was logged show up in these plots, and how would you tell it apart from a real change in behavior?