Build a package-allocation model for couriers
Company: Amazon
Role: Data Scientist
Category: Machine Learning
Difficulty: hard
Interview Round: Onsite
You previously assigned packages to couriers manually. Build a model to automatically assign the number of packages per courier per shift, optimizing for on-time delivery and fairness. Define: (1) objective function(s) (e.g., maximize on-time probability − λ·overtime − μ·distance; fairness constraints on workload variance), (2) constraints (shift hours, vehicle capacity by weight/volume, delivery windows, geo contiguity, skill requirements, historical stop-time distributions), (3) required data features (route density, travel-time forecasts by hour and weather, package size class, stop difficulty, historical courier productivity), and (4) algorithmic approach: predict per-stop service time with ML (gradient boosting) and feed predictions into a constrained optimizer (integer/linear programming or min-cost flow). Describe how you will handle cold-start couriers, robustify against distribution shift, and design a fast rebalancing heuristic for last-minute spikes. Provide pseudocode for the end-to-end loop (forecast → optimize → simulate → assign → monitor) and explain fallback behavior if the optimizer fails.
Quick Answer: This question evaluates a candidate's ability to design an end-to-end ML-driven package-to-courier allocation system, testing competencies in predictive modeling (per-stop service-time forecasting), constrained combinatorial optimization for routing and fairness, feature engineering, simulation, and production concerns such as cold-start handling and distribution shift. It is asked to assess how candidates balance competing objectives like on-time delivery versus fairness under real-world constraints (shift hours, vehicle capacity, delivery windows, time-varying travel forecasts), and is categorized under Machine Learning with a focus on practical application-level system design rather than purely conceptual theory.