Build an end-to-end ML pipeline
AmazonApplied Scientist · OnsiteLast updated
Build an end-to-end ML pipeline evaluates ML product requirements, data/labeling, modeling, serving architecture, evaluation, monitoring, and trade-offs in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Given a CSV with shipment events (order_id, origin, destination, ship_date, promised_date, carrier, weight, item_count, scan_events[], delivered_date), build from scratch a Python pipeline that: (
- loads and validates data; handles missing values, outliers, and time zones; (
- creates features (e.g., day-of-week, route, carrier stats, dwell times from scan_events); (
- labels examples as delayed if delivered_date − promised_date > 48 hours (justify how you handle undelivered items and censoring); (
- trains a baseline model (logistic regression or gradient-boosted trees) with cross-validation; reports ROC-AUC and PR-AUC; addresses class imbalance; (
- calibrates probabilities and explains top features; (
- outputs a CSV of top-K at-risk shipments with calibrated probabilities and reason codes. Optimize for runtime < 5 minutes on 1M rows and memory < 4 GB, and discuss strategies to speed up training/inference and ensure reproducibility.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.