InterviewDryRun

How to prepare for a low-level design (LLD) interview

A low-level design round asks you to turn a small real-world system, a parking lot, an elevator, a vending machine, into classes and interfaces, and then change it. It rewards clean modelling and clear trade-offs, and it punishes jumping straight into code. Here is how to approach it and how to practice.

Published

Low-level design versus system design

System design is about services, databases and scale: how a million users reach a URL shortener. Low-level design (LLD, also called object-oriented design or machine coding) is about the inside of one program: which classes exist, what each one owns, how they talk to each other, and how easily the design takes a new requirement. You might be asked for a class diagram, for working code, or for both.

What the interviewer is grading

  • Requirements. Did you pin down what the system must do, and what it does not need to do, before modelling anything?
  • Modelling. Are the classes the nouns of the problem, with clear responsibilities and no class doing everything?
  • Extensibility. When the interviewer adds a requirement, does it mean adding a class or rewriting three?
  • Principles and patterns. Do you apply them where they help and leave them out where they do not?
  • Code quality. If you write code, is it readable, correct and safe when two threads use it at once?

A 45-minute structure

  1. Requirements, 5 minutes. List the use cases as short sentences: “a car enters and gets a ticket”, “a driver pays on exit”. Ask about scale only where it changes the design, such as several entry gates at once.
  2. Core entities, 5 minutes. Underline the nouns: lot, floor, spot, vehicle, ticket, payment. Decide which are classes, which are enums and which are just fields.
  3. Relationships and interfaces, 10 minutes. Who owns whom, what varies, and where an interface belongs. Draw it as a simple class diagram.
  4. Key flows, 10 minutes. Walk one or two use cases through your classes, method by method. This is where missing responsibilities show up.
  5. Code, 10 minutes. Write the core classes and the most important method, or the whole thing in a machine coding round.
  6. Extensions, 5 minutes. Expect “now add electric vehicle charging” or “now support two elevators”. Show where the change lands.

The principles and patterns that actually come up

You do not need every pattern in the book. These cover most LLD rounds:

  • Single responsibility and open-closed. One reason to change per class, and new behaviour by adding code rather than editing it. Interviewers test this with the extension question.
  • Strategy. Swappable algorithms behind one interface: pricing rules, spot allocation, elevator scheduling.
  • State. Objects whose behaviour depends on their state: a vending machine that is idle, has money, or is dispensing.
  • Observer. Notifying displays or other components when something changes, such as a spot becoming free.
  • Factory. Creating the right subtype, a car, bike or truck, without spreading if chains everywhere.
  • Singleton, sparingly. Mention it for a single controller if it fits, but do not build the design around it.

Name a pattern only after you have explained the problem it solves in this design. “I will use a strategy here so pricing can change per lot” lands far better than “I will use the strategy pattern”.

The classic questions

  • Design a parking lot: spot types, allocation strategy, tickets and payment, concurrent gates.
  • Design an elevator system: request handling, a scheduling strategy, and the state of each car.
  • Design a vending machine: a state machine for idle, has money, dispensing and out of stock, plus change-making.
  • Others worth one attempt each: a library management system, a movie ticket booking system, a snake and ladder or chess game, an expense-sharing app, and an in-memory cache with eviction.

How to practice

Design out loud, then code

Work each question on a whiteboard or paper first, speaking as if an interviewer were listening, and only then write the code. Doing it in that order trains the habit interviewers want to see, and stops you coding yourself into a corner.

Always do the extension

After each design, invent two new requirements and add them. If one requires editing several existing classes, that is the lesson: find the abstraction that would have absorbed it.

Get pushed back on

LLD is a conversation. The most useful practice is with someone who asks “why is that a class?” and “what if there are two gates?”. InterviewDryRun runs low-level design rounds with Max, who scopes the problem with you, questions your class choices, adds requirements part way through and scores the result, with an editor for the code and a whiteboard for the diagram. For the large-scale side of design rounds, see the system design practice guide.

Common mistakes

  • Coding in the first five minutes. Without requirements and entities, the code gets rewritten twice.
  • One giant manager class that holds every list and every method.
  • Pattern stuffing. Five patterns in a vending machine is a red flag, not a strength.
  • Inheritance where composition fits. A vehicle that “has” a payment method should not “be” one.
  • Ignoring concurrency when two entry gates or two elevators clearly share state.

Questions to practice next

Try it on a real interviewer

Free: a 5-minute voice round and unlimited typed drills, with scored feedback and a model answer. No card, and your camera is never recorded. How the free mock interview works.

Start a free interview