Engineer Geospatial Features for Last-Mile Delivery Time Prediction

Last updated: November 29, 2026

Quick Overview

Predict how long a driver will take to complete each stop on an Amazon delivery route. Design location-based features from addresses, coordinates and historical deliveries, and explain how you would avoid overfitting to individual addresses.

Amazon
Machine Learning
Machine Learning Engineer
Amazon
November 29, 2026
Machine Learning Engineer
Onsite
Machine Learning
Medium

0

0

0 solved


Predict how long a driver will take to complete each stop on an Amazon delivery route. Design location-based features from addresses, coordinates and historical deliveries, and explain how you would avoid overfitting to individual addresses.

Last-mile planning at Amazon uses per-stop service time estimates to build routes. Interviewers want to see creative but disciplined geospatial features: spatial aggregation at the right resolution, building and access attributes, and smoothing for sparse locations.

What the Interviewer Expects
  • Separates drive time between stops from service time at the stop
  • Uses spatial indexing such as geohash or H3 cells at multiple resolutions
  • Builds historical aggregates per address, building and cell with smoothing
  • Adds access features such as apartment versus house, locker, gated community
  • Validates with spatial or time-based splits to avoid leakage
Key Topics to Cover
geospatial features
H3 or geohash
hierarchical smoothing
spatial cross-validation
service time
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • Why might random train test splits overstate accuracy here?
  • How would you handle a brand new apartment complex?
  • How do you combine features at different spatial resolutions?
  • What signals indicate parking difficulty?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Explore ML Interview Prep
Sample Answer
Clarify

Ask whether the target is service time only (park, walk, hand off) or includes driving, what data exists (GPS pings, scan timestamps, address metadata), and the prediction horizon (route planning the ...

Approach

Service time depends heavily on the place: high-rise buildings with mailrooms, gated communities, or rural driveways. Build features at several spatial levels and smooth sparse levels toward their par...


Submit Your Answer
Markdown supported