Ewance
← All challenges Software Engineer

Greedy Delivery-Slot Assignment for a Munich Grocery Startup

Duration
2 weeks
Level
Intermediate
Type
Design
Team
1 to 5 people

The situation

The company is a venture-backed grocery-delivery startup operating across Munich's urban zones, where four-hour delivery windows and a fleet of around 120 part-time riders make slot assignment a daily bottleneck for its small dispatch team.

Your task

Replace manual delivery-slot assignment with a greedy algorithm that matches or beats human dispatchers on slot-fill rate while never violating rider working-hour constraints.

The brief

What you do

  1. Using the provided order history sample, rider roster, and manual dispatch baseline, design and implement a greedy slot-assignment algorithm in Python.
  2. The algorithm must (1) sort incoming orders by a priority you can defend, for example orders with the narrowest acceptable delivery window first, (2) assign each order to the rider whose earliest available four-hour slot satisfies the order's preference and that rider's shift and maximum-working-hour constraints, and (3) handle the 'no rider fits' case explicitly rather than silently dropping the order.
  3. Validate against the manual dispatch baseline on three metrics: slot-fill rate, customer-preferred-slot match rate, and rider-utilization variance.
  4. Reference only the three provided materials; no external data is required.

Success looks like

Success means a working algorithm that never violates a roster constraint in the provided data, beats or matches the manual baseline on at least two of the three metrics, and comes with an honest analysis of the conditions under which the greedy approach degrades.

What you will practice

  • Design a greedy heuristic with a defensible priority ordering for a constrained assignment problem.
  • Translate real-world scheduling constraints (shifts, maximum working hours, slot windows) into explicit code checks.
  • Define fair, well-specified benchmark metrics and compare a heuristic against a human baseline.
  • Reason about and communicate the failure modes of a greedy approach versus full optimization.
  • Structure a technical design proposal that ties every claim to observable evidence in the data.

A suggested way in

  1. Consider sorting orders by ascending slot-window width so the most-constrained orders are placed first, and justify the choice against alternatives.
  2. Use a priority queue or sorted structure to find each rider's earliest available fitting slot efficiently.
  3. Define slot-fill rate, preferred-slot match rate, and utilization variance precisely before computing them, and apply the same definitions to the manual baseline.
  4. Construct adversarial mini-scenarios (a demand spike, an understaffed day) to expose where greedy underperforms an optimal assignment.

Skills you will practice

Greedy algorithms, Algorithm analysis, Python, Constraint handling, Benchmarking, Data structures

Where it leads

Backend / Algorithms Engineer, Logistics Optimization Engineer, Data / Decision Engineer

How it is assessed

  • Correctness25%

    On the provided order history and rider roster, the algorithm produces assignments that never violate a rider's shift or maximum-working-hour constraint, verified by the pytest suite.

  • Greedy reasoning25%

    The proposal defends its priority ordering with a clear argument or proof sketch grounded in the structure of the order history data.

  • Benchmark quality30%

    Comparison against the manual dispatch baseline uses explicitly defined, fairly applied metrics computed over the same provided orders.

  • Limit honesty20%

    The limitations section names concrete conditions in or beyond the provided data where greedy degrades and states what to do instead.

Resources

  • PythonTool

    Primary language for implementing and testing the greedy assignment algorithm.

  • pandasTool

    Load the order history and roster data and compute the benchmark metrics.

  • pytestTool

    Assert that constraints are never violated across the provided dataset.

  • MatplotlibTool

    Visualize slot-fill and utilization comparisons against the manual baseline.

Sample Ewance certificate of completion, verified by LearnCoin
Sample certificate
Your proof

Finish it. Earn this.

A verified certificate with your name. Anyone can check it.

Time to practice.

Solve this challenge
Related challenges

More like this.