Design a Logistics System

  • 31

    I was asked this question in Adobe Interview .
    We have to design a logistics system where a client can place an order to get his/her items delivered to a given destination .
    We have to keep track of status of all the orders . The admin of logistics charges some amount for delivering the orders (Items).

    My Solution :

    classes :

    1. Vehicle (Extended by Truck, Bike )
    2. Order
    3. Item
    4. Location (for geographical position of any point)
    5. Client
    6. Admin

    Enums :

    public enum VehicleStatus {
        FREE ,
        BUSY ,
    public enum OrderStatus {
        DELIVERED ,
        PROCESSING , 
    public enum PaymentStatus {
    public enum OrderPriority {
    // for geographical position of any point
    class Location {
    	float longitude;
    	float latitude;
    // for the vehicles used for transportation
    class Vehicle {
    	int id;
    	String vehicleNo;
    	int capacity;
    	Location current_position;
    	VehicleStatus current_condition;
    class Truck extends Vehicles{
    class Bike extends Vehicles{
    // a new order is created for each order place by any client
    class Order{
    	int order_id;
    	OrderPriority priority_of_order;
        Client owner_of_order;
        Location destination;
        int amount_of_charge;
        List<Item> items;
        int total_weight;
        OrderStatus current_status;
        PaymentStatus status_of_payment;
        Time time_of_order_placed;
        Time time_of_delivery
    // An order is List of Items
    class Item {
    	String name;
    	int price;
    	int volume;
    	int weight;
    class Client {
    	int client_id;
    	String name;
    	Location adress;
    class Admin{
    void take_order (Order order)
    void process_order(Order order)
    Location track_order(int order_id)

  • 0

    great solution....

  • 0

    @shashipk11 Nice Solution!

  • 0

    Very easy to understand. Great work

  • 0

    nice Solution .(y)

  • 0

    easy to understand

  • 0

    Very nice solution!

  • 0

    @shashipk11 good Solution

  • 1

    @cc19930529 Thanks a lot !!

  • 1

    hope you got offer :)

  • 1

    @sha256pki Yes Bro :) !!

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.