Intermediate12 min readOO Analysis & Modelinglive prototype

Requirement Gathering & Clarifying Questions

Never start coding a vague prompt — ask the clarifying questions that turn "Design a parking lot" into a bounded, agreed-upon spec, then design against THAT.

The idea

What it is

Before you draw a single class, you have to know what you're actually building. Requirement gathering is the deliberate act of turning a fuzzy, one-line prompt — "Design a parking lot," "Design a chess game," "Design an elevator" — into a concrete, bounded list of things the system must and must not do. The tool for that conversion is the clarifying question: a short, pointed question whose answer removes ambiguity and locks down a piece of scope.

Think of an architect handed the brief "design me a house." A good one doesn't immediately reach for a pencil and start drawing walls. They ask: How many people will live here? One storey or two? What's the budget? Do you need a garage? Wheelchair access? Every answer constrains the design and rules out wrong directions. Starting to draw before those answers means building a beautiful house for the wrong family. Code is no different — a slick ParkingLot class that solves a problem nobody asked for is wasted work.

In an LLD interview this step is the difference between a senior and a junior signal. The interviewer hands you something vague on purpose. They are watching whether you charge in and code, or whether you pause, scope the problem, state your assumptions, and get agreement first. The clarification phase is not a warm-up before the real work — it is part of the work being assessed.

The one sentence to remember

A vague prompt is not a spec — it's an invitation to ask questions. Spend the first few minutes turning ambiguity into an agreed, bounded list of requirements, and design against that, not against your guesses.

Mechanics

How it works

Why you must never code a vague prompt

"Design a parking lot" silently hides a dozen forks. Are there different spot sizes for motorcycles, cars, and trucks? Can one vehicle span several spots? Do we charge by the hour? Is there one entrance or many? Each fork leads to a different class model. If you pick answers in your head and start coding, you are gambling that your private assumptions match the interviewer's hidden ones — and when they don't, you've built the wrong system and have to unwind it under time pressure. Asking up front is cheaper than rewriting later, every single time.

The categories of clarifying questions

Strong candidates don't ask questions at random — they sweep through a mental checklist of categories so nothing important is missed. The six that matter most for LLD:

  • Functional scope — what must the system actually do? "Should it handle payments, or just allocate spots?" These answers become your core features and methods.
  • Actors & use caseswho uses it and how? A driver, an attendant, an admin, a billing system — each actor implies entry points and permissions.
  • Scale & volumehow big? How many spots, how many entrances, peak cars per hour? Scale decides whether a simple list is fine or you need indexed lookup.
  • Constraints & assumptions — what's fixed or out of bounds? "Assume one physical lot, no multi-site." These trim the design surface.
  • Edge cases — what happens at the boundaries? Lot full, vehicle too large for any free spot, lost ticket, double-entry. Naming these shows design maturity.
  • Non-functional — qualities, not features: concurrency (two cars at two gates at once), persistence (does state survive a restart?), and — interview-specific — the time budget for the discussion itself.

State your assumptions out loud and get buy-in

You won't get an answer to every question, and you shouldn't try — that stalls the conversation. The senior move is to state an assumption explicitly and ask for confirmation: "I'll assume a single physical lot with three spot types — motorcycle, car, truck — and that one vehicle takes exactly one spot. Sound right?" This does three things: it keeps you moving, it makes your reasoning visible, and it hands the interviewer a clean moment to correct you before it's baked into code. Silent assumptions are a trap; spoken assumptions are a skill.

Bound the scope — in scope vs. out of scope

Equally important to deciding what you will build is declaring what you won't. Writing down an explicit in scope / out of scope / future work split protects you from sprawl and signals discipline. A written requirements block at the start of an LLD answer might look like:

text
=== ParkingLot — agreed requirements ===
IN SCOPE
  - Single physical lot, multiple floors
  - Spot types: motorcycle / car / truck
  - One vehicle occupies exactly one spot (no oversized spanning)
  - Park & unpark; find the nearest free spot of the right type
  - Charge by time on exit (hourly rate per spot type)

OUT OF SCOPE  (mention, then defer)
  - Multi-site / franchise network
  - Reservations & loyalty pricing
  - Real-time license-plate recognition

ASSUMPTIONS  (stated, awaiting buy-in)
  - At most a few thousand spots -> in-memory structures are fine
  - Single-process for now; concurrency handled with simple locking

Notice how much design is already implied: "find the nearest free spot of the right type" hints at a findSpot(VehicleType) method; "charge by time on exit" hints at a Ticket with an entry timestamp and a pricing strategy. The spec is the skeleton the classes hang on.

The interview-specific angle

Treat the first 3–5 minutes as a dedicated requirements phase, not optional small talk. Interviewers explicitly score whether you clarify before designing — jumping straight to classes is one of the most common ways strong coders fail LLD rounds. Lead with functional scope and a couple of sharp scale questions, write the answers down where you both can see them, confirm your assumptions, and only then start modeling. The written spec also becomes your anchor: when you're deep in code and start to drift, you glance back at it.

Beware analysis paralysis and rabbit holes

Clarifying is not interrogating. Drilling into the exact RGB of the ticket-printer LED, or debating tax law for parking fees, burns your time budget without locking any real scope — those are rabbit holes. Ask the few questions that change the shape of the design, note the rest as out of scope, and move on. The goal is a bounded spec, not a perfect one.

Where this sits in LLD

Everything downstream depends on this step. Your core entities, your class diagram, your choice of design patterns, and your read of coupling and cohesion all flow from the requirements you locked here. Get the requirements wrong and a flawlessly executed design still solves the wrong problem.

