How do irregular or unevenly-spaced timestamps complicate time series modeling, and how do you handle them?
Role: Data Scientist
Category: Statistics & Math
Difficulty: medium
Interview Round: Other
How do irregular or unevenly-spaced timestamps complicate time series modeling, and how do you handle them?
Examples of such data include transactions, clinic visits, and sensors that report only when their reading changes.
```hint Ask what a lag means
If consecutive observations can be one minute apart or one week apart, what does "lag 1" measure, and what does an ARIMA coefficient on it estimate?
```
```hint Ask why the gaps exist
For each way of handling the gaps you propose, consider what it assumes about why observations are missing.
```
### What a Strong Answer Covers
- Which parts of classical models depend on equal spacing (lags, differencing, seasonality, rolling windows)
- Whether the gaps themselves carry information, and how that changes the approach
- Regularizing onto a grid, including the choice between aggregation, interpolation and forward fill, and what each one costs
- Continuous-time or gap-aware models, and features built from elapsed time
- Leakage and evaluation pitfalls that come with filling gaps
### Follow-up Questions
- A sensor reports only when its reading changes by more than a threshold. How does that change the way you would fill gaps?
- You resample to hourly, interpolate the missing hours, then train a forecaster. Where could leakage come in?
- How would you detect weekly seasonality in unevenly spaced data without resampling it?
- How would you run a continuous-time AR(1) process through a Kalman filter when the gap between observations varies?
Overview: Asks why irregular or unevenly spaced timestamps cause trouble for time series models built on a fixed sampling interval, and what practical ways exist to handle them. Tests understanding of lags and seasonality, resampling and imputation choices, continuous-time models and leakage.