List functional requirements for the system (Ask the chat bot for hints if stuck.)...
List non-functional requirements for the system...
Estimate the scale of the system you are going to design...
Define what APIs are expected from the system...
Public Endpoints
POST Request - User selects allotted space and reserves it before proceeding to third party payment (Stripe). Handles functional requirements of reserving and looking up available spaces.
Request:
{
"reservation_id": "14207",
"parking_space_id": "12",
"user_name": "Stephen"
}
Response:
{
"receipt_id": "16062",
"expiration_time": "2024-01-22 18:00:00"
}
DELETE Request - Deletes provided user's reservation id
Response:
204 HTTP Response Code
Params:
int reservation_id
Internal Endpoints
GET Request - Calculates available parking space given parking lot id and occupancy after querying the database. Used for display on some screens on the web app i.e. when user first access the parking garage. Calculates based on COUNT or other SQL queries based on parking_lot_id and filtering on number of occupied spaces.
Request:
{
"parking_lot_id": "14017"
}
Response:
{
"available_spaces": 7
}
Used to calculate how many free spaces we might have available in a parking lot to display on our web app
Params:
int parking_lot_id
(Handled by third party - Stripe)
Defining the system data model early on will clarify how data will flow among different components of the system. Also you could draw an ER diagram using the diagramming tool to enhance your design...
Tables:
Parking_Lot_Tbl
Schema
parking_space_id (int: Primary Key - Unique)
parking_lot_id (int)
space_type: (varchar)
address: (varchar)
city: (varchar)
country: (varchar)
available: (boolean)
Transaction_Tbl
Schema
transaction_id (int: Primary Key - Unique)
name: (varchar)
parking_space_id: (int)
space_type: (varchar)
date: (datetime)
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. If you are unfamiliar with the tool, you can simply describe your design to the chat bot and ask it to generate a starter diagram for you to modify...
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...
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...
Explain any trade offs you have made and why you made certain tech choices...
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?