Katkat

Forecast bikes available at a station

Two SigmaData Scientist · Technical Screen

Last updated

This question tests the ability to design a robust time-series forecasting pipeline, specifically addressing feature engineering for cyclic temporal patterns and the selection of appropriate validation strategies for sequential data.

Problem Statement

You are working with a dataset from a bike-share system. Each record contains the number of available docks at a specific station, aggregated at 15-minute intervals. Your goal is to predict the number of available docks for a specific station over the next 24 hours (a 96-step horizon).

Data Schema

  • timestamp: Datetime object.
  • station_id: Unique identifier for the bike station.
  • available_docks: Integer count of currently empty docks.
  • temp, humidity, precipitation: Weather metrics.
  • is_holiday: Boolean flag.

Task

  1. Propose a feature engineering strategy to capture the cyclic nature of time (e.g., time-of-day, day-of-week) and the influence of recent history on current availability.
  2. Describe how you would handle the temporal nature of the data when splitting into training and validation sets to avoid data leakage.
  3. Propose a loss function that penalizes under-estimation (running out of bikes/docks) more heavily than over-estimation.
  4. Outline the model architecture or statistical approach you would use and explain why it is suitable for this specific station-level granularity.

Constraints

  • The model must run inference in near real-time.
  • Station dynamics are highly correlated with neighboring stations (spatial dependence).
  • Data exhibits non-stationarity due to seasonal shifts and urban growth.

Hints

Hint 1

Consider using trigonometric transforms (sine/cosine) for cyclical features to ensure the model treats 23:59 and 00:01 as close in time.

Hint 2

For temporal validation, use a rolling window or expanding window cross-validation approach instead of traditional random K-fold splits.

Hint 3

A custom asymmetric loss function, such as a modified pinball loss used in quantile regression, can help manage the cost of stockouts versus excess capacity.

Follow-up questions

  • How would you handle cold-start problems for a brand new bike station that has no historical data?
  • If your model is trained on a single station, how would you extend it to predict availability across a network of 500+ stations while accounting for bike repositioning flows?
  • How would you detect concept drift in this system, and what trigger mechanism would you implement for model retraining?