Interactive prototype

See it. Build it. Break it.

A sandboxed, hands-on simulation — no setup, no install. Play with it as you read.

About this simulation

The prompt at the top is deliberately vague: "Design a parking lot." A bank of candidate clarifying questions sits grouped by category — Functional scope · Actors · Scale · Constraints · Edge cases · Non-functional. Click a question to ask it: a concrete answer appears and a line is appended to the Requirements spec panel. Watch Ambiguity remaining fall and Scope locked rise. A few questions are rabbit holes (marked red) that burn time without locking any scope. Hit Show final spec to reveal the complete locked specification, or Reset to start over.

Hands-on

Try these yourself

Open the prototype above, predict what happens, then verify.

try 01

Ask a high-value question from a category

In the question bank, find the Functional scope group and click "Do we charge by time, or is parking free?". A concrete answer appears, a new line is appended to the Requirements spec panel on the right, Ambiguity remaining ticks down, and Scope locked ticks up. The console narrates the ask. Sweep the other categories — Scale, Actors, Constraints, Edge cases, Non-functional — and watch the two meters converge as the spec fills in.

try 02

Step into a rabbit hole on purpose

Now click one of the red-flagged rabbit hole questions, like "What font is printed on the ticket?". Notice it turns red, the console warns you it was out of scope, the Time spent meter jumps, but Ambiguity remaining does not fall and nothing is added to the spec. That's the lesson: not every question is worth asking — some only cost you time.

try 03

Reveal the locked spec, then Reset

Once you've asked the questions that matter, press Show final spec to reveal the complete, bounded specification — the in scope / out of scope / assumptions block you'd design against. Then hit Reset to clear the board and the console back to the original vague prompt, and try sweeping the categories in a different order.

In practice

When to use it — and what trips people up

When to spend time clarifying

Run a deliberate requirements phase whenever the prompt is open-ended — which, in an LLD or system-design interview, is always. "Design X" with no further detail is a signal to clarify, not to code. The same applies on the job: a one-line ticket ("add export to the dashboard"), a feature kicked off from a hallway conversation, or any task where you find yourself guessing at intent. The fuzzier the brief and the higher the cost of building the wrong thing, the more the first few minutes of questions pay off.

When to stop and start building

Clarifying has diminishing returns. Once you have the functional scope, the key actors, a rough sense of scale, the hard constraints, and a written in-scope/out-of-scope line — stop. Confirm your assumptions, then start modeling. Chasing every remaining edge case before writing any code is its own failure mode: you run out of time with a perfect spec and no design. Lock the questions that change the shape of the solution; defer the rest as out of scope and revisit only if they bite.

What it gives you

  • You design the right system — clarifying up front beats discovering the misunderstanding after you've written the classes.
  • It's a strong seniority signal — interviewers explicitly score whether you scope and confirm before coding.
  • A written in-scope / out-of-scope spec bounds the problem and protects you from sprawl mid-design.
  • Stated assumptions give the other side a clean moment to correct you before anything is baked in.
  • The spec doubles as a design skeleton — answered questions map straight onto entities, methods, and signatures.

Common mistakes

  • Over-clarifying wastes the clock — analysis paralysis leaves you with a perfect spec and no design.
  • Rabbit-hole questions feel productive but lock no real scope; telling them apart takes judgement.
  • Too many low-value questions can read as stalling or indecision rather than rigor.
  • Silent (unspoken) assumptions are worse than none — they hide the very mismatch clarifying is meant to catch.
  • Requirements drift — a spec agreed early can go stale if the conversation evolves and you don't update it.

Reference

Code & further reading

A minimal reference implementation and pointers worth bookmarking.

// Three clarifying questions, answered, become three design decisions:
//   Q1: "Can one vehicle occupy multiple spots?"   -> A: no, exactly one
//   Q2: "Are there spot types?"                     -> A: yes: motorcycle/car/truck
//   Q3: "Do we charge by time?"                     -> A: yes, hourly per type
//
// Those answers translate directly into the interface skeleton below.

enum VehicleType { Motorcycle, Car, Truck }   // from Q2

interface Ticket {
  spotId: string;
  vehicleType: VehicleType;
  entryTime: number;       // from Q3 — we need a clock-in
}

interface ParkingLot {
  // Q1: returns ONE spot id (not a list) — one vehicle, one spot
  // Q2: takes a VehicleType so it finds the right kind of spot
  park(type: VehicleType): Ticket | null;   // null when the lot is full (edge case)

  // Q3: cost depends on time elapsed since entryTime
  unpark(ticket: Ticket): number;           // returns fee owed
}

// Had Q1 been "yes, trucks span 2 spots", park() would return string[].
// Had Q3 been "parking is free", unpark() would return void.
// The questions literally shape the signatures.

References & further reading

6 sources

Knowledge check

Did it land?

Quick questions, answers revealed on submit. Sign in to save your best score.

question 01 / 05

You're given the prompt "Design a parking lot" in an LLD interview. What should you do first?

question 02 / 05

Which of these is a clarifying question that changes the SHAPE of the design (worth asking), rather than a rabbit hole?

question 03 / 05

You can't get an explicit answer to every question. What's the senior move when you have to fill a gap?

question 04 / 05

Why is it valuable to write an explicit "out of scope" list, not just an "in scope" one?

question 05 / 05

Which set best captures the major CATEGORIES of clarifying questions to sweep for an LLD problem?

0/5 answered