Avatar of sriram
sriram
 asked on

Object Oriented Design - Transportation Network

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
C++JavaAlgorithms

Avatar of undefined
Last Comment
sriram

8/22/2022 - Mon
David L. Hansen

Since it's been a while that you've been waiting on an answer, I'll jump in and give you a hand.  I hesitated to answer because this is an interview question.  With that in mind, allow me to walk you through the thought-process and give some suggestions.  Does that sound ok?
sriram

ASKER
yep; that helps.
SOLUTION
dpearson

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
sriram

ASKER
Yes, it helps; thank you.
Can you please show me class dependencies using UML diagram
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
dpearson

Sorry - I don't speak UML (never seen one that was actually useful in a business context).

Doug
SOLUTION
David L. Hansen

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
ambience

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
sriram

ASKER
Thank you all for the advice. The comments particularly from ambience helped me a lot.

Regards