troubleshooting Question

Object Oriented Design - Transportation Network

Avatar of sriram
sriram asked on
C++JavaAlgorithms
8 Comments3 Solutions1037 ViewsLast Modified:
Hello,
I am trying to find the best design approach to solve an interview question. I appreciate if you could send me UML diagram and the code (Java/C++). Also, please guide me how to start (thinking about) modeling objects.

Problem:

I would like you to design a transportation network. A transportation network has warehouses, and trucks that transfer items from one warehouse to another.

How would you represent this system in Java (or C++)?

Could you draw a diagram, say a UML diagram, of the classes in question?

I want to add a cost to the routes from one warehouse to another. How would you change the system? (Add a couple more attributes if necessary until a Route class appears.)

Trucks have a particular amount of fuel in them. I want to make sure that one truck can reach another warehouse in the system without running out of fuel. How would you change the system to do that? (They must add methods and classes to their system to effect the change.)

What if only certain items can be delivered to a particular warehouse? Example: Warehouse A can have only books, Warehouse B can have only CDs, Warehouse C can have both books and CDs. Given a particular item, we want to know the lowest cost path to a warehouse that can take this item. How would you change the system to do this? (Candidates must add attributes/methods to warehouses.)

Thanks
ASKER CERTIFIED SOLUTION
ambience

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros