allow users to pick parking spots with duration and dates
process payment user id or car id for reservation
car id based verification or qr code scanning based entry and exit
An database storing these values for the duration and fast enough for access
monthly/weekly plans allowing user to pay one time for daily reservations on fixed times
gate check in check out system
no shows incase of no show allow utilization to other vehicles
payment processing allowing upi card debit card payments
No double booking the same spots
ensure uptime
ensure capacity to service users during peak hours,
utilizing token bucket system
cross platform flexibility
scalability is not functional nor required
backups of database
GET /lots/{lotId}/availability?startTime=...&endTime=... — tells the user if spots are free with their id using which a simple gui shows the location of spotPOST /reservations — temporarily locks a spot (say for 10 mins while the user pays)PUT /reservations/{id}/confirm — finalizes after payment4 Confirm Exit Get /reservations/carid/end time and confirms it if an inconsistency of more than 30 minutes penalizes.
5 allow manual staff entries for manual offline ticketing. same as user api but does not verify payment keeping it as staff verified same step 1-3
Mobile and web app
api gateway
reservation functions
transaction function
database storing each reservation with car number and time with function to quickly return free spots or verify user, wipes out every transaction older than 7 days
qr generation function generates qr tickets fetching from database
payment provider allowing upi payments credit card debit card offline cash using existing api payment frameworks and custom frontend. like we will just utilize third party api this will allow flexible options without needing to setup communications with providers.
cash flow calculated as per user payments
burst handled by token bucket system
for commits git is used and for caching also
caching is handled by utilizing existing top algorithms decided based on database
Define the data model. Identify the main entities, their attributes, and relationships. Consider the choice of database type (SQL vs NoSQL) and justify your decision based on access patterns...
same booking not possible due to locking the spot for 10 min when a user is processing fees and acid principles this deals with same booking issues
we utilize semaphore and also remove the spots which are booked so users cannot book it again.
spike management using token bucket system deals with load issues
no duplicate requests are allowed as data is continuosly normalized
penalization of 100 for more than 30 min expired, 200 for 1 hour expiry, 500 for one day expire , 1000 for a week and for more than a month the vehicle gets towed
cache clears out 7 day old bookings, and 60 day old subscriptions everyday this deals with stale cache
holds are renewed based on users exiting
if the duration of an hold exceeds time limit staff is notified and vehicle can be towed for harsh occurences
for close timings in booking atleast 30 minute gap is kept incase the hold is full an hold which is not yet filled will be assigned
this deals with overlapping bookings if they do occur which they cannot