Foundations 0/8

Lesson 6 of 8

Design interview formats

Compare the working code, class design and system diagram expected in different design interview formats.

2,014 words · 9 min read

A design interview tests decisions at a chosen level of detail

System design describes how software meets a set of user needs under stated operating constraints. A design includes the data the system remembers, the operations callers can perform and the behavior when part of the system fails. In an interview, you explain these choices aloud so another engineer can examine the assumptions and follow their consequences.

High-level design (HLD) studies the boundaries between services and storage systems. A booking design might describe where requests enter, where seat ownership is recorded and how confirmation reaches the caller. Low-level design (LLD) studies responsibilities and legal state changes inside a component. For the same feature, it might specify a hold object, its methods and the transition from held to confirmed.

These levels answer related questions at different scales. An atomic booking operation can prevent two callers from owning the same seat; a regional recovery plan addresses what happens when the storage serving that operation becomes unavailable. A service diagram leaves the first question open unless it explains the storage contract. A class diagram leaves the second open unless it explains the surrounding system.

Employers use the HLD and LLD labels differently, and some combine them in one round. Before choosing a level of detail, confirm whether the round expects working code, class and method sketches, an architecture diagram or a combination, and how long you have.

What interviewers evaluate

Most design rounds assess the same chain of reasoning, whatever their format. Requirements: can you turn a vague prompt into a few core operations and measurable targets, and say what is out of scope? Interfaces and data: do the API and the stored records support those operations, with identifiers and ownership stated? Request flow: can you trace one request from the caller to durable state and back, naming where the authoritative copy of each piece of data lives?

A deep dive follows the hardest requirement. When the prompt demands that no seat is sold twice or that a link redirects 100,000 times a second, the interviewer wants the mechanism that meets it and the arithmetic behind it. Tradeoffs come with every added component: what it costs in latency, consistency, money or operating work, and what you would choose under different requirements. Communication runs through all of these: stating assumptions aloud, checking with the interviewer before going deep and keeping the clock in view so the design is complete.

Expectations rise with seniority. An early-career candidate is expected to reach a complete, working design and to improve it when the interviewer points at a weakness. A senior candidate is expected to find the weak points unprompted, choose which deep dives matter for these requirements and lead them. Hello Interview’s delivery guide names failing to deliver a working system as the most common failure for mid-level candidates, usually caused by poor time management rather than missing knowledge.

Machine coding, LLD, code design and HLD rounds

Common shapes of each round; confirm the format and length with your recruiter
RoundWhat you produceTypical lengthWhat fails a candidate
Machine codingA runnable program for a small product, such as a parking lot or an expense splitter, with a driver or tests, followed by a review of the code90 to 120 minutes including reviewCode that does not run at the end; one class owning every responsibility; no demonstrated flow
Low-level design (LLD)Classes, responsibilities, method signatures and state transitions, sometimes with the core methods written out45 to 60 minutesA list of nouns with no behavior; illegal transitions left possible, such as releasing a confirmed hold; patterns named without a reason
Code designWorking code for one focused component, extended as the interviewer adds requirements during the roundAbout 60 minutesA structure that needs rewriting for each new requirement; edge cases never tested
High-level design (HLD)Requirements, estimates where they matter, an API, a data model, an architecture diagram and one or two deep dives45 to 60 minutesComponents drawn before requirements; no request traced end to end; scaling claims with no identified bottleneck

Each decision needs a requirement and a consequence

A design decision becomes assessable when you connect it to an observable requirement. Begin with who calls the system and what a successful operation promises. “Reserve a seat” still leaves open whether a reservation expires, whether a group must be seated together and whether a retry can create a second reservation. Those choices determine the state the implementation must preserve.

Then describe operating constraints that can change that implementation. A peak request rate gives a throughput target. A latency bound needs a measurement boundary and a population, such as 99% of successful hold requests completing within 300 ms. A data-loss tolerance determines what the server must durably record before acknowledging success. Unspecified constraints should become explicit assumptions that you can revise during the discussion.

An HLD answer turns these requirements into an API, a storage model and a complete request path. Trace an ordinary hold request from the caller through an atomic storage operation to the reply. When adding a cache, identify its key, freshness rule and miss behavior. When adding a queue, identify the durable event and the point at which the user may consider the operation complete.

An LLD answer brings the same precision to a component. Define the inputs, outputs and legal state transitions before writing the implementation. A confirmed hold cannot silently return to available because a release method was called twice. Walking through a valid call and a rejected call reveals whether the interface expresses that rule and whether callers can distinguish the outcomes.

The same booking feature produces different artifacts

Choose detail that answers the current question
DecisionHLD evidenceLLD evidence
Create a bookingRequest route, durable record and response contractMethod inputs, return value and object state change
Avoid oversellingAtomic storage operation and contention boundaryCapacity invariant and rejected transition
Retry after a timeoutIdempotency key and durable deduplicationRepeated-call semantics and test cases
Change allocation behaviorEffect on API and storage assumptionsReplaceable policy interface and contract tests
Investigate overloadThroughput, latency and admission behaviorCost and bounded memory of an operation

