How to Crack Low-Level Design (LLD) & Machine Coding Interviews: SOLID Principles, Concurrency & Top 8 Design Problems
Why 70% of candidates who pass LeetCode DSA get eliminated in the 90-minute Machine Coding round at Flipkart, Uber, Swiggy, PhonePe & Tier-1 GCCs—and the exact framework to pass.

- At 1–6 YOE, High-Level System Design (HLD) tests whether you can draw distributed boxes, but **Low-Level Design (LLD) / Machine Coding** tests whether you can write clean, extensible, thread-safe, object-oriented code in 60–90 minutes.
- Interviewers fail candidates who dump 400 lines of `if-else` logic into a single `Main.java` class; they reward clean **Domain Entities**, **Strategy/Factory Design Patterns**, **In-Memory Repositories (`ConcurrentHashMap`)**, and **fine-grained Concurrency (`ReentrantLock` / `synchronized`)**.
- Mastering just **8 canonical LLD problems** covers 90% of all machine-coding rounds in India and US product companies.
1. What Interviewers Actually Grade in a 60–90 Minute LLD Round
In a LeetCode DSA round, nobody cares if you name your variables `dp[i][j]` and put everything inside one static method. If you do that in a Low-Level Design or Machine Coding round, it is an automatic reject—even if your output matches the sample test case.
Your interviewer has a rubric with four checkboxes: (1) **Schema & Entity Modeling** (clean separation of `Entities`, `Enums`, `Repositories`, and `Services`), (2) **Extensibility (Open/Closed Principle)** (when the interviewer changes a requirement in the last 15 minutes, can you add a new class without rewriting existing code?), (3) **Thread Safety & Race Conditions** (can two users book the same seat or parking spot simultaneously?), and (4) **Working Demo Driver** (clean CLI/JUnit execution with custom exceptions).
2. The Top 8 LLD & Machine Coding Problems (And Their Core Patterns)
Instead of memorizing 50 random UML diagrams, practice these 8 canonical problems and the exact GoF Design Patterns + Concurrency primitives each one tests:
| LLD Problem | Core Entities | Design Pattern Tested | Concurrency / Edge Case Trap |
|---|---|---|---|
| 1. Parking Lot / Movie Ticket Booking (BookMyShow) | `Spot`/`Seat`, `Ticket`, `Floor`, `Booking` | **Strategy Pattern** (`PricingStrategy`, `SpotAllocationStrategy`) + **Factory** | Double-booking race condition → Use per-seat/per-spot `ReentrantLock` or optimistic versioning with TTL hold |
| 2. Splitwise / Expense Sharing App | `User`, `Group`, `Expense`, `Split` (`Equal`, `Exact`, `Percent`), `BalanceSheet` | **Strategy / Polymorphism** for `SplitValidator` + Graph Debt Simplification | Floating-point rounding drift (`₹100 / 3`) → Use `BigDecimal` and assign remainder to first participant |
| 3. Rate Limiter Library | `RateLimiter`, `AllowanceBucket`, `ClientConfig` | **Strategy Pattern** (`TokenBucketStrategy`, `SlidingWindowLogStrategy`) | Thread-safe token refill under high concurrency → `ConcurrentHashMap.compute()` + atomic timestamps |
| 4. Elevator / Ride-Sharing Dispatch (Uber) | `Elevator`/`Driver`, `Request`, `DispatchController` | **State Pattern** (`IDLE`, `MOVING_UP`, `MAINTENANCE`) + **Strategy** (`DispatchAlgorithm`) | Starvation of distant floors/riders and thread-safe state transitions |
| 5. In-Memory Cache (LRU / LFU with TTL) | `Cache<K,V>`, `DoublyLinkedList`, `Node`, `EvictionPolicy` | **Strategy Pattern** (`EvictionPolicy`) + Decorator | `ReadWriteLock` (`ReentrantReadWriteLock`) and lazy vs active TTL expiration |
| 6. Notification / Pub-Sub Event Bus | `Topic`, `Message`, `Subscriber`, `Channel` (`Email`, `SMS`, `Push`) | **Observer Pattern** + **Chain of Responsibility** (filtering/retries) | Slow subscriber blocking publisher → Async worker pool per subscriber offset |
| 7. Vending Machine / ATM | `Machine`, `Inventory`, `CashDispenser`, `MachineState` | **State Pattern** (`IdleState`, `HasMoneyState`, `DispensingState`) + **Chain of Responsibility** (₹500→₹200→₹100 notes) | Partial cash shortage rollback when exact change cannot be dispensed |
| 8. Snake & Ladder / Chess Game Engine | `Board`, `Cell`, `Piece`/`Jump`, `Player`, `MoveValidator` | **Command Pattern** (undo/redo moves) + **Factory** | Decoupling board rules from game loop so N-player or custom board sizes require zero loop edits |
3. The 60-Minute LLD Interview Clock: How to Pace Yourself
Follow this strict time-box in every LLD interview so you never run out of time with half-written interfaces:
Minutes 00–08: Clarify Functional Scope & Concurrency (Lock down 4–5 core APIs; skip auth/UI) Minutes 08–18: Define Core Entities, Enums & Repository Interfaces (Bottom-Up data model) Minutes 18–35: Implement Strategy/State Interfaces + Core Service Business Logic Minutes 35–48: Add Concurrency Guards (`ConcurrentHashMap` / `ReentrantLock`) & Custom Exceptions Minutes 48–60: Run Main Driver / Unit Test + Handle Interviewer's Extension Requirement via Strategy Pattern
4. Reference Implementation: Thread-Safe Seat / Spot Booking with Fine-Grained Locking & Strategy Pricing
The most common concurrency mistake candidates make in Parking Lot or BookMyShow Machine Coding rounds is putting `synchronized` on the entire `BookingService.bookSeat()` method. That serializes bookings across the entire cinema or multi-floor parking garage—so User A booking Seat `A1` in Mumbai blocks User B booking Seat `F12` in Bengaluru! Interviewers immediately flag global locks as a scalability bottleneck.
Instead, combine **fine-grained per-entity locking** (`ConcurrentHashMap<String, ReentrantLock>`) with the **Strategy Pattern** (`PricingStrategy`) so unrelated seats book in parallel with zero race conditions while pricing rules remain open for extension:
public interface PricingStrategy {
BigDecimal calculate(SeatType type, LocalDateTime showTime);
}
public final class SurgeWeekendPricingStrategy implements PricingStrategy {
@Override
public BigDecimal calculate(SeatType type, LocalDateTime showTime) {
BigDecimal base = (type == SeatType.RECLINER) ? BigDecimal.valueOf(450) : BigDecimal.valueOf(250);
boolean isWeekend = showTime.getDayOfWeek().getValue() >= 6;
return isWeekend ? base.multiply(new BigDecimal("1.25")) : base;
}
}
public class BookingService {
private final SeatRepository seatRepo;
private final PricingStrategy pricingStrategy; // Injected via constructor (DIP + OCP)
private final ConcurrentHashMap<String, ReentrantLock> seatLocks = new ConcurrentHashMap<>();
public BookingService(SeatRepository seatRepo, PricingStrategy pricingStrategy) {
this.seatRepo = seatRepo;
this.pricingStrategy = pricingStrategy;
}
public Ticket holdAndBookSeat(String showSeatKey, String userId, LocalDateTime showTime) {
ReentrantLock lock = seatLocks.computeIfAbsent(showSeatKey, k -> new ReentrantLock());
lock.lock();
try {
Seat seat = seatRepo.findByKey(showSeatKey)
.orElseThrow(() -> new SeatNotFoundException(showSeatKey));
if (seat.status() != SeatStatus.AVAILABLE) {
throw new SeatAlreadyBookedException("Seat unavailable: " + showSeatKey);
}
BigDecimal price = pricingStrategy.calculate(seat.type(), showTime);
seatRepo.save(seat.withStatus(SeatStatus.BOOKED, userId));
return new Ticket(UUID.randomUUID().toString(), showSeatKey, userId, price);
} finally {
lock.unlock();
}
}
}5. Five Instant Red Flags Evaluators Penalize in Machine Coding Reviews
Before submitting your zip archive or sharing your screen in the final 10-minute code walkthrough, audit your code against these five rubric killers:
- 1. Anemic Gods & `switch/if-else` Type Chains: Writing `if (splitType.equals("PERCENT")) ... else if (splitType.equals("EXACT"))` inside `ExpenseService` violates the Open/Closed Principle. Extract a `SplitStrategy` interface so adding `SHARES` split takes one new class.
- 2. Exposing Mutable Internal Collections: Returning `List<Spot>` directly from `ParkingFloor.getSpots()` allows callers to mutate state bypassing invariants. Always return `List.copyOf(spots)` or `Collections.unmodifiableList(...)`.
- 3. Using `double` or `float` for Money: In Splitwise, ATM, or E-Commerce LLD problems, `0.1 + 0.2 != 0.3` in IEEE-754 floating point. Always use `BigDecimal` with explicit `RoundingMode.HALF_UP` or integer paise/cents.
- 4. Swallowing Exceptions with `System.out.println`: Throw descriptive unchecked domain exceptions (`InsufficientBalanceException`, `InvalidMoveException`) and catch them cleanly only in the top-level CLI/Controller driver.
- 5. Over-Engineering Abstract Factories Before Writing Working Logic: Never create 22 empty interfaces with zero working end-to-end flow. A clean, working 8-class solution with 1 well-chosen Strategy/State pattern beats an unfinished 25-class hierarchy every time.
Frequently Asked Questions
Should I use a real database like MySQL in a 90-minute Machine Coding round?
No! Unless explicitly instructed otherwise, always use clean in-memory repositories backed by `ConcurrentHashMap<String, Entity>` behind a `Repository` interface (`OrderRepository`). Setting up JDBC/Hibernate wastes 25 minutes of coding time, whereas coding to an interface proves you can swap in Postgres later in 5 minutes.
Can I practice a live LLD or Machine Coding round with an Uncorp mentor?
Yes—when you book a 1-on-1 Technical Mock Interview (`/schedule` or `/programs/technical-mock-interviews`), you can select Low-Level Design (LLD) / High-Level System Design as your target round and receive a detailed rubric critique on your class design, SOLID adherence, and concurrency handling.
Naitik Tailor & Uncorp Engineering Faculty
Founder & Principal Engineering Mentors (12+ Yrs Enterprise Experience) · VIT CSE '21 · Symbiosis MBA '24 · Ex-Delhivery & Ex-Aditya Birla Capital
Continue Reading in This Topic Cluster
All 73 Guides
DSA vs System Design: What Matters More in Technical Interviews at 0–2, 3–5 & 6+ YOE?
Stop over-indexing on the wrong round: here is the exact weightage of Data Structures & Algorithms vs Low-Level & High-Level System Design across experience bands.

The 2026 System Design Interview Blueprint: Designing Both Distributed Microservices & Enterprise Gen AI Systems
How to structure a 45-minute High-Level Design (HLD) interview when hiring panels test both classic distributed systems (Kafka, Redis, Sharding) and modern LLM/RAG architectures.

How to Crack Product MNC & GCC Coding Rounds Without Grinding 500 LeetCode Questions: The 12 Core DSA Patterns
Why working professionals fail when they memorize random problems—and how mastering 12 reusable algorithmic templates covers 90% of Tier-1 coding interviews.

