As far as a Design Question like this is concerned:
1) Design a base class car
class Car {
String model;
String make;
String carSegment; // SUV, MUV, Sedans, Hatchbacks etc
String seats;
boolean bookingStatus; // Booked or not
...
public assignToCustomer (String custID) {...}
}
2) Design a class customer
class Customer {
String name;
String custID;
...
}
3) Design a class that handles reservationMgmt
class ReservationMgmt {
// Map <String, String> query; // use this to store query params. User may
give more than one search criterias
public List<Car> checkCarAvailability (Date startDate, Date endDate,
Map<String, String> query)
{
... Logic goes here
}
// Now make a reservation using that list retrieved from query
public void makeReservation (List<Car> availableCars)
{
...
}
} // End of class
Then comes a trickier part: Designing a DB Schema for this system (WHICH
customer has reserved WHICH car from WHICH startDate to WHICH endDate),
which should be normalized. (If you design a basic one, the interviewer
expects you to improve it)
*The solution above is a VERY simple one. You can put in all your creativity
to design this.* ;)
*PS. If you really want to make an impression, try using some Design
Patterns (iff applicable to the Problem Statement)*
On Fri, Aug 12, 2011 at 11:39 PM, Ankur Garg <[email protected]> wrote:
> +1..me too need answers for this
>
>
>
> On Fri, Aug 12, 2011 at 11:39 AM, MAC <[email protected]> wrote:
>
>> if someone can share one good solution , it would really help me. I am
>> unable to form the answer to these questions
>>
>> --mac
>>
>>
>> On Fri, Aug 12, 2011 at 1:15 PM, MAC <[email protected]> wrote:
>>
>>> thanks guys .. so lets take the question we had "design a car rental
>>> system" .. so the interviewer can say , ok requirement is that you have a
>>> pool of cars , people come and book a car for a particular time slot if
>>> available . This is the most basic thing . so now what , what shd i do next
>>>
>>> --mac
>>>
>>>
>>> On Fri, Aug 12, 2011 at 1:11 PM, keyan karthi <[email protected]
>>> > wrote:
>>>
>>>> First thing tat should come to your mind s ' requirements ' ask him
>>>> wat de requirements are..... He will expect tat..
>>>>
>>>> On 8/12/11, MAC <[email protected]> wrote:
>>>> > Hi guys ,
>>>> >
>>>> > Can anyone help me in understanding what is expected when some some
>>>> one
>>>> > asks you " design a car rental system" . Exactly what all is required
>>>> to be
>>>> > told to the interviewer .
>>>> >
>>>> > --
>>>> > thanks
>>>> > --mac
>>>> >
>>>> > --
>>>> > You received this message because you are subscribed to the Google
>>>> Groups
>>>> > "Algorithm Geeks" group.
>>>> > To post to this group, send email to [email protected].
>>>> > To unsubscribe from this group, send email to
>>>> > [email protected].
>>>> > For more options, visit this group at
>>>> > http://groups.google.com/group/algogeeks?hl=en.
>>>> >
>>>> >
>>>>
>>>> --
>>>> Sent from my mobile device
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to
>>>> [email protected].
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>>
>>>
>>>
>>> --
>>> thanks
>>> --mac
>>>
>>>
>>
>>
>> --
>> thanks
>> --mac
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.