Low-Level Design Interviews: What to Expect
A low-level design (LLD) interview asks you to turn a small product idea into classes and working code. "Design a parking lot", "design an elevator", "design a rate limiter". There is no database to pick and no load balancer to draw. Instead, you decide which objects exist, what each one is responsible for, how they talk to each other, and how the code behaves when something goes wrong.
The round goes by several names: object-oriented design (OOD), machine coding, or simply "the design coding round". The formats differ, but the skill being tested is the same: can you write code that a teammate could read, trust and extend next month? This post explains what the round looks like, what is actually graded, how the longer machine-coding format changes things, which language to use, and how LLD fits next to the high-level design round.
π‘ The short version: interviewers are not looking for the "right" class diagram. They are watching how you get from a vague prompt to clear rules, whether each class has one obvious job, whether your code handles the edge cases, and whether the design bends cleanly when they change a requirement.
What a Low-Level Design Round Looks Like
Most companies run one of three formats. Ask your recruiter which one you will get, because the right preparation differs.
The discussion round (45 to 60 minutes). You get a short prompt, ask questions, list the entities, sketch the classes, and then write the core methods. The code may be in a shared editor or on a whiteboard, and it usually does not have to run. The interviewer interrupts often with "what if" questions. This is the most common format at large tech companies.
The machine-coding round (90 minutes to 3 hours). You get a longer written problem statement, often with a list of commands the program must support, and you write a complete, runnable program in your own IDE. At the end you demo it, and the interviewer reads your code. This format is common at startups and at companies that hire many backend engineers at once. It is covered in detail below.
The take-home. Same as machine coding, but you do it alone over a day or a weekend and then walk through it on a call. Expect higher standards for tests and structure, since time pressure is not an excuse.
A few companies blend these: a 60-minute round where you write real code in an IDE and run a few tests the interviewer gives you. Treat that one as a short machine-coding round.
β οΈ Common mistake: preparing only by reading class diagrams. Every format ends with you writing code under time pressure. If you have never typed out a full parking lot or LRU cache yourself, the first one should not be in the interview.
What Interviewers Grade
Rubrics differ in wording, but almost all of them score the same six things. Knowing them tells you where to spend your time.
1. Turning a vague prompt into clear requirements
The prompt is short on purpose. "Design a library system" hides a dozen decisions: How long is a loan? Can a member reserve a book that is out? Are there fines? The interviewer wants to see you find the questions that change the design, ask them, and write down the answers as rules you will code against.
Asking twenty questions is as bad as asking none. Each question should settle a real decision: a rule, a limit, an error case, or a tie-breaker.
2. Picking the right objects
The second thing graded is your domain model: the classes you choose and the data each one holds. Good models
use the nouns of the problem (Book, Loan, Member) and give each rule a single home. Weak models either cram
everything into one class or invent a class for every noun, including ones that are only a field.
3. Clear responsibilities and boundaries
Interviewers look at where each rule lives. If "a member may hold at most five books" is checked in three places, or the entry-point class reaches deep into other objects to change their fields, the design will be hard to change.
Bad:
class Library:
def borrow(self, member_id: str, book_id: str, today: int) -> None:
member = self.members[member_id]
if len(member.loans) >= 5:
raise ValueError("limit reached")
copy = self.books[book_id].copies[0]
copy.status = "LOANED"
copy.due = today + 14
member.loans.append(copy)
What the bad version costs you. Library knows the loan limit, the copy's status values and the loan length.
When the interviewer asks "students may hold ten books", you have to edit the orchestrator, and any other method
that lends books has to repeat the check.
Good:
class Member:
MAX_LOANS = 5
def can_borrow(self) -> bool:
return len(self.loans) < self.MAX_LOANS
class Library:
def borrow(self, member_id: str, book_id: str, today: int) -> Loan:
member = self.members[member_id]
if not member.can_borrow():
raise ValueError("limit reached")
copy = self.catalog.take_available_copy(book_id)
loan = Loan(member, copy, due=today + LOAN_DAYS)
member.add_loan(loan)
return loan
Each rule now has one owner. Library coordinates, and the objects it calls protect their own state.
4. Correct code that handles the edge cases
You will write real methods, and they will be read line by line. Interviewers check the happy path first, then
the cases people forget: an empty collection, a duplicate id, a value at the exact limit, an operation on something
that was already removed. Saying "I'll return -1 if the book doesn't exist" before you code it shows you have
thought about errors as part of the design, not as an afterthought.
5. Extensibility
Near the end, you will hear "now suppose..." follow-ups: a new vehicle type, a new pricing rule, a second elevator, several threads calling the same method. The interviewer is checking whether your design absorbs the change in a new class or a small edit, or whether it forces a rewrite. You don't need to predict every follow-up. You need a design where the obvious ones land in one place.
6. Communication
Finally, interviewers grade how you work: do you explain a choice before making it, check in at milestones, and respond well when they push back? A quiet candidate with a perfect design scores lower than one with a good design who explained every trade-off, because the interviewer cannot give credit for reasoning they never heard.
π― Where the points are: in a 45-minute round, roughly a third of the signal comes from requirements and the model, a third from the code itself, and a third from follow-ups and how you talk through them. Running out of time with no code at all is the most expensive failure.
Machine-Coding Rounds
A machine-coding round is an LLD interview where the code must actually run. The problem statement is usually a
page long and lists exact operations ("register_user, add_expense, show_balances"), sample inputs, and the
expected output. You get 90 minutes or more, and you work in your own editor.
Three things change compared with a discussion round.
Working code matters most. A program that handles four of the six commands correctly beats a beautiful design that crashes on the first input. Get a thin version running early, then add features one at a time, running it after each one.
Code quality is read closely. Because you have more time, the bar for structure is higher. Interviewers expect separate classes for the model, the services that apply the rules, and a small driver that parses input. They read names, look for duplication, and check that errors are handled rather than ignored.
Storage is in memory. Nobody wants a real database. Keep your data in dictionaries and lists behind a small class, so that "how would you persist this?" has a clean answer: replace that one class.
A typical machine-coding project has three layers. Keep each one thin.
# model: plain data with the rules that guard it
@dataclass
class Expense:
paid_by: str
amount_cents: int
split_between: list[str]
# service: the operations from the problem statement
class ExpenseService:
def __init__(self, store: ExpenseStore) -> None:
self.store = store
def add_expense(self, expense: Expense) -> None: ...
def balances(self) -> dict[str, int]: ...
# driver: parse each command and print the result
def main() -> None:
service = ExpenseService(InMemoryExpenseStore())
for line in sys.stdin:
cmd, *args = line.split()
if cmd == "EXPENSE":
service.add_expense(parse_expense(args))
elif cmd == "SHOW":
print_balances(service.balances())
The driver is the only place that knows about text input and output. If the interviewer later asks for a REST
API instead of a command line, only main changes.
π‘ Machine-coding tip: in the first ten minutes, write the driver with every command wired to a method that does nothing. Then fill the methods in one at a time. You always have something to demo, and you never get stuck with half the commands unwired when time runs out.
Things to leave out unless the statement asks for them: a user interface, a real database, configuration files, logging frameworks, and dependency-injection libraries. Things to keep in even when nobody asks: input validation, clear error messages, and money in integer cents.
Choosing a Language
Use the language you write fastest and most correctly. The interviewer cares about your design, and a language you are fluent in lets you spend your attention on it. That said, the common choices each have quirks worth knowing.
| Language | Strengths in LLD | Watch out for |
|---|---|---|
| Java | Interfaces, abstract classes, enums and access modifiers make the design explicit; most interviewers read it fluently | Boilerplate eats time; use records (Java 16+) or keep getters to what you need |
| Python | Fastest to write; reads like pseudocode | Easy to slip into dicts of dicts; use dataclass, Enum, ABC and type hints so the design is visible |
| C++ | Expected for some systems and trading roles | Ownership (unique_ptr versus raw pointers) and headers cost time; keep it to one file |
| Go | Small interfaces and structs map well to LLD | No inheritance; show polymorphism through interfaces and say so |
| TypeScript | Interfaces and union types are expressive | Avoid any; the types are what show your design |
The biggest risk in a dynamic language is hiding the design inside untyped data.
Bad:
def park(lot: dict, plate: str, kind: str) -> dict:
for spot in lot["spots"]:
if spot["size"] >= {"moto": 1, "car": 2, "truck": 3}[kind] and not spot["taken"]:
spot["taken"] = True
return {"plate": plate, "spot": spot["id"]}
return {}
What the bad version costs you. The interviewer cannot see your entities, the field names are spelled out by
hand in every function, and a typo (spot["taknen"]) fails silently. It also looks like you don't know how to
model objects in your own language.
Good:
class VehicleType(Enum):
MOTORCYCLE = 1
CAR = 2
TRUCK = 3
@dataclass
class ParkingSpot:
spot_id: str
size: int
taken: bool = False
def fits(self, vehicle: VehicleType) -> bool:
return not self.taken and self.size >= vehicle.value
The same logic, but the entities are named, the types are visible, and the rule lives with the data it reads.
π‘ Interview tip: if the interviewer asks you to use a specific language, use it. If they leave it to you and you are equally comfortable in two, pick the one with explicit interfaces (Java, C#, TypeScript, Go). It makes your abstractions visible without extra explanation.
How LLD Relates to High-Level Design
High-level design (HLD, or system design) and low-level design look at the same software from different distances. HLD asks how the system is split into services, where data is stored, and how it scales to millions of users. LLD zooms into one of those services and asks how its code is organized.
| High-level design | Low-level design | |
|---|---|---|
| The question | Which services, stores and queues, and how do they scale? | Which classes, and how do they behave? |
| Building blocks | Services, databases, caches, queues, load balancers | Classes, interfaces, enums, methods |
| Typical concerns | Throughput, latency, availability, consistency, sharding | Responsibilities, invariants, edge cases, extensibility, thread safety |
| Output | A box-and-arrow architecture diagram | Class sketches and working code |
| Typical follow-up | "What happens at 10x traffic?" | "How do you add a new type?" |
A ride-hailing app shows the difference well. In the HLD round, you draw a location service that receives driver GPS pings, a matching service that pairs riders with nearby drivers, a trip service with its database, and a payment service. You discuss geo-indexing, how often drivers send their location, and what happens when a region goes down (see Design a Ride-Sharing App).
In the LLD round, you zoom into the matching and trip logic. Now the questions are: what are the states of a
Trip (requested, accepted, in progress, completed, cancelled), which transitions are legal, how does a
MatchingStrategy pick a driver, and how is the fare computed (see
Design a Ride-Sharing Service).
Some companies, ride-hailing and delivery companies among them, put both rounds in the same loop, sometimes on the same product. That is good news: your HLD answer tells you which service the LLD round will zoom into, and your LLD answer gives you concrete objects to talk about in HLD. Keep the levels separate, though. In an LLD round, "we'd put this behind Kafka" is not an answer to "how does a trip get cancelled?". In an HLD round, a twenty-line class is too much detail.
β οΈ Common mistake: bringing system design into an LLD round. If you start talking about sharding, replicas and caches when the interviewer asked for classes, you lose time and signal. Mention scale in one sentence if it matters ("in production the trips would live in a database; here they're in a dict behind
TripRepository") and move on.
Common Problem Types
LLD prompts fall into a handful of families. Each family tests a slightly different skill, so practice at least one from each.
- Games: tic-tac-toe, chess, snakes and ladders. They test turn logic, board representation and win checks.
- Resource allocation and booking: parking lot, movie tickets, hotel. They test search rules, tie-breaking and double-booking.
- State machines: vending machine, ATM, elevator. They test legal and illegal transitions.
- Infrastructure components: LRU cache, rate limiter, logging framework. They test data-structure choice and, often, thread safety.
- Business apps: Splitwise, library management, food delivery. They test modelling many related entities without drowning in them.
Concurrency is a common add-on to any of these. Once the base design works, "what if two gates call park at the
same time?" is a natural follow-up, and senior candidates are expected to handle it (see
Concurrency Fundamentals).
How to Prepare
Learn a repeatable process. The delivery framework walks you through requirements, entities, classes, implementation and extensibility with a time budget. Having a plan means you never stare at a blank editor wondering what to do next.
Know the building blocks. You should be able to explain OOP concepts, the design principles, the common class relationships, and five or six patterns (strategy, state, observer, factory, decorator) without notes. You won't recite them, but you will use them in every answer.
Write the code for real. Pick eight to ten problems across the families above and code each one end to end, in the time you will have in the interview. Then reread your code the next day and fix what you would criticize in someone else's.
Practice out loud. Explaining a design while typing is a separate skill. Do at least a few mock rounds with a friend, or record yourself and listen back for long silences.
The Round in an Interview
Here is what the first five minutes of a strong answer sound like for "design a library system":
You: "Before I design anything, a few questions. Do members borrow copies of a book, so there can be several copies of the same title? How long is a loan, and is there a limit per member? Can a member reserve a title that's fully checked out, and if so who gets it when a copy comes back? And are fines part of this?"
Interviewer: "Multiple copies, yes. Two weeks, five books max. Reservations are first come, first served. Fines are out of scope."
You: "Great. So the rules are: borrow a free copy if the member is under five loans; return frees the copy and hands it to the first reservation if there is one. I'll model
Libraryas the entry point,Catalogfor titles and copies,Member,Loanand a reservation queue per title. Then I'll code borrow, return and reserve, and leave time for follow-ups."
In under a minute of talking, the interviewer has heard the rules restated, the classes named, and a plan for the rest of the round. Everything after that is filling in what you promised.
A few habits separate strong candidates throughout the round:
| Habit | Why it scores |
|---|---|
| Restate the requirements as a numbered list | The interviewer can correct a misunderstanding before you code it |
| Say what each class is responsible for in one sentence | Shows clear boundaries; exposes classes doing two jobs |
| Code the happy path first, then the edge cases | Guarantees something works; shows you know what can go wrong |
| Name the trade-off when you choose ("a dict for O(1) lookup by id") | Turns a silent choice into visible judgment |
| Trace one scenario through your code at the end | Catches your own bugs before the interviewer does |
| Say when a pattern is not worth it | Senior signal: judgment, not just knowledge |
Summary
- An LLD round asks for classes and working code, not services and databases. The formats are a 45-60 minute discussion round, a 90+ minute machine-coding round, or a take-home.
- Interviewers grade six things: requirements, the domain model, responsibilities, correct code with edge cases, extensibility, and communication.
- In machine coding, runnable code comes first: wire a driver early, keep storage in memory, keep the model, services and I/O in separate layers.
- Use the language you are fastest and most correct in. In a dynamic language, make the design visible with dataclasses, enums and type hints.
- HLD decides the services; LLD designs the code inside one of them. In a loop with both, keep each round at its own level of detail.
- Prepare with a repeatable framework, the core OOP ideas and principles, and real practice code written against the clock.