Engineering Time and Location Features for Rider Demand Forecasting
Last updated: November 29, 2026
Quick Overview
You need to forecast ride requests per hexagon per 15 minute window for the next hour. What features would you build from time and location, and how do you avoid leakage?
Uber
November 29, 20260
0
0 solved
You need to forecast ride requests per hexagon per 15 minute window for the next hour. What features would you build from time and location, and how do you avoid leakage?
Demand forecasts drive surge, driver positioning nudges and incentives at Uber, and the H3 hexagon grid is the standard spatial unit. The interviewer checks that you can encode cyclic time, spatial neighbors and recent history without peeking at the future.
What the Interviewer Expects
- Encode cyclic time with sine and cosine or learned embeddings
- Use lag and rolling features only from data available at prediction time
- Add spatial context from neighboring hexagons
- Include calendar and event signals (holidays, concerts, weather)
- Explain how to handle sparse low-volume hexagons
Key Topics to Cover
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
- How would you represent a hexagon ID for a tree model versus a neural net?
- What changes for a city you just launched with two weeks of data?
- How do you validate a forecasting model honestly?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Explore ML Interview PrepSample Answer
Clarify
Prediction is made at time for windows to minutes. Any feature must be computable from data with timestamp at or before , with realistic pipeline delay (say the last 2 minutes of ...
Approach
Group features into four families.
Time. Hour of day and day of week as cyclic pairs: , , so 23:45 is close to 00:00. Holiday flags, days to payday, school term ...