Vikram had 4 years of experience at a mid-sized Indian startup. He'd solved 300 LeetCode problems. His system design answers were solid. He got rejected at Razorpay. Twice.

Both rejections came from the same round: the machine coding / LLD round. Vikram could describe how to build a parking lot system verbally. But when asked to write the actual class structure — with proper interfaces, design patterns, and extensible code — he produced a 300-line God class with everything jammed in, no abstractions, and zero SOLID compliance.

The third time, he spent 3 weeks on LLD specifically. He got the offer. This guide is what he learned.

70%+
of Indian unicorn interviews (3+ YoE) have a dedicated LLD/machine coding round
45–90
minutes — typical machine coding round duration
5
SOLID principles that underpin every strong LLD answer
10
classic LLD problems that cover 90% of what gets asked

1. LLD vs HLD — What's the Difference and When Is Each Tested

DimensionLow Level Design (LLD)High Level Design (HLD)
FocusClass structure, OOP, design patternsDistributed systems, scalability, architecture
OutputClass diagrams, working code, interfacesArchitecture diagrams, component interactions
Duration45–90 minutes (machine coding)45–60 minutes (whiteboard/discussion)
Tested at2–7 YoE, Indian unicorns (Razorpay, Swiggy, CRED, Meesho)4+ YoE, FAANG, senior/staff roles
Key skillsSOLID, design patterns, OOP, code qualityCAP theorem, databases, caching, queues, CDN
Example question"Design a Parking Lot system with working code""Design Twitter's feed generation system"
Common misconception: Many Indian engineers prepare only for HLD (system design) and ignore LLD. But at Flipkart, Razorpay, PhonePe, Swiggy, CRED, and most Indian unicorns, LLD is a dedicated round that's often the tiebreaker between candidates. Engineers with 3–6 years of experience are evaluated primarily on LLD quality.

2. SOLID Principles — The Foundation of Every LLD Answer

SOLID is not just theory. In an LLD interview, interviewers actively look for whether your class design follows these principles — and will ask you to refactor if it doesn't.

S
Single Responsibility Principle (SRP)

A class should have only one reason to change. Each class does exactly one thing.

Interview application: Don't put billing logic, notification logic, AND booking logic in a single BookingService. Split into BookingService, BillingService, NotificationService.

O
Open/Closed Principle (OCP)

Classes should be open for extension, closed for modification. Add new behaviour without changing existing code.

Interview application: A payment system should accept new payment methods (UPI, card, wallet) via new classes implementing a PaymentStrategy interface — not by adding if/else blocks to existing code.

L
Liskov Substitution Principle (LSP)

Subtypes must be substitutable for their base types without breaking the program.

Interview application: If Vehicle has a refuel() method, and ElectricVehicle extends Vehicle, then ElectricVehicle shouldn't inherit refuel(). Use interfaces (Refuelable, Rechargeable) instead of a rigid inheritance hierarchy.

I
Interface Segregation Principle (ISP)

Clients shouldn't be forced to depend on interfaces they don't use. Prefer many small interfaces over one large one.

Interview application: Instead of one Animal interface with fly(), swim(), run() — split into Flyable, Swimmable, Runnable. A Dog implements Swimmable and Runnable but not Flyable.

D
Dependency Inversion Principle (DIP)

High-level modules shouldn't depend on low-level modules. Both should depend on abstractions (interfaces).

Interview application: OrderService shouldn't directly instantiate MySQLDatabase. It should depend on a Database interface — allowing you to swap MySQL for PostgreSQL or a mock in tests without changing OrderService.

How to use SOLID in an interview: Don't recite definitions — demonstrate them. After presenting your class design, proactively say "I'm using Strategy pattern here to keep OCP — if we add a new payment method tomorrow, we create a new class without touching PaymentProcessor." That signal alone puts you in the top 20% of candidates.

3. Eight Design Patterns Every Indian SWE Must Know for LLD

You don't need to know all 23 GoF patterns. You need to know these 8 deeply — when to use them, when NOT to use them, and how to implement them quickly.

1. Strategy Pattern

Use when: You have multiple interchangeable algorithms or behaviors

Classic examples: Payment methods (UPI, card, wallet, net banking), sorting strategies, discount calculation, delivery routing. Define a PaymentStrategy interface with a pay(amount) method. Each payment type is a class implementing it. The context (cart) holds a reference to the strategy and calls it — without knowing which one.

