For Drivers:
For Parking Lot Admins:
Derived from the use cases, below are following APIs for different groups of users:
Some data structure we would use below:
ParkingLotMetadata {
String id,
boolean hasSpace,
float hourlyPrice,
float dailyPrice,
String address,
String phoneNumber,
boolean hasDisabledParking
}
ParkingLotInfo {
String id,
boolean hasSpace,
float hourlyPrice,
float dailyPrice,
String address,
String phoneNumber,
boolean hasDisabledParking,
List
}
Location {
boolean reserveOnly,
boolean disabledParking,
Enum locationType(S,M,L),
boolean isOccupied,
Integer floorNum,
Integer positionNum,
}
Reservation {
Enum Status{Reserved, InProgress, Finished, Canceled}
Date reservationDate,
Duration, reservationDuration,
String parkingLotId,
String parkingLotNumber
}
DurationType {
HOUR,
DAY
}
PaymentType {
CreditCard,
Paypal,
ApplePay,
GooglePay,
Venmo
}
OwnedParkingLotMetadata {
String id,
float hourlyPrice,
float dailyPrice,
String address,
String phoneNumber,
boolean hasDisabledParking,
Date OwnUntil,
String contractLink
}
For Drivers:
For Parking Lot Admins:
In the ER diagram session, I have defined different resources that might be used in this application. Considering we are clear about the data access pattern and we need horizontal scaling considering the data volume above. I'd recommend to go with NOSQL Databases.
However, with this decision, there are several caveats:
Among various types of database, considering the data access pattern, wide column database is a better fit. If we'd like to have more management/control and have more resources then we can go with Cassandra. If we would like to go with cloud managed-solutions then DynamoDB can be the one to choose. It depends on our cost budge and the overall infrastructure decision.
On high level, there are multiple components we need in this system:
For the sake of interview, below request flows sample some APIs and demonstrate the workflow.
I'd like to dive deep into following components: