Preparing your design workspace

Loading the problem and your saved attempt…

Design and Implement Partner Slot Routing

Assign customer jobs to eligible partner slots while preserving working hours, capacity, and conflict rules.

For this exercise, customers request a service at a location and time window, while partners publish working hours, service capabilities, service areas, and capacity. The router returns eligible slots ordered by a pluggable strategy; every strategy must use stable partner identity as its final tie-breaker. It can then reserve one slot for a customer job. A partner cannot hold overlapping confirmed jobs beyond capacity, requests outside working hours or service range are rejected, and concurrent reservations for the same capacity must produce one committed winner. Design the domain, interfaces, assignment strategy boundary, and interactions, then implement a working Node.js/TypeScript in-memory core with tests. Use a simple distance or zone abstraction supplied by the caller; exclude map routing, payments, notifications, and persistent storage. Treat every time window as half-open [start, end), so adjacent windows do not overlap. Reusing a request identity with the same normalized payload returns the original success or failure, while reusing it with a different payload is rejected.