What an LLD interview tests
easy 40 minA low-level design round gives you one vague sentence and about 45 minutes.
Video lesson · Chapter 1 of 6
Make a prediction
0:00 / 5:00
See it run
The same prompt with and without owners, the lens, and the score sheet.
Operations
The weak class
One class, loose lists, no checks.
Step 1 of 5
A bike is free
Bike b1 stands at north. Everything about it is in one list.
Step 1: A bike is free
def action(self, kind, rider, station, bike, now): b = self.bikes[bike] if kind == "start": b[0] = "riding" b[2], b[3] = rider, now return None if kind == "finish": minutes = now - b[3] b[0], b[1] = "docked", station return minutes * 20- Shows
- Fast typing
- Costs
- Every rule
Ask for each method: what would make this call wrong, and who says no?
In the real world
The same what an lld interview tests doing real jobs. Pick one and step through it.
The lens on a lending library.
Step 1 of 5
Container
| Question | Found | |
|---|---|---|
| Container | What holds? | Shelf, section |
| Item | ||
| Manager | ||
| Policy | ||
| Lifecycle |
Shelves and sections.
Step 1: Container
Common mistakes
The bugs interviewers watch for, with the fix beside each.
Facts as positions
majorNobody knows what index 2 is.
Wrongb[2] = riderRightRide(rider, bike, now)Change before check
criticalThe second caller overwrites the first.
Wrongbike.state = RIDINGbike.rider = riderRightif bike.state is not DOCKED: raise Refused()bike.move_to(RIDING)Delete before the step that fails
criticalA full station leaves a bike without a ride.
Wrongdel rides[rider]station.put(bike)Rightstation.put(bike)del rides[rider]A pattern without a force
minorIt adds names and answers no question.
Wrongclass RideFactorySingleton: ...RightRide(rider, bike, now)
Interview tips
Ask first
- Main path in one line
- Who may, what refuses, what varies
- Read the scope back
Name owners
- One sentence per rule
- Reject nouns aloud
- Split a class with many fields
Prove it
- Invariant, then trace
- One refusal
- One race
Stay small
- Value before class
- Enum before State
- Method before interface