Loading…
Loading…
Think through: what represents a parking spot? A vehicle? What decides which spot a vehicle gets? Where does the fee calculation live, and why should it be a separate class from the ticket itself?
Consider: how would you support adding a new vehicle size (e.g. "oversized") without editing every place that currently checks if vehicle.size == ...? How would you support multiple fee-calculation schemes (flat rate vs. per-hour vs. weekend pricing) that can be swapped independently?
Design your own solution first — on paper, a whiteboard, or your own IDE — before checking the reference.