← 返回 uber 的题目列表React Parking Lot System
类型:online_judge
Build a small “Parking Lot Management” frontend app using React (no backend required; in-memory data is fine).
Requirements
The parking lot has F floors and S spots per floor (define a stable numbering scheme).
Users can:
enter a license plate plate
choose a vehicle type (>= 2 types)
click Park to assign a spot (define an allocation strategy)
click Leave to free a spot
UI should show:
availability/occupancy stats (per floor; per type is a plus)
a list/grid of spots (occupied status, plate, type)
errors: full lot, duplicate plate, invalid input
State management:
explain how state is organized across components (Context/Reducer, etc.)
ensure operations are atomic (avoid double-allocation on rapid clicks)
Optional:
search by plate
pricing based on entry/exit time
localStorage persistence
Constraints
Use function components and Hooks
Provide key component breakdown and core code; styling is optional but interactions should work.