My Solution for Design an Efficient Parking Lot System with Score: 4/10
by paradox_tidal115
System requirements
Functional:
1.car checking and checkout out
2.spot assigment, based on car size
3.payment processing, caculate fees based on parking duration.
4.provide real-time infor on avaiblae parking spot
Non-Functional:
1.scalabilty, handle peak parking demand
2.Available: duing peak hours
3.secury: secure user data and payment transcations
Capacity estimation
100 parking lots
2 hours average parking duration,
peak is 50 cars per hour
API design
1.CHeck in(car_details,assginedSpot): return spot
2.checkout(car_details, spotID), free up spot and return caculated fee,
3.payment, procssing payment detials, confirm transcations
4.SpotAvailibility: retrieve current parking availibility
Database design
Relational DB:
parking_spot_table: spot id, zone, avaiblestatus
car: car_id, size
Transcation:
High-level design
You should identify enough components that are needed to solve the actual problem from end to end. Also remember to draw a block diagram using the diagramming tool to augment your design...
Request flows
User check-in, recorded the spot, make it occupied.
user-checkout, caculate the duration, and get the price, get the price, make that spotID available
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?