What Goes in a Low-Level Design Document (LLD Template)
A low-level design (LLD) document takes one part of a high-level design and describes it in enough detail that an engineer can write the code. That detail is its classes, its interfaces, its data model, its API contracts, and the sequence of calls for each main flow. The high-level design says that a rate limiter sits in front of the API. The LLD says which classes make up the rate limiter, what each method is named, which table stores the counters, and what the service returns when the limit is exceeded. The template below has eleven sections, and a document that fills all of them in is complete.
If your question was how the low-level document differs from the high-level one, that comparison is answered in LLD vs. HLD.
The eleven sections of an LLD document
- Scope and assumptions. Name the one part being designed, the requirements it must meet, and anything you assumed because the high-level design left it open. Two or three numbered assumptions are normal.
- Component responsibilities. State in one paragraph what this part owns and what it delegates to others. A reader should be able to tell whether a given bug belongs here.
- Class diagram. Draw the classes, their fields, and the relationships between them, where a relationship is inheritance, composition (one object owns another), or association (one object refers to another).
- Interfaces and method signatures. List each public method with its parameter types, its return type, and the exceptions it can throw. This is the contract other engineers code against.
- Data model. Give each table or collection with its columns, primary key, and indexes, and state which query each index exists to serve.
- API contracts. For each endpoint, show the request body, the response body, and every error code with the condition that produces it.
- Sequence diagrams for the main flows. For each of the two or three most important operations, show the order of calls between classes and services from request to response.
- Error handling and retries. State which failures are retried, how many times, with what delay, and which are returned to the caller at once.
- Concurrency and locking. Name every piece of state that two threads or two servers can write at the same time, and say how the race is prevented: a lock, an atomic operation, or a version check.
- Logging and metrics. List the log lines and counters this part emits, so the on-call engineer can tell whether it is healthy.
- Open questions. Record what is undecided and who decides it, so the reviewer does not report it as a defect.
A worked example: rate limiter service
Scope: limit each API key to 100 requests per minute across all servers, and assume keys are already authenticated. Responsibility: answer allow or deny for one request in under 2 ms, and never block the request on a slow store. Classes: RateLimiter, TokenBucket, BucketStore, and one LimitPolicy per key. Signatures: boolean allow(String apiKey) and void configure(String apiKey, LimitPolicy policy). Data model: one hash per key in Redis, an in-memory key-value store, holding the token count and the last refill time, with a 120-second expiry. API contract: the service returns 429 with a Retry-After header when a bucket is empty. Sequence: the gateway calls allow, RateLimiter loads the bucket, refills tokens for the elapsed time, takes one, and writes back. Concurrency: refill and take run as one atomic operation inside the store, so two servers cannot both spend the last token. Metrics: allowed, denied, and store latency per key.
How long it should be and who reads it
An LLD document for one service or one module usually runs 3 to 8 pages, or about 1,500 to 4,000 words with diagrams. Longer than that usually means the scope covers more than one part and should be split. Two people read it. The engineer who implements it reads it front to back and should not need to ask a question the document could have answered. The reviewer, usually a senior engineer on the team, reads sections 3, 5, 6, and 9 closely, because a wrong decision there costs the most to change after the code exists.
The writing guidance in How to write a good LLD? and the sample in What is the example of low level design? show what finished documents contain.
How the document maps to the LLD interview
An LLD interview round is the same document produced out loud in 45 to 60 minutes, with the sections weighted differently. You are expected to give spoken versions of section 3, the class diagram, section 4, the method signatures, and section 7, the sequence of calls for the main flow. Sections 1 and 9 appear as short remarks: you state your assumptions at the start and name the one concurrency case near the end. Sections 5, 6, 10, and 11 are usually skipped unless the interviewer asks. What to Expect in a Low-Level Design Interview Round describes how that hour is run.
How to Prepare
- Write one full document. Pick a parking lot, an LRU cache, or the rate limiter above and fill in all eleven sections. The first draft takes about four hours and teaches more than reading ten samples.
- Practice sections 3, 4, and 7 out loud. Draw the class diagram on paper while you speak. Time yourself at 20 minutes for the diagram and 10 for the main sequence.
- Study the patterns the diagrams use. Grokking the Object-Oriented Design Interview works through the standard problems with class diagrams and method signatures for each.
- Keep the high-level view next to it. Grokking the System Design Interview shows the kind of design that an LLD document is one part of.

GET YOUR FREE
Coding Questions Catalog

$99

$197

$72