Original practice scenario: A hypothetical home-improvement tool assigns requested board lengths to available stock lengths, accounting for saw-cut loss. Propose a practical algorithm and explain its limits.
Read model answer +
Model the problem with explicit units, stock inventory and cut loss. A fast heuristic can produce a useful cutting plan, but it should not claim minimum waste without an optimization guarantee.
Work through it
Validate positive requested lengths, required quantities and usable stock lengths, reserving kerf for each cut under a documented cutting convention.
Try a descending-length placement heuristic or a bounded optimization method, tracking remaining usable length and opening additional stock only when necessary.
Return the assigned cuts and waste by stock piece, checking conservation and testing exact fits, impossible requests and repeated sizes.
Tradeoffs to discuss
Exact search may reduce waste for small inputs but grows expensive; heuristics are faster and need an honest quality bound or comparison baseline.
Common pitfalls
Do not mix inches and centimeters or round away cut loss.
The plan is a computational estimate; material defects and safe tool use require separate practical assessment.
Original practice scenario: A hypothetical home-improvement delivery service must consider vehicle volume, weight and handling capability when offering slots. Design reservation and rescheduling behavior.
Read model answer +
Represent delivery capacity as multiple constrained resources rather than a count of orders. Two orders can have very different vehicle and handling requirements even when each has one item.
Work through it
Create a versioned delivery demand from item dimensions, weight, handling flags and destination constraints, distinguishing unknown product data from zero requirements.
Reserve the required resources atomically or through a recoverable hold protocol, expiring abandoned choices and recalculating when the order changes.
Reconcile route assignment with the promised slot, exposing infeasible changes for customer choice instead of silently overbooking capacity.
Tradeoffs to discuss
Detailed capacity models improve feasibility but depend on accurate catalog data; conservative allowances reduce utilization while limiting failed deliveries.
Common pitfalls
An accepted payment does not prove a suitable vehicle or handling team is available.
A reschedule must release or supersede the old capacity reservation exactly once.