System requirements
Functional:
- Get a parking spot for vehicle
- Charge vehicles for parking
Non-Functional:
- Low Latency
- Highly Available
- Consistent
Capacity estimation
API design
GET /v1/parkVehicle -
Request
{
"vehicleType": ["CAR", BIKE, TRUCK],
}
Response
{
"parkingId":
"parkingSpot":
"startTime":
""
}
POST /v1/exitVehicle
{
"parkingId":
}
Database design
spot_info:
spot_id - UUID, PK, NON NULL
vehicle_type:
location:
occupied
parking_info
parking_id - UUID, PK, NON NULL
spot_id - FK
start_time
end_time
payment
payment_id - UUID, PK, NON NULL
transaction_id -
parking_id - FK
status -
High-level design
API Gateway - Rate Limiting, Analytics, Fraud Detection
API Servers
ParkingSpotService
PaymentService
Request flows
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...
Detailed component design
Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...
Trade offs/Tech choices
Explain any trade offs you have made and why you made certain tech choices...
Failure scenarios/bottlenecks
Try to discuss as many failure scenarios/bottlenecks as possible.
Future improvements
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?