Design a parking lot
Fifty minutes into the round, your code works. A car comes in, gets a spot, and pays on the way out. Then the interviewer says: "Weekends are a flat ₹150 a day now. Show me what changes."
If the honest answer is "most of it", the round is lost, and it was lost in minute ten, when you chose your classes. The parking lot is the most common first LLD question because it is small enough to finish and still has three decisions that separate a working answer from a good one: which spot a car gets, what happens when two gates ask at once, and what the fee method is allowed to know.
A cloakroom does not care what your coat is made of. It cares whether it fits on a hook or needs the big rail, which hook is free, and how long you left it. The token is the only thing that connects the coat going in with the coat coming out. A parking lot is the same machine with bigger coats.
What this round expects#
LLD rounds come in two shapes, and how much code you write depends on which one you are in. Ask at the start if nobody tells you.
| Design round on a whiteboard | Machine coding round | |
|---|---|---|
| Time | Usually 45 to 60 minutes | Usually 90 minutes to 2 hours |
| What you produce | The class diagram, the key interfaces, one flow walked through, the one hard method in code or pseudocode | Code that compiles and runs, with a small demo at the bottom. In memory storage, no UI |
| What gets scored | Where you drew the lines between classes, and whether you can defend each one | The same, plus whether it runs, whether it reads well, and how fast a follow up goes in |
| On this page | Steps 1 and 2, then Change it | All of it. The code in Step 3 is the whole program, about 130 lines |
Either way, the order of work is the same, and it is the order of this page: agree the requirements, find the objects, draw how they connect, then write code from the top down.