# 1. Check availability (Real-time)
GET /api/v1/lots/{lotId}/availability?vehicleType=CAR&start=2026-04-01T10:00:00Z&end=2026-04-01T14:00:00Z
Response: {
"availableSpots": 12,
"spots": [{"id": "A-101", "type": "COMPACT", "price": 15.00}],
"dynamicPricing": {"surgeMultiplier": 1.2}
}
# 2. Hold spot (Pre-reservation lock)
POST /api/v1/reservations/hold
Body: {"lotId": "lot-123", "spotId": "A-101", "start": "...", "end": "..."}
Response: {
"holdId": "hold-uuid-789",
"expiresAt": "2026-04-01T09:15:00Z", # 15 min to pay
"paymentIntent": "pi_123456"
}
# 3. Confirm reservation (After payment)
POST /api/v1/reservations/confirm
Body: {"holdId": "hold-uuid-789", "paymentMethod": "card_123"}
Response: {
"reservationId": "res-456",
"qrCode": "base64encoded",
"licensePlate": "ABC-123"
}
# Gate checks if vehicle can enter
POST /api/v1/gate/validate
Body: {
"gateId": "gate-south-1",
"licensePlate": "ABC-123", # OR "qrCode": "..."
"timestamp": "2026-04-01T09:58:00Z"
}
Response: {
"allowed": true,
"reservationId": "res-456",
"spotId": "A-101",
"action": "OPEN_GATE"
}
Describe the overall system architecture. Identify the main components needed to solve the problem end-to-end. Use the diagramming tool to create a block diagram.
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.