How to Write a Good Low-Level Design (LLD) Document

LLD stands for low-level design. An LLD document describes how one module will be built: its classes with their fields and methods, its data structures, its database tables, and the sequence of calls for each operation. It is written after the high-level design (HLD), which fixes the major parts of the system and how they communicate, and before any code. The test of a good LLD is simple: a programmer who did not attend the design meetings can implement the module from the document without asking a question. For one service, that usually means 5 to 15 pages with one class diagram, one table per entity, and one sequence diagram per main flow.

HLD vs LLD

AspectHigh-level design (HLD)Low-level design (LLD)
ScopeWhole systemOne module or service
UnitServices, databases, queuesClasses, methods, tables, functions
Main diagramsArchitecture diagram, data flowClass diagram, sequence diagram, ER diagram
DecisionsWhich database, sync or async, where to cacheWhich data structure, which pattern, which index
Written byArchitect, staff engineerSenior engineer who will build it
ReaderWhole team and stakeholdersThe programmers of that module

The HLD says "orders are stored in PostgreSQL and payments are processed by a separate service". The LLD says which tables hold orders, which class validates them, what the payment client interface looks like, and what happens when the payment service times out after 3 seconds.

The LLD document template

A low-level design document should contain the sections below, in this order. Skip a section only when you state why it does not apply.

  1. Title and metadata. Module name, author, reviewers, version, and status (draft, in review, approved).
  2. Purpose and scope. Which HLD requirements this module satisfies, and what is out of scope.
  3. Assumptions and constraints. Language, framework, limits such as 1,000 requests per second, and dependencies on other modules.
  4. Module overview. One diagram of this module and its neighbors, with the interfaces between them named.
  5. Class design. A class diagram, then one subsection per class: its single responsibility, fields, public methods with signatures, and relationships (inheritance, composition, association).
  6. Data design. Tables with columns, types, primary and foreign keys, indexes, and constraints. For in-memory structures, the structure and the time complexity of each operation.
  7. Interfaces and APIs. Each endpoint or public method: input, output, validation rules, and error codes.
  8. Sequence diagrams. One per main use case, showing the calls between classes in order.
  9. Error handling and edge cases. What each failure returns, what is retried, and what is logged.
  10. Concurrency and performance. Shared state, locks or versioning, expected latency, and the limiting resource.
  11. Security, logging, and configuration. Authorization checks, what is logged, and which values are configurable.
  12. Test plan and open questions. Unit and integration tests planned, plus decisions still waiting for an answer.

A short example: a parking lot ticketing module

The HLD requirement is "issue a ticket when a vehicle enters, assign a spot that fits, and charge on exit". The LLD for that module names four classes and one table.

class ParkingLot { Ticket enter(Vehicle v); // throws LotFullException Receipt exit(String ticketId); // throws TicketNotFoundException } class SpotAllocator { Optional<Spot> findSpot(VehicleSize size); // O(1) per size, one free-list per size void release(Spot s); } class Ticket { String id; String plate; String spotId; long entryEpochMs; } interface PricingStrategy { // Strategy pattern: hourly, flat, or event pricing long priceInCents(long entryEpochMs, long exitEpochMs); }
CREATE TABLE tickets ( id CHAR(12) PRIMARY KEY, plate VARCHAR(16) NOT NULL, spot_id VARCHAR(8) NOT NULL, entry_ms BIGINT NOT NULL, exit_ms BIGINT, amount_cents INT, CONSTRAINT one_open_ticket_per_spot UNIQUE (spot_id, exit_ms) );

The sequence for entry is: the gate calls ParkingLot.enter, which asks SpotAllocator.findSpot for the smallest free spot that fits, inserts a ticket row, and returns the ticket. The edge cases section states that a full lot returns an error within 50 milliseconds and that two gates requesting the last spot at the same time are serialized by a lock on the free-list. The pricing strategy is an interface so that a new pricing rule is a new class rather than a change to exit.

What separates a good LLD from a weak one

Every requirement is traceable. Each HLD requirement appears in the scope section and is met by a named class or table.

Every class has one responsibility. A class named Manager or Helper that does five things is a sign that the design has not been finished.

Every public method has a contract. Inputs, outputs, errors, and, for anything that iterates, the time complexity. "Handles the request appropriately" is not a contract.

Design patterns are named with a reason. "Strategy, so that pricing rules change without touching the exit flow" is useful. A list of patterns without reasons is not.

Diagrams and text agree. A class in the diagram that is absent from the text, or the reverse, is the most common defect found in review.

LLD in an interview

An LLD or object-oriented design interview compresses the document into 45 to 60 minutes of conversation. The order is the same: clarify the requirements for 5 minutes, list the entities, draw the class diagram with relationships, walk through the two main flows, and then extend the design when the interviewer adds a requirement. Parking lot, library management, elevator system, and a movie ticket booking system are the questions asked most often, and each one fits the template above.

How to Prepare

TAGS
System Design Interview
CONTRIBUTOR
Arslan Ahmad
Arslan Ahmad
ex-FAANG engineering manager and author or Grokking series.

GET YOUR FREE

Coding Questions Catalog

Design Gurus Newsletter - Latest from our Blog
Boost your coding skills with our essential coding questions catalog.
Take a step towards a better tech career now!
Explore Answers
What to Expect in the Groq System Design Interview
Groq design conversations run on inference-at-speed: serving infrastructure over deterministic accelerators, latency-first scheduling, and capacity economics. Themes and preparation.
What software is used in DevOps?
What Is the LangChain Interview Process Like? (Round by Round)
Candidates report a screen call, a take-home project in LangChain's real codebase, an extension task, and a 60 minute system design round over about a month.
What is the hardest question in an interview?
Why should I work at Dell?
What to Expect in the Airtable System Design Interview
Airtable's design rounds favor collaborative editing, spreadsheet-database systems, and large table performance, with a worked walkthrough.
Related Courses
New
Grokking the AI System Design Interview course cover
Grokking the AI System Design Interview
Learn to design AI systems the way interviewers expect: classic ML products, LLM and RAG architectures, and agentic systems, all through the lens of the system design interview.
4.6
(3,192 learners)
Discounted price for Your Region

$99

Grokking the Coding Interview: Patterns for Coding Questions course cover
Grokking the Coding Interview: Patterns for Coding Questions
The 24 essential patterns behind every coding interview question. Available in Java, Python, JavaScript, C++, C#, and Go. The most comprehensive coding interview course with 543 lessons. A smarter alternative to grinding LeetCode.
4.6
Discounted price for Your Region

$197

Grokking Modern AI Fundamentals course cover
Grokking Modern AI Fundamentals
Master the fundamentals of AI today to lead the tech revolution of tomorrow.
4.1
Discounted price for Your Region

$72

Design Gurus logo
One-Stop Portal For Tech Interviews.
About Us
Our Team
Careers
Partners
Contact Us
Become Affiliate
Copyright © 2026 Design Gurus, LLC. All rights reserved.