Requirements


Functional Requirements:


  • Allow reservation of a parking spot.
  • Process payment for the reservation.
  • Enable parking of a car in the reserved spot.
  • Support early departure before reservation time expires.
  • Gate check-in/out.
  • Handle no show.



Non-Functional Requirements:


  • user authorization and authentication
  • integration with third-party payment system
  • HA for check-in and check-out
  • scaling


API Design

GET /parking/{parking_id}/slots?available=true

POST /parking/{parking_id}/slot/{slot_id}/reserve

POST /reservation/{reservation_id}/pay

POST /reservation/{reservation_id}/confirm

POST /reservation/{reservation_id}/cancel

POST /parking/{parking_id}/check-in/{slot_id}

POST /parking/{parking_id}/check-out/{slot_id}


High-Level Design

Client

Use React framework

Sever

  • Use kotlin and spring-boot as base for project
  • Postgresql db to store parking, slots, reservation. And to achieve strong consistency.
  • Payments should be handled with some third-party SAAS payment provider
  • Use Auth0 for user management



Detailed Component Design

Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.