Freelancer Trial Assessment
Prove It. Then We Hire.
Welcome — this is a paid trial gate for back-office, dispatcher, CRM, and developer hires. Complete the task below, submit, and we'll review within 48 hours.
💻
Developer — Trial Task
Write a Python function (any flavor — async OK) that:
```python
def calculate_deadhead(loads: list[dict]) -> dict:
"""
Input: list of loads, each like
{"id": "L1", "origin": "Charlotte,NC", "destination": "Atlanta,GA", "pickup_date": "2026-07-12"}
Return: {
"total_deadhead_miles": float,
"trips": [{"from_load": "L1", "to_load": "L2", "deadhead_miles": float}, ...]
}
"""
```
Use any free distance API (you can mock if you prefer). Include:
- Sample input + expected output
- Tests
- One paragraph on how you'd scale this to 1000 loads / day