Low Level Design · Interview Guide
Think clearly.
Design better.
Code with purpose.
Learn a structured approach to Low Level Design (LLD) interviews. Start with requirements, identify the right classes and relationships, design workflows, and build software that is maintainable, testable, and ready to evolve.
How to use this guide: Follow the roadmap in order. You don’t have to fully implement every infrastructure detail in an interview. Prioritize the requirements, core design, and important trade-offs, and explain your assumptions as you go.
Your design workflow
From problem statement to working design.
Use this roadmap as your checklist during an LLD interview. Select any step to jump directly to its explanation.
The detailed approach
Understand each step.
Expand each section for the questions to ask, the decisions to make, and the parking-lot example you can use to practice.
01 Requirement Analysis Understand the problem before proposing a design.
Read the problem statement carefully. Identify the core objective, the actors involved, the mandatory features, and anything that needs clarification. Use a top-down approach: establish the scope first, then work through one requirement at a time.
What to do
- Highlight the important features and business rules.
- Ask clarifying questions instead of silently assuming requirements.
- Write down assumptions so the interviewer can validate them.
- Separate essential functionality from optional enhancements.
Example — Parking Lot: Can a motorcycle use a compact parking spot? Are electric charging spots separate? Is payment required before the vehicle exits? What happens if the lot is full?
Questions to ask yourself
- Who will use the system?
- What are the primary inputs and outputs?
- Which rules are fixed, and which may change?
- What is outside the scope of this design?
02 Identify Key Functionalities Break the requirements into concrete use cases.
Translate requirements into system behaviours. Prioritize the most important functionality and implement one feature at a time. Before writing a major function, be clear about what it does.
Parking-lot functionality
- Register vehicle entry and issue a parking ticket.
- Find an eligible available spot and assign it to the vehicle.
- Calculate parking fees based on the applicable pricing rules.
- Accept payment and update the ticket’s payment status.
- Release the parking spot when the vehicle exits.
- Update the availability displayed to users.
Prioritize
Start with the main successful flow before adding secondary features.
Define responsibilities
Give each operation a clear purpose and keep responsibilities focused.
Choose appropriate data structures and algorithms for the operations that matter. For example, repeatedly scanning every parking spot may become inefficient as the lot grows.
03 Edge Cases, Error Handling & Security Design for invalid inputs, failures, and competing operations.
Think beyond the happy path. Identify what can fail, how the system should respond, and how to prevent invalid state changes.
Parking-lot edge cases
- The parking lot is full and no eligible spot is available.
- A vehicle type is incompatible with the selected spot.
- A customer attempts to pay twice for the same ticket.
- A payment fails or the payment provider times out.
- An electric charging spot is already occupied.
- Two entry requests attempt to reserve the same spot simultaneously.
- A ticket has expired or has already been closed.
How to reason about these cases
- Validation: Check vehicle type, ticket state, and payment amount.
- Error handling: Return clear errors and handle recoverable failures appropriately.
- Concurrency: Make spot reservation and state changes atomic where required.
- Security: Validate permissions and protect sensitive information.
- Performance: Identify bottlenecks, avoid unnecessary repeated searches, and choose suitable data structures.
Interview tip: Explain the correctness risk first. Then describe a reasonable solution, such as locking, transactional updates, idempotency, or validation. Avoid adding complex infrastructure without a clear requirement.
04 Define Core Classes & Relationships Identify entities, responsibilities, and object relationships.
Convert the requirements into a domain model. Identify the main entities, their data, their behaviour, and how they relate to one another. Draw a rough class diagram after the responsibilities become clear.
Possible parking-lot classes
| Class | Possible responsibility |
|---|---|
ParkingLot | Coordinate floors and overall parking operations. |
Floor | Manage the parking spots belonging to a floor. |
ParkingSpot | Represent spot type, availability, and assignment state. |
Vehicle | Represent vehicle details and vehicle type. |
Ticket | Track entry, assigned spot, and ticket status. |
Payment | Represent payment amount, status, and transaction details. |
Understand relationships
- One-to-many: A parking lot can contain multiple floors.
- One-to-many: A floor can contain multiple parking spots.
- Association: A ticket connects a vehicle to its parking session and assigned spot.
- Composition: Consider it when one object’s lifecycle is tied to another object’s lifecycle.
- Inheritance and interfaces: Use them when the domain genuinely benefits from substitutable types or shared contracts.
Design principle: Prefer clear responsibilities and appropriate composition over building a deep inheritance hierarchy without a real need.
05 Workflows & Object Interactions Show how classes collaborate to complete a use case.
Once the requirements and responsibilities are clear, map each important user journey. Determine which object initiates an operation, which object performs it, and what state changes occur.
Example: vehicle entry
Example: vehicle exit
A sequence diagram can help explain the interactions between an entry panel, parking service, spot allocator, ticket service, payment service, and exit panel. Keep the diagram focused on the use case being discussed.
06 Database Design Model persistence, relationships, and data integrity.
Decide what information must persist and how it relates. In an LLD interview, the depth of database design should match the requirements and available time.
Possible entities or tables
ParkingLotandParkingFloorParkingSpotandVehicleTicketandPayment
Design considerations
- Define primary keys, foreign keys, and entity relationships.
- Normalize data where appropriate to avoid unnecessary duplication.
- Use indexes that support important queries, such as finding available spots.
- Define constraints that prevent invalid relationships and states.
- Consider transactions when multiple changes must succeed together.
- Discuss partitioning, replication, or sharding only if scale requirements justify them.
Example: A ticket can reference its vehicle and assigned spot. A payment record can reference the ticket and retain the transaction status. A suitable uniqueness constraint or transactional reservation strategy can help prevent conflicting assignments.
07 API Design & Interfaces Define the operations the system exposes.
Identify the operations needed by the system’s clients. Define their inputs, outputs, validation rules, and failure responses. For a class-level design, these interfaces may be methods; for a service, they may be HTTP endpoints.
Illustrative REST endpoints
| Method | Endpoint | Purpose |
|---|---|---|
POST | /entry | Request vehicle entry and ticket creation. |
GET | /spots?type=COMPACT | Find spots matching a requested type. |
POST | /payments | Initiate or record a payment. |
POST | /exit | Complete the exit process. |
What to define
- Request and response structures.
- Input validation and consistent error responses.
- Authentication and authorization where applicable.
- Idempotency for operations where retries could cause duplicate effects.
- Clear separation between API controllers and business logic.
These endpoints are illustrative design examples, not a claim about the current implementation of a real parking system.
08 Choose Appropriate Design Patterns Use patterns to solve identifiable design problems.
Consider design patterns after you understand the requirements and object responsibilities. A pattern should make the design easier to maintain or extend—not simply make it more elaborate.
| Pattern | Possible application |
|---|---|
| Strategy | Support different parking-fee calculation rules. |
| Factory | Centralize creation of different parking-spot types. |
| Observer | Notify display boards when spot availability changes. |
| State | Represent ticket or payment lifecycle transitions. |
| Singleton | Consider only where a single shared instance is genuinely required. |
Remember: Singleton is not automatically necessary for a parking lot. Prefer explicit dependencies and testable designs when possible. Explain why a pattern fits before introducing it.
09 Draw the Class Diagram Communicate the structure once responsibilities are clear.
Use the class diagram to summarize the classes, their important attributes and methods, and the relationships between them. It should reflect the design you have reasoned through, not replace that reasoning.
Include the essentials
- Core classes and their key responsibilities.
- Important attributes and public operations.
- Associations and meaningful multiplicities, such as one-to-many.
- Inheritance or interface implementation where relevant.
- Dependencies that clarify how responsibilities are separated.
For the parking-lot example, show how
ParkingLot, Floor,
ParkingSpot, Vehicle,
Ticket, and Payment connect.
Keep the diagram readable and explain any non-obvious relationship.
10 Document Design Decisions Make assumptions and trade-offs easy to understand.
Document the important assumptions and explain why the design works for the stated requirements. In an interview, concise verbal documentation can be enough; for a real project, record the decisions that other developers need to understand.
- Requirements and assumptions.
- Class responsibilities and key interactions.
- Chosen design patterns and why they are appropriate.
- Important validation and error-handling rules.
- Known limitations and possible future improvements.
11 Implement the Design Translate the model into clear, maintainable code.
Explain the design before coding, then implement the most important functionality in a logical order. Keep the interviewer informed about your decisions instead of silently writing code.
One possible project structure
| Layer or package | Responsibility |
|---|---|
controller | Handle incoming requests and responses. |
dto | Represent request and response data. |
service | Coordinate business operations and rules. |
model | Represent domain entities and relevant behaviour. |
repository | Abstract persistence and data access. |
exception | Represent and handle domain or application errors. |
util | House genuinely reusable supporting utilities. |
For a service-oriented implementation, a typical flow is controller → service → repository. Keep business rules in appropriate domain or service components rather than scattering them across controllers.
Principles to keep in mind
- OOP: Encapsulation, abstraction, inheritance, and polymorphism.
- SOLID: Design for clear responsibilities and manageable dependencies.
- KISS: Keep the solution as simple as the requirements allow.
- DRY: Avoid unnecessary duplication.
- YAGNI: Don’t implement speculative features prematurely.
- SoC: Separate concerns that change for different reasons.
- Use meaningful names, useful comments, and appropriate logging.
- Prefer composition over inheritance when it better represents the relationship.
12 Write Unit Tests Verify expected behaviour and important failure scenarios.
Test the important behaviours of each component. Focus on correctness, boundary conditions, and the rules that protect the system from invalid states.
Parking-lot test scenarios
- A compatible vehicle is assigned an available spot.
- No spot is assigned when the lot is full.
- An incompatible vehicle cannot occupy a spot.
- Fee calculation returns the expected result for a known duration.
- A failed payment does not incorrectly mark a ticket as paid.
- A successful exit releases the spot and updates the session state.
- Repeated payment or exit requests are handled safely.
Start with one or two meaningful tests for each major operation where time is limited. Use unit tests for isolated logic and integration tests where multiple components must work together.
13 Review & Refine Check correctness, clarity, performance, and extensibility.
Finish by reviewing the design against the requirements. Look for unnecessary complexity, missing edge cases, poor separation of concerns, and opportunities to make the solution easier to test or extend.
Review questions
- Does the implementation cover all mandatory functionality?
- Are classes cohesive and responsibilities appropriately separated?
- Are interfaces and abstractions justified by real requirements?
- Are error cases and state transitions handled correctly?
- Are the algorithms and data structures suitable for the workload?
- Can storage be replaced or extended without rewriting unrelated logic?
- Can new spot types or pricing rules be introduced with limited changes?
- What would you improve if you had more time?
Finish strong: Summarize your design, explain its important trade-offs, acknowledge limitations, and identify a sensible next improvement.
Think like an engineer
A repeatable problem-solving strategy.
A structured process helps you avoid jumping to a solution before understanding the problem.
01. Define the problem
Understand the core issue and gather the relevant information.
02. Break it down
Divide the problem into smaller, manageable parts.
03. Explore alternatives
Consider multiple solutions instead of choosing the first idea immediately.
04. Evaluate trade-offs
Compare feasibility, risks, complexity, and benefits.
05. Implement and validate
Apply the chosen solution, test it, and adjust when needed.
06. Reflect and improve
Identify what worked and what should change next time.
Stay adaptable. Ask for clarification when necessary, communicate your reasoning, and treat feedback as part of the design process. The objective is to solve the stated problem, not to introduce every concept you know.
Quality review
What makes an LLD solution strong?
Use these criteria to review your solution before presenting the final design.
The solution covers the mandatory features and expected behaviours.
Names, responsibilities, and structure make the code easy to understand.
Classes, interfaces, and abstractions are used appropriately.
Important operations use suitable approaches for their expected workload.
Invalid inputs, failures, and important edge cases are addressed.
Likely future changes can be supported without unnecessary rewrites.
Memory, processing, and database access are considered where relevant.
Unspecified requirements are handled through explicit, reasonable assumptions.
Your preparation
LLD interview readiness checklist.
Mark each skill as you practise it. Your progress is saved locally in this browser when browser storage is available.
Your progress
0 of 13 completedProgress is stored on this device and browser only; it is not synced to your DevDevo account. Clearing browser data or using private browsing may remove it.
Keep learning
Turn your design knowledge into practice.
Strengthen your object-oriented foundations, explore reusable design solutions, and apply this approach to practical Low Level Design problems.