Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions questions.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,29 @@ write an API for client who will give date and time and API should return meetin
- Each book and member card will have a unique barcode. The system will be able to read barcodes from books and members’ library cards.

- Design an API rate limiter.

- Flipkart is starting a new vehicle rental service called FlipKar. In this service, we will rent different kinds of vehicles such as cars and bikes.

- Features:
Rental service have multiple branches throughout the city.
Each branch has limited number of different kinds of vehicles.
Each vehicle can be booked with predefined price per unit time slot. For simplicity, current pricing model does not support dynamic pricing or update on prices based on seasonality.
Each vehicle can be booked in multiples of 1 hour time slot.
All bookings should be made before the start time of particular booking.

- Requirements:
Onboard a new branch with available vehicle.
Onboard new vehicle(s) of existing type to a particular branch.
Rent vehicle for a time slot and a vehicle type (lowest price as the default choice of selection of vehicle, this should be extendable to any other strategy). While booking a vehicle if
availability is not there, then it should fallback to another available branch, which is derived based on the vehicle selection strategy.
A system view should be made available, such as currently booked vehicles, available vehicles of all the branches.

- Test cases:
(Test-cases are defined for understanding feature requirements only. Please model it appropriately based on your service implementation)
add_branch(‘koramangala’, [“1 suv for Rs.12 per hour”, “3 sedan for Rs.10 per hour”, “3 bikes for Rs.20 per hour”]);
add_branch(‘jayanagar’, [“3 sedan for Rs.11 per hour”, “3 bikes for Rs.30 per hour”, “4 hatchback for Rs.8 per hour”]);
add_branch(‘malleshwaram’, [“1 suv for Rs.11 per hour”, “10 bikes for Rs.3 per hour” , “3 sedan for Rs.10 per hour”]);
add_vehicle(‘koramangala’, “1 sedan”); //add 1 sedan to koramangala
rent_vehicle(‘suv’, 20th Feb 10:00 AM, 20th Feb 12:00 PM); // should book from malleshwaram.
rent_vehicle(‘suv’, 20th Feb 10:00 AM, 20th Feb 12:00 PM); // should book from koramangala.
rent_vehicle(‘suv’, 20th Feb 10:00 AM, 20th Feb 12:00 PM); //Should fail saying no vehicle.