The first ten minutes of a URL-shortener round

The opening minutes produce the requirements every later decision is judged against. A condensed exchange for “Design a URL shortener” shows the order: operations first, then scale and quality targets, then the API and the stored data.

  • Minutes 0 to 2. Candidate: “The core operations are creating a short link for a long URL and redirecting anyone who opens it. Are custom aliases, expiry or click analytics in scope?” Interviewer: “Custom aliases yes. Analytics if there is time.”
  • Minutes 2 to 5. Candidate: “I’ll assume 100 million new links a month and 100 redirects for every link created, so reads dominate. That is about 40 creations and 4,000 redirects a second on average. At roughly 500 bytes per link, a year of links is about 600 GB. Redirects should feel instant, so I’ll target a server-side p99 under 100 ms, and a short code must never change destination unless its owner edits it.”
  • Minutes 5 to 8. Candidate: “POST /links takes the long URL and an optional alias and returns the code. GET /{code} returns a redirect. I’ll use 302 rather than 301: browsers may cache a 301 indefinitely, which would stop edits and click counting from taking effect.”
  • Minutes 8 to 10. Candidate: “Each record holds the code, long URL, owner and creation time, keyed by code. Two creations must never receive the same code, so the insert relies on a uniqueness constraint. I’ll draw the redirect path first, since it carries 99% of the traffic.”

Ten minutes in, every later choice can be checked against stated numbers. A cache is justified by 4,000 redirects a second rather than habit, and the uniqueness constraint answers the correctness question before any discussion of how codes are generated. The URL-shortener practice prompt includes a graded sample answer to compare with your own.

Spend the clock where the risk is

A practice budget for a 45-minute HLD round is 5 minutes for scope, 5 for estimates and the data model, 15 for the request path, 10 for failures and a deep dive, and 5 for review. That totals 40 minutes and leaves 5 for the interviewer’s follow-up questions. Each phase should produce evidence the next phase uses.

Take a seat-booking prompt. During scope, establish that a seat receives a short-lived hold before confirmation. The data model then needs a seat identifier, a hold identifier, an owner, an expiry and a status. The request path must perform an atomic conditional transition from available to held; a separate availability read cannot guarantee that the seat stays free until a later write.

Use the failure time to challenge that path. Two simultaneous hold requests should have one successful owner. A committed hold whose response is lost leaves its caller uncertain, so retries need a stable operation identity. An expired hold raises another transition question: confirmation and expiry must not both succeed for the same version of a hold.

An LLD round moves more of the clock to the state machine, method contracts and tests, and a machine-coding round spends most of it writing and running code. Adjust the budget to what the interviewer asked you to produce and to the decision you still need to explain.

Allocate time to requirements, design and failure cases

What happens to the rest of the round when one phase grows? Divide a 45- or 60-minute HLD or LLD session across its phases and see which ones run out of time.

Practice allocations only. Time assigned does not measure answer quality.

Requirements and scope0 to 5 min

Suggested: 5 min · Target allocated

Workload and data5 to 10 min

Suggested: 5 min · Target allocated

Request path10 to 25 min

Suggested: 15 min · Target allocated

Failure scenarios25 to 35 min

Suggested: 10 min · Target allocated

Review and questions35 to 40 min

Suggested: 5 min · Target allocated

Allocated: 40 min

Unallocated: 5 min

Suggested allocations met: 5 / 5

Raising the design phase to 30 minutes while keeping the other defaults runs 10 minutes over a 45-minute round, and recovering that time from failure analysis leaves the riskiest part of the design unexamined. A full timeline still cannot judge the spoken answer: five minutes of unrelated discussion does not establish a requirement, while a strong follow-up can cover two phases at once.

What stays true

Every design decision points to a stated requirement or a stated assumption, and every core requirement is traced through the design at least once.

When the interviewer changes an assumption, for example to ten times the traffic, you can then name which decisions depend on it and which stay. A component with no requirement behind it is the first thing an interviewer will question.

Plausible plans that leave behavior unexplained

  1. Treating a 45-minute round as 45 minutes of drawing.

    Where it breaks
    The allocation [0, 0, 45, 0, 0] fits the clock but leaves scope, data modeling, failure analysis and review uncovered.
    The fix
    Write the requirements and trace a request before extending the architecture.
  2. Using a component name as a correctness argument.

    Where it breaks
    Two callers read one free seat and both write a booking; adding a cache to the diagram still produces two bookings for one seat.
    The fix
    Identify the atomic operation that permits only one successful transition.
  3. Bringing one practice format to every round.

    Where it breaks
    A code-focused round receives a 15-minute diagram discussion and no runnable implementation even though the interviewer asked for code.
    The fix
    Confirm what the interviewer asked you to produce and adapt the plan to that round.
  4. Adding failure time without reducing another phase.

    Where it breaks
    [5, 5, 30, 10, 5] totals 55 minutes, exceeding a 45-minute session by 10.
    The fix
    Recalculate the whole schedule whenever one allocation changes.

Turn interview structure into technical reasoning

Related topics

Further reading