Scenario
You are designing software for a large e-commerce fulfillment center to plan truck routes and manage containers/inventory movement within and across facilities.
The system must support:
-
Inbound trucks delivering pallets/containers to a fulfillment center.
-
Outbound trucks picking up containers for delivery to other facilities or last-mile hubs.
-
Containers (e.g., totes/pallets) that hold inventory items and move between
dock doors
,
staging areas
, and
storage locations
.
Functional Requirements (FR)
-
Create and manage shipments
: inbound/outbound loads with a list of containers and planned arrival/departure windows.
-
Assign trucks to dock doors
and time slots; detect and resolve conflicts.
-
Route planning
:
-
Given a set of stops (facilities/docks) and time windows, produce a feasible route/sequence.
-
Support re-planning when conditions change (delays, cancellations).
-
Track container state
end-to-end:
-
Container location (facility + zone), status (created, staged, loaded, in-transit, received), and contents summary.
-
Inventory correctness
:
-
Prevent double-allocation of a container/inventory.
-
Reconcile when scans disagree or events arrive late/out of order.
-
APIs/UI
: dispatchers can view routes, door schedule, and container statuses; operators can scan containers.
Non-Functional Requirements (NFR)
-
High availability for operational workflows (door assignment, scan updates).
-
Low-latency updates for scan events (near real-time).
-
Auditability: full history of container movements and changes.
-
Multi-warehouse support; permissions/access control.
Constraints / Assumptions (you can state reasonable ones)
-
Many scan events per minute; multiple facilities.
-
Network partitions can happen; scan devices may buffer events.
Deliverables
Design:
-
High-level architecture (services, data stores, messaging).
-
Core data model (key entities and relationships).
-
Key APIs/events.
-
Consistency strategy (idempotency, ordering, deduplication).
-
Routing/optimization approach (exact vs heuristic) and what you optimize for.
-
Observability and failure handling.