Bike Rental Application

Difficulty: MEDIUMCategory: LLDFrequency: 1Asked On 2025-09-17

Problem Statement

design a Bike Rental Application (like Bounce, Yulu, or Lime) that allows users to search, book, rent, and return bikes. The system should manage bikes, users, rentals, and payments, ensuring smooth and reliable operations.


Functional Requirements (FR)


User Management


•Register/login using email/phone.
•Maintain profile details (name, phone, license/ID proof).
•View rental history and wallet balance.


Bike Management


•Add/remove/update bikes in the system.
•Track bike availability and location.
•Support different types of bikes (scooter, cycle, e-bike).


Search & Booking


•Search for nearby available bikes.
•Reserve a bike for a limited period before pickup.
•Cancel a booking before ride starts.


Rental Process


•Start a ride (unlock bike via app/QR code).
•Track ride duration and distance.
•End ride and mark bike as available again.


Payment System


•Calculate fare based on time/distance.
•Support multiple payment methods (wallet, UPI, card).
•Handle refunds in case of ride cancellation.


Notifications


•Send booking confirmation, ride start/stop alerts.
•Notify users about low wallet balance.


Admin Features


•Manage bikes (add/remove/update status).
•View reports on usage, revenue, and active rentals.


Non-Functional Requirements (NFR)


•Scalability: Handle thousands of concurrent rentals.
•Reliability: Ensure no double-booking of the same bike.
•Low Latency: Searching bikes should be near real-time.
•Security: Ensure user data and payments are secure.


Core Entities / Classes


•User: userId, name, email, phone, licenseId, walletBalance
•Bike: bikeId, type, location, status (available/booked/in-use/maintenance)
•Booking: bookingId, userId, bikeId, startTime, endTime, status
•Rental: rentalId, bookingId, distance, duration, fare, status
•Payment: paymentId, rentalId, amount, method, status


Operations


•registerUser(userDetails)
•searchBikes(location, type)
•bookBike(userId, bikeId)
•startRide(bookingId)
•endRide(rentalId, bikeId)
•calculateFare(rentalId)
•makePayment(userId, rentalId, method)


Constraints & Considerations


•Bikes should not be double-booked.
•Need locking mechanism when allocating bikes.
•Real-time bike location updates for accurate availability.
•Grace period for reservations before auto-cancel.
•Admin can mark bikes under maintenance.


✅ This is a complete LLD problem statement for a Bike Rental Application.


Solution

Comments