2. Observer Pattern

Use when: One object's state change needs to notify multiple other objects

Classic examples: Order status notifications (SMS, email, push), stock price alerts, UI event handling. Subject maintains a list of Observers. When state changes, calls notifyAll(). Each observer implements update(). New notification channels (WhatsApp) = new observer class, zero changes to the Subject.

3. Factory / Factory Method Pattern

Use when: Object creation logic is complex or type depends on runtime input

Classic examples: Vehicle creation (car, bike, truck), notification creation (email, SMS, push), payment gateway selection. A VehicleFactory.create(type) returns the right Vehicle subclass. The caller never uses new directly — this centralises creation logic and makes adding new types easy.

4. Singleton Pattern

Use when: Exactly one instance must exist (global state, shared resources)

Classic examples: Database connection pool, configuration manager, logging service, cache manager. Private constructor + static getInstance() method. In multi-threaded environments, use double-checked locking or enum-based Singleton. Warning: Overusing Singleton is an anti-pattern — interviewers will notice.

5. Decorator Pattern

Use when: You want to add functionality to objects without modifying their class

Classic examples: Pizza/burger toppings, feature flags on UI components, logging/auth wrappers around services. A CoffeeDecorator wraps a Coffee and overrides getCost() and getDescription() — adding functionality while delegating the base behaviour. Avoids the subclass explosion of inheritance.

6. Builder Pattern

Use when: An object has many optional parameters or complex construction steps

Classic examples: HTTP request building, SQL query construction, complex form objects, Pizza with optional toppings/size/crust. Builder separates construction from representation. Eliminates telescoping constructors. Enables readable new Pizza.Builder().size(LARGE).crust(THIN).addTopping(CHEESE).build().

7. Command Pattern

Use when: You need to queue, undo, or log operations as objects

Classic examples: Text editor undo/redo, task queue, transaction rollback, smart home commands. Each action is encapsulated as a Command object with execute() and undo(). A queue stores commands for deferred execution or replay. The invoker doesn't know the specifics of each command.

8. Template Method Pattern

Use when: Multiple classes share an algorithm skeleton but differ in specific steps

Classic examples: Data parsing (CSV vs JSON vs XML), game turn flow (setup → play → end), report generation. Abstract base class defines the skeleton (final method). Subclasses override only the specific steps. Avoids code duplication while allowing customisation of individual steps.

4. The 45-Minute Machine Coding Framework

Most engineers dive straight into code. That's the mistake. Here's the exact time allocation that separates passing candidates from failing ones:

1
Minutes 0–5: Clarify requirements Ask what the system needs to do. What are the core entities? What operations must be supported? What edge cases matter? What can we explicitly de-scope? Don't start designing until you've confirmed the scope. Interviewers give you this time — use it.
2
Minutes 5–15: Identify entities and relationships List the core nouns (they become classes). Identify relationships — association, composition, inheritance. Sketch a rough class diagram on paper or whiteboard before writing any code. Narrate your thinking: "I see 4 core entities here: ParkingLot, Floor, Spot, and Vehicle."
3
Minutes 15–20: Identify applicable design patterns Which patterns apply? Say them out loud: "I'll use Strategy for vehicle type pricing, and Observer to notify when a spot becomes available." This signals pattern knowledge even before you code them.
4
Minutes 20–40: Write the core code Start with interfaces and abstract classes. Then concrete implementations. Focus on the critical path (the most important 2–3 classes). Write clean, compiling code — not pseudocode. Leave TODOs for nice-to-haves if time runs short.
5
Minutes 40–45: Review and discuss extensions Point out SOLID compliance. Call out what you'd add with more time. Discuss one extension: "If we needed to support monthly subscriptions, I'd add a SubscriptionStrategy that extends PricingStrategy." This shows design thinking beyond the immediate problem.
The single most important LLD interview habit: Talk while you design. Interviewers can't read your mind. Every decision you make — why you used an interface instead of an abstract class, why you chose Strategy over if/else, why a class has a certain responsibility — narrate it. Silence is a red flag. Narration is a green flag.

5. Ten Classic LLD Problems with Full Solutions

These 10 problems account for the vast majority of LLD interview questions at Indian companies. Master these and you'll handle any variation thrown at you.

1. Parking Lot System
Medium Asked at: Razorpay, Swiggy, PhonePe, Paytm, Uber

