REPOSITORY CODING · HARD
Failed dispatch assignment leaves a vehicle unavailable
An audit failure reserves the vehicle anyway, and a finished route can be finished again. Repair transaction isolation and route state transitions across the application.
Repository ImplementationMulti-stop dispatch planner
Work through a real codebase.
Choose an environment, investigate the existing implementation and use the tests to check your change. Sign in to open a workspace; execution and Ono usage follow your plan’s allowances.
Task requirements and environments
C++ · 80 minute session
- register creates a unique vehicle with positive integer capacity. inspect reads it; available lists available vehicle IDs sorted by ID.
- plan takes a manifest id and 1–100 uniquely identified stops. Each stop has nonnegative pickup and drop units. Drop existing cargo before pickup. Cargo must never be negative and must finish at zero.
- The manifest peak is the maximum onboard cargo after any stop, not the sum of pickups. assign requires planned status, an available vehicle and peak no greater than its capacity.
- finish requires assigned status and releases its vehicle. Finished manifests cannot be assigned or finished again. manifest reads a manifest.
- Commands include tenant. Mutations, audit and retry receipts commit together. failAudit must roll back. Optional request keys replay the same payload and reject changed payloads. history is tenant-scoped.