Skip to content
Low Level Design Mastery Logo
LowLevelDesign Mastery

Steps in LLD Interview

Master the systematic approach to ace any LLD interview problem!

When faced with an LLD interview problem, it’s crucial to follow a systematic approach. Jumping straight to code is a common mistake that leads to poor designs. Instead, follow these proven steps to create clean, maintainable solutions.

Diagram

Before you start designing, make sure you understand the problem!

Jumping to solutions without understanding requirements leads to:

  • ❌ Missing important features
  • ❌ Over-engineering
  • ❌ Wrong assumptions
  • ❌ Wasted time

Functional Requirements:

  • What are the core features?
  • What are the use cases?
  • What are the constraints?

Non-Functional Requirements:

  • Scale requirements?
  • Performance expectations?
  • Availability needs?

Edge Cases:

  • What happens in error scenarios?
  • What are the boundary conditions?

Interviewer: “Design a Parking Lot System

Good Questions to Ask:

  1. “What types of vehicles are supported?” (Car, Motorcycle, Truck)
  2. “How many spots are there?” (Fixed number or configurable?)
  3. “Do we need to track parking duration?” (For billing)
  4. “What happens when the lot is full?” (Reject or waitlist?)
  5. “Do we need different pricing for different vehicle types?”
  6. “Do we need to support multiple parking lots?”

Bad Approach:

  • “I’ll assume cars only and 100 spots”
  • “Let me start coding right away”
Diagram

Actors are the users or external systems that interact with your system.

Actors represent:

  • Users - People who use the system
  • External Systems - Other systems that interact with yours
  • Administrators - People who manage the system

Ask yourself:

  • Who will use this system?
  • What are their roles?
  • What actions can they perform?

Actors:

  1. Driver - Parks and retrieves vehicles
  2. Admin - Manages parking lot (add spots, view reports)
  3. System - Automated processes (billing, notifications)
Diagram
SystemActors
Library ManagementLibrarian, Member, System
RestaurantCustomer, Waiter, Chef, Manager
ATMCustomer, Bank, System
ElevatorPassenger, Maintenance, System

Entities are the core objects/concepts in your system that have data and behavior.

Entities represent:

  • Core Objects - Main concepts in your system
  • Data Holders - Objects that store information
  • Business Objects - Objects that represent business concepts

Look for:

  • Nouns in the problem statement
  • Things that have properties
  • Objects that need to be tracked
  • Concepts that have state

Entities:

  1. ParkingLot - The parking lot itself
  2. ParkingSpot - Individual parking spaces
  3. Vehicle - Cars, motorcycles, trucks
  4. Ticket - Parking ticket issued to driver
  5. Payment - Payment transaction
Diagram

Key Difference:

  • Actor = External user/system that interacts with your system
  • Entity = Internal object/concept within your system

Example:

  • Driver (Actor) uses ParkingLot (Entity)
  • Admin (Actor) manages ParkingSpot (Entity)

Each class should have a single, well-defined responsibility (Single Responsibility Principle).

Proper responsibility assignment leads to:

  • Maintainable code - Easy to understand and modify
  • Testable code - Easy to write unit tests
  • Reusable code - Classes can be reused
  • SOLID principles - Follows best practices

For each entity, ask:

  • What does this entity do?
  • What data does it hold?
  • What operations does it perform?

ParkingLot Responsibilities:

  • Manage parking spots
  • Assign spots to vehicles
  • Find available spots
  • Release spots when vehicles leave

ParkingSpot Responsibilities:

  • Track its own state (occupied/available)
  • Know its type (car/motorcycle/truck)
  • Know its location/ID

Ticket Responsibilities:

  • Store entry time
  • Store vehicle information
  • Calculate parking duration

Payment Responsibilities:

  • Process payment
  • Calculate amount based on duration
  • Store payment details
Diagram

For each class, ensure:

  • Single Responsibility - One reason to change
  • Cohesive - Methods are related
  • Focused - Not doing too much
  • Clear Purpose - Easy to understand what it does

Class diagrams show the structure of your system - classes, their attributes, methods, and relationships.

Class diagrams help you:

  • Visualize structure - See how classes relate
  • Identify relationships - Inheritance, composition, association
  • Plan implementation - Know what to code
  • Communicate design - Share your design with interviewer
  1. Classes - With attributes and methods
  2. Relationships - Inheritance, composition, association
  3. Interfaces - Abstract contracts
  4. Access Modifiers - Public, private, protected
Diagram Diagram

Contracts define how classes interact - method signatures, interfaces, and API contracts.

Well-defined contracts:

  • Enable testing - Clear interfaces to mock
  • Enable flexibility - Can swap implementations
  • Document behavior - Clear what methods do
  • Prevent errors - Compile-time checks
  1. Method Signatures - Parameters, return types, exceptions
  2. Interfaces - Abstract contracts for classes
  3. API Contracts - If designing APIs, define endpoints
  4. Preconditions/Postconditions - What’s expected

ParkingLot Interface:

Payment Interface:

Diagram

Edge cases are scenarios that might not be obvious but are important to handle.

Handling edge cases shows:

  • Mature thinking - You consider all scenarios
  • Production readiness - Real systems have edge cases
  • Attention to detail - You think thoroughly
  • Error handling - You plan for failures
  1. Null/Empty Inputs - What if input is null or empty?
  2. Boundary Conditions - What if at limits?
  3. Concurrent Access - What if multiple users?
  4. Error Scenarios - What if something fails?
  5. Invalid States - What if system is in wrong state?

Edge Cases to Handle:

  1. Parking lot is full

    • Return appropriate exception
    • Don’t crash
  2. Invalid vehicle type

    • Validate vehicle type
    • Return clear error message
  3. Invalid ticket

    • Validate ticket exists
    • Check ticket hasn’t been used
  4. Concurrent parking

    • Handle race conditions
    • Use locks/synchronization
  5. Payment failure

    • Handle payment errors
    • Don’t release spot if payment fails
Diagram

Finally, implement your design in code (or pseudo-code).

  1. Follow your design - Implement what you designed
  2. Clean code - Readable, maintainable
  3. SOLID principles - Apply what you learned
  4. Design patterns - Use appropriate patterns
  5. Error handling - Handle edge cases

Diagram

Use this checklist for every LLD interview:

  • Step 1: Clarify requirements - Ask questions
  • Step 2: Identify actors - Who uses the system?
  • Step 3: Identify entities - What are the core objects?
  • Step 4: Assign responsibilities - What does each class do?
  • Step 5: Design class diagrams - Show relationships
  • Step 6: Define contracts & APIs - Method signatures
  • Step 7: Handle edge cases - Error scenarios
  • Step 8: Code implementation - Write clean code

Now that you understand the high-level process, let’s dive deep into each step:

Next: Identifying Actors & Entities →

This next guide will teach you how to systematically identify actors and entities with detailed examples and visual diagrams!


Follow a systematic approach - Don’t jump to code
Clarify requirements first - Ask questions
Identify actors - Who uses the system?
Identify entities - What are the core objects?
Assign responsibilities - Single Responsibility Principle
Design class diagrams - Visualize structure
Define contracts - Clear interfaces
Handle edge cases - Think about errors
Implement cleanly - Follow your design

LLD interviews are about demonstrating:

  • Systematic thinking
  • Clean design skills
  • Communication ability
  • Production-ready mindset

Master these steps, and you’ll excel in any LLD interview! 🚀

💡 Time to Practice!

Now that you understand the concepts, put them into practice with our interactive playground. Build UML diagrams, write code, and get AI-powered feedback.

Browse All Problems