Core entities: ParkingLot, ParkingFloor, ParkingSpot (compact/large/motorcycle), Vehicle (Car/Truck/Motorcycle), Ticket, PricingStrategy, EntryPanel, ExitPanel.

Key design decisions:

  • Use Strategy pattern for pricing (hourly, flat, weekend pricing)
  • Use Factory pattern to create Vehicle objects from type string
  • ParkingSpot has a VehicleType enum — spots are compatible only with certain vehicle types
  • ParkingLot is a Singleton — only one instance exists
  • Use Observer to update availability display when spots change
// Core interface structure interface PricingStrategy { double calculatePrice(Ticket ticket); } class HourlyPricing implements PricingStrategy { public double calculatePrice(Ticket ticket) { long hours = ChronoUnit.HOURS.between(ticket.entryTime, LocalDateTime.now()); return hours * ticket.spot.getHourlyRate(); } } enum VehicleType { CAR, MOTORCYCLE, TRUCK } enum SpotType { COMPACT, LARGE, MOTORCYCLE } abstract class Vehicle { protected String licensePlate; abstract VehicleType getType(); } class ParkingSpot { private SpotType type; private boolean occupied; private Vehicle currentVehicle; public boolean canFit(Vehicle v) { /* type compatibility check */ } public void park(Vehicle v) { currentVehicle = v; occupied = true; } public void vacate() { currentVehicle = null; occupied = false; } }
2. Food Delivery App (Swiggy / Zomato Clone)
Hard Asked at: Swiggy, Zomato, Flipkart, Meesho

Core entities: Customer, Restaurant, MenuItem, Cart, Order, DeliveryAgent, OrderStatus, Payment, Notification, Location.

Key design decisions:

  • State pattern for Order lifecycle: PLACED → CONFIRMED → PREPARING → PICKED_UP → DELIVERED → CANCELLED
  • Observer pattern for notifications when order state changes (SMS, push, email)
  • Strategy pattern for delivery agent assignment (nearest, load-balanced, rated)
  • Strategy pattern for payment methods
  • Cart uses Composite pattern — CartItem wraps MenuItem with quantity
interface OrderState { void nextState(Order order); void cancel(Order order); String getStatus(); } class PlacedState implements OrderState { public void nextState(Order order) { order.setState(new ConfirmedState()); order.notifyObservers(); // triggers SMS/push } public void cancel(Order order) { order.setState(new CancelledState()); } public String getStatus() { return "PLACED"; } }
3. Ride-Hailing App (Ola / Uber Clone)
Hard Asked at: Ola, Uber, Swiggy, Amazon

Core entities: Rider, Driver, Trip, Location, Vehicle, FareCalculator, MatchingStrategy, TripStatus, Payment, Rating.

Key design decisions:

  • Strategy pattern for driver matching (nearest, surge pricing zones, vehicle type)
  • Strategy pattern for fare calculation (base fare, surge multiplier, distance-based)
  • State pattern for trip lifecycle: REQUESTED → DRIVER_ASSIGNED → IN_PROGRESS → COMPLETED
  • Observer for real-time location updates and notifications
  • Rating system as a separate bounded context — avoid polluting Driver class
4. Library Management System
Medium Asked at: Microsoft, Goldman Sachs, Walmart Labs, TCS Digital

Core entities: Library, Book, BookItem (physical copy), Member, Librarian, Catalogue, Reservation, Fine, Notification.

Key design decisions:

  • Distinguish Book (metadata: ISBN, title, author) from BookItem (physical copy with barcode and availability)
  • Fine calculation uses Strategy pattern (per-day, flat, waived for premium members)
  • Reservation uses a queue — implement with linked list or priority queue
  • Observer: when BookItem returned → notify members in reservation queue
5. ATM Machine
Medium Asked at: Razorpay, PhonePe, CRED, Goldman Sachs, Paytm

Core entities: ATM, ATMState, Card, Account, CashDispenser, Keypad, Screen, Printer, BankService.

Key design decisions:

  • State pattern is the core of this problem: IdleState → HasCardState → AuthenticatedState → SelectingTransactionState → TransactionState
  • Each state implements: insertCard(), enterPin(), selectTransaction(), dispatchCash(), ejectCard()
  • CashDispenser uses Chain of Responsibility for dispensing denominations (₹2000 → ₹500 → ₹200 → ₹100)
6. Movie Ticket Booking (BookMyShow Clone)
Hard Asked at: Flipkart, Swiggy, PhonePe, CRED

Core entities: Movie, Theatre, Screen, Show, Seat, SeatLock, Booking, Payment, User, Notification.

Key design decisions:

  • Concurrency is the key challenge: two users trying to book the same seat simultaneously. Use seat locking with a timeout (optimistic locking or distributed lock)
  • SeatLock: lock(seatId, userId, expiryTime) — held for 5 minutes during payment
  • Seat status: AVAILABLE → LOCKED → BOOKED
  • Strategy pattern for pricing (peak hours, day/night, seat tier: gold/silver/platinum)
7. Splitwise (Expense Splitter)
Medium Asked at: Razorpay, CRED, Groww, Zerodha

Core entities: User, Group, Expense, Split (EqualSplit, PercentSplit, ExactSplit), Balance, Transaction, Notification.

Key design decisions:

  • Strategy pattern for expense splitting: EqualSplit, PercentSplit, ExactSplit all implement Split interface
  • Balance tracking: maintain a Map<User, Map<User, Double>> — who owes whom how much
  • Simplify debt algorithm: reduce the number of transactions needed to settle all debts (greedy approach)
  • Observer for payment reminders and settlement notifications
8. Chess Game
Hard Asked at: Google, Microsoft, Amazon, PhonePe

Core entities: Board, Cell, Piece (King, Queen, Rook, Bishop, Knight, Pawn), Player, Move, Game, MoveValidator.

Key design decisions:

  • Each Piece subclass implements getValidMoves(Board board, Cell from) — polymorphism at its purest
  • Board is an 8×8 grid of Cells; each Cell optionally holds a Piece
  • Move validation is separate from Piece movement — use Chain of Responsibility for validators (bounds check → own piece check → path clear check → check detection)
  • Game state uses a move history stack enabling undo
9. Elevator System
Medium Asked at: Flipkart, Microsoft, Amazon, Oracle

Core entities: ElevatorSystem, Elevator, ElevatorState, Request (ExternalRequest, InternalRequest), Dispatcher, Direction, Floor.

Key design decisions:

  • State pattern: Idle → Moving (Up/Down) → DoorsOpen
  • Strategy pattern for dispatching: FCFS, SCAN (elevator algorithm), LOOK
  • SCAN algorithm: serve requests in current direction until no more, then reverse — this is the standard "elevator algorithm"
  • Each elevator maintains two queues: upRequests and downRequests (TreeSets for ordered processing)
10. Hotel Booking System
Medium Asked at: Amazon, Goibibo, MakeMyTrip, Oyo

Core entities: Hotel, Room, RoomType, Booking, Guest, Payment, RoomSearchCriteria, PricingStrategy, Amenity, Review.

Key design decisions:

  • Strategy pattern for pricing (seasonal, weekend, early bird, last-minute)
  • Room availability uses date-range intersection queries — use interval trees or sorted sets
  • Booking state: PENDING → CONFIRMED → CHECKED_IN → CHECKED_OUT → CANCELLED
  • Cancellation policy as a separate Strategy (full refund, partial refund, no refund based on timing)

6. Company-Specific LLD Expectations

CompanyLLD Round FormatWhat They Look ForTypical Problem
Razorpay 90-min machine coding, any language Clean abstractions, extensibility, production-quality code Payment system, ATM, Splitwise
Flipkart 90-min machine coding (Java preferred) SOLID compliance, design patterns, testability E-commerce cart, search filter, Parking Lot
Swiggy 60-min coding + 30-min design discussion Working code first, then discuss extensibility Food delivery, restaurant menu, delivery tracking
CRED 45-min design + coding Minimal but correct design, code quality Credit card bill reminder, reward system, Splitwise
PhonePe 60-min machine coding Payment domain understanding, concurrency awareness Payment processor, wallet system, ATM
Meesho 45-min coding Working solution, clean interfaces Catalogue management, order tracking, inventory
Groww 60-min design + code Financial domain awareness, state management Portfolio tracker, SIP calculator, transaction log

7. Seven LLD Interview Mistakes That Get Candidates Rejected

Mistake 1: Writing a God class. One class with 500 lines doing everything — parsing, business logic, DB calls, notifications. This is the most common LLD failure. If a class has more than 3–4 methods that handle different concerns, it's violating SRP. Stop and refactor.
Mistake 2: Jumping into code without clarifying requirements. Spend the first 5 minutes clarifying scope. Candidates who start coding in minute 1 almost always go in the wrong direction and waste 20 minutes refactoring.
Mistake 3: Using if/else chains instead of polymorphism. if (vehicleType == "CAR") ... else if (vehicleType == "TRUCK") ... is a red flag. This violates OCP. Use inheritance or Strategy pattern. Interviewers look for this specifically.
Mistake 4: Not knowing which language to use. Pick Java or Python and be deeply comfortable with it. Java is preferred at most Indian companies for LLD (strong typing makes the design more explicit). Know how to use interfaces, abstract classes, enums, and generics confidently.
Mistake 5: Solving the wrong problem. In a 45-minute round, many candidates spend 30 minutes on the wrong part. When you clarify requirements, confirm which operations are in scope. Don't build a full payment flow if the interviewer only cares about the core data model and spot allocation.
Mistake 6: Silent coding. Typing code for 30 minutes without saying a word is a red flag. Interviewers need to evaluate your thinking, not just your code. Narrate your decisions in real time.
Mistake 7: Over-engineering. Using every design pattern you know in a 45-minute problem is also a red flag. Applying Singleton, Factory, Strategy, Observer, Decorator, Command, AND Composite to a Parking Lot system is a sign you're applying patterns without judgment. Use what the problem needs.

8. Four-Week LLD Preparation Plan

WeekFocusTasks
Week 1 SOLID + Core Patterns Study all 5 SOLID principles with code examples. Implement Strategy, Factory, Singleton, Observer, and Decorator from scratch in your preferred language.
Week 2 First 5 Problems Solve Parking Lot, Library Management, ATM, Hotel Booking, and Elevator in 60–90 minutes each. Write actual code, not pseudocode. Review solutions for SOLID compliance.
Week 3 Next 5 Problems + Timed Practice Solve Food Delivery, Ride-Hailing, Chess, Splitwise, BookMyShow under strict 45-minute timers. This is the most important week — simulate real interview conditions.
Week 4 Mock Interviews + Review Do 3–4 mock LLD interviews with a peer or mentor. Review code quality, pattern usage, and how well you narrate. Target: finish core class structure in 20 minutes, implementation in 40.
Resources to use: The best GitHub resource for LLD is ashishps1/awesome-low-level-design — it has Java implementations for 25+ problems. Use it to compare your solutions, not to memorise. The difference between reading a solution and coding it yourself from scratch is the difference between understanding and preparation.

9. FAQ: LLD Interviews in India

Do freshers face LLD interviews?

Generally, no. LLD rounds are more common for engineers with 2+ years of experience. Freshers are typically tested on DSA and basic OOP concepts. However, if you're applying to product companies directly from college, basic OOP design (class relationships, inheritance vs composition) can come up in coding interviews.

Should I use Java or Python for machine coding rounds?

Java is preferred at most Indian product companies for LLD because the type system makes design decisions explicit (interfaces, abstract classes, enums). Python is accepted at most companies but can look loose — you'll need to use type hints and ABCs to signal design intent. Use whichever language you're fastest in, but be deeply comfortable with OOP constructs in that language.

How much time should I spend drawing a class diagram vs. coding?

In a 45-minute round: 5 minutes clarifying, 10 minutes designing (on paper or whiteboard), 25 minutes coding, 5 minutes reviewing. Many candidates spend too long designing and run out of coding time. The interviewer needs to see working code, not just a perfect diagram.

What if I don't finish the implementation in time?

It's normal not to finish everything. What matters is: the core structure is correct, the most important classes are implemented, and you can articulate what you'd build next and why. Say "I'd implement the payment flow next — it would use the same PaymentStrategy interface I defined here, with UPI and card as concrete implementations." That answer scores better than rushing to finish with messy code.

Is LLD tested differently at Google compared to Indian companies?

Google doesn't have a formal LLD round as a standalone. Instead, clean OOP design is evaluated in coding rounds through code quality expectations. Google expects readable, well-structured code — they'll notice if you write monolithic functions. Indian companies have explicit, standalone LLD/machine coding rounds which are a different format.

Pranjal Jain - Founder Prepflix
Pranjal Jain
Ex-Microsoft Software Engineer · IIT Kanpur · Founder, Prepflix

Pranjal spent 6+ years at Microsoft India and has coached 1,572+ engineers through FAANG and top Indian product company interviews. He founded Prepflix to give engineers from service company backgrounds the same structured preparation advantage that IIT graduates typically get from their networks.