Design a parking lot
medium 90 minModel a car park with several levels as classes: vehicles, spaces of different sizes, tickets and a replaceable price rule.
Watch lesson4:48
What each level should show
The same question is judged differently for mid, senior and staff.
Expectations
The same question at four levels
Junior
Must show
- Asks about sizes and prices
- Classes with one job
- Working enter and leave for one thread
Will be probed on
- Why an enum?
- What happens when it is full?
- Trace two cars
Stands out
Finds one bug in their own code by tracing.
Mid
Must show
- Pricing behind an interface
- Free spaces grouped by size
- Sees the race when pointed at it and fixes it with a lock
Will be probed on
- Add weekend prices
- Where is the lock released?
- Which class changes for electric?
Stands out
Rejects classes aloud and injects the clock without being asked.
Senior
Must show
- Raises the race before the interviewer
- No lock during payment, ticket taken out first
- Failure walk for the exit
- Money in whole cents
Will be probed on
- Compare lock, compare and set, database
- Timeout of the card
- Nearest space
Stands out
Brings the sum that shows one lock is enough, and says when it would not be.
Staff
Must show
- States the invariants and argues why they hold
- Chooses what to leave out and defends it
- A test that forces the bad order
Will be probed on
- Levels with leases and no network
- Booking against walk-ins
- How would three teams own this?
Stands out
Names the guarantee that gets softer with every step of scaling, and who in the business must agree.