Design Container Assignment with Incompatible Goods
Design a service that assigns goods in a shipment to ocean containers, respecting capacity and incompatibility rules. The system should support drafting, recomputing, approving, and adjusting plans before loading.
Constraints & Assumptions:
- Each item has weight, volume, quantity, handling attributes, and a shipment ID.
- Each container type has weight and volume limits.
- Certain item pairs or hazard classes cannot share a container.
- The optimization goal prioritizes feasibility, then container cost, then unused capacity.
Part 1: API and Data Model
Define the API and data model for goods, compatibility rules, container types, plans, assignments, plan versions, and validation results. Cover operations such as create, solve, inspect, approve, and modify.
Part 2: Planning Engine
Describe the feasibility checks, a practical assignment algorithm, boundaries for exact solvers, deterministic output, and how to handle cases where no plan is feasible.
Part 3: Reliability and Operations
Explain the approach to asynchronous execution, retries, cancellation, approval races, handling rule changes, monitoring, and manual overrides.
AI interview prep
Core dilemma
Balancing the complexity of combinatorial optimization (assigning items to containers with numerous constraints) against the need for a scalable, reliable, and auditable service that can handle real-world operational demands and potential changes.
3 tradeoffs and 3 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Design Container Assignment with Incompatible Goods
Design a service that assigns goods in a shipment to ocean containers, respecting capacity and incompatibility rules. The system should support drafting, recomputing, approving, and adjusting plans before loading.
Constraints & Assumptions:
- Each item has weight, volume, quantity, handling attributes, and a shipment ID.
- Each container type has weight and volume limits.
- Certain item pairs or hazard classes cannot share a container.
- The optimization goal prioritizes feasibility, then container cost, then unused capacity.
Part 1: API and Data Model
Define the API and data model for goods, compatibility rules, container types, plans, assignments, plan versions, and validation results. Cover operations such as create, solve, inspect, approve, and modify.
Part 2: Planning Engine
Describe the feasibility checks, a practical assignment algorithm, boundaries for exact solvers, deterministic output, and how to handle cases where no plan is feasible.
Part 3: Reliability and Operations
Explain the approach to asynchronous execution, retries, cancellation, approval races, handling rule changes, monitoring, and manual overrides.