PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Machine Learning/Amazon

Build a package-allocation model for couriers

Last updated: Mar 29, 2026

Quick Overview

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.

  • hard
  • Amazon
  • Machine Learning
  • Data Scientist

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.

Related Interview Questions

  • Predicting the Next Elevator Call Location - Amazon (medium)
  • Explain Transformer and MoE Fundamentals - Amazon (medium)
  • Explain Core ML Interview Concepts - Amazon (hard)
  • Evaluate NLP Classification Models - Amazon (easy)
  • Explain overfitting, regularization, and LLM techniques - Amazon (medium)
Amazon logo
Amazon
Oct 13, 2025, 9:49 PM
Data Scientist
Onsite
Machine Learning
3
0

Automatic Package-to-Courier Assignment with ML + Optimization

You previously assigned packages to couriers manually. Design an end-to-end system that automatically assigns packages per courier per shift, optimizing for both on-time delivery and fairness.

Provide the following:

  1. Objective Function(s)
  • Define a primary objective (e.g., maximize on-time probability − λ·overtime − μ·distance) and fairness criteria (e.g., limit variance of workload or use CVaR fairness).
  1. Constraints
  • Include: shift hours, vehicle capacity (weight/volume), delivery windows, geographic contiguity, skill requirements (e.g., hazmat), and realistic service-time behavior (from historical stop-time distributions).
  1. Required Data Features
  • Specify features such as route density, travel-time forecasts by hour and weather, package size class, stop difficulty, and historical courier productivity.
  1. Algorithmic Approach
  • Predict per-stop service time using ML (e.g., gradient boosting with prediction intervals) and feed predictions into a constrained optimizer (integer/linear programming, VRPTW, min-cost flow, or column generation).
  • Explain how you will handle cold-start couriers, guard against distribution shift, and design a fast rebalancing heuristic for last-minute spikes.
  1. Pseudocode
  • Provide pseudocode for the end-to-end loop: forecast → optimize → simulate → assign → monitor.
  • Explain fallback behavior if the optimizer fails or times out.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Machine Learning•More Amazon•More Data Scientist•Amazon Data Scientist•Amazon Machine Learning•Data Scientist Machine Learning
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.