📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

When does a change need a design document rather than just a ticket and a pull request? What goes into a good design doc, and how do you get it reviewed without it turning into weeks of debate?

Covers when a design document is worth writing, the sections of a good one (context, goals and non-goals, proposal, alternatives, risks, rollout), keeping it short, running a time-boxed review, and turning outcomes into ADRs.

Mid-Level Theory Intermediate architecture code-quality collaboration design-documents documentation engineering-practice

🎯 Key points

  • Write one when the change is multi-sprint, cross-team, hard to reverse or has real alternatives
  • Sections: context, goals and non-goals, proposal, alternatives, risks, rollout and testing, open questions
  • Non-goals prevent scope creep and endless debate
  • Check the proposal against the team's architecture vision and existing ADRs; call out any deviation
  • Record the reasoning behind each choice, not just the choice
  • Review time-boxed: named reviewers, a deadline, then a decision meeting if needed
  • Cover security, privacy (Privacy Act / APPs) and operability, not just the happy path
  • After approval, key decisions become ADRs (the lasting source of truth) and the doc is archived

⏱ 30-second answer

A design document is worth writing when a change is big, cross-team, hard to reverse or has genuinely different options: a new service, a data migration, a change to an API contract other teams use. A ticket and PR are enough for everything else.

A good one has: context, goals and non-goals, the proposal, alternatives considered, risks (security, privacy, operability), rollout and testing, and open questions, in two to six pages with a diagram.

Review it time-boxed: name the reviewers, set a deadline of a few days, resolve comments, and hold a short decision meeting only for what's still open. Key decisions then become ADRs.

The trade-off: a design doc costs a few days up front, but catching a wrong approach on paper is far cheaper than catching it in code review or production.

🗣 Full answer (senior)

How I would answer this in an interview

"I write a design document when the cost of getting the approach wrong is high: the work spans several sprints, affects other teams or shared contracts, is hard to reverse like a data migration, or there are two or three genuinely different ways to do it. Adding an endpoint or fixing a bug doesn't need one; a ticket and a good PR description are enough. Splitting a monolith's billing module into a service, or moving from synchronous calls to events between Orders and Fulfilment, definitely does.

The structure I use is: context (what exists and why change it), goals and non-goals (non-goals matter most, because they stop the scope growing in review), the proposal with a diagram, alternatives considered and why they lost, risks, which for me always includes security, privacy (are we moving personal information, does it stay in Australia East, what does the Privacy Act require) and operability (how we'll monitor it, what the failure modes are), then rollout and testing, and open questions. I aim for two to six pages. If it's longer, it's probably two designs.

To review it without endless debate, I name specific reviewers including someone from each affected team, give a deadline, usually three to five working days, and ask for comments in the doc. Most things resolve in comments. Anything still open goes to one 30-minute meeting where we decide, and the significant decisions are captured as ADRs. If a question can't be answered on paper, like whether a library can handle our throughput, I run a short spike instead of arguing. The mistake I see is either skipping design entirely on big changes, or treating the doc as a contract to maintain forever. It's a thinking and alignment tool; once built, the code and ADRs are the record."


Does it need a design doc?

Change Design doc? Why
New endpoint following existing patterns No Ticket + PR is enough
New service or splitting a module out Yes Boundaries, data ownership, operations
Data migration or schema change across services Yes Hard to reverse, needs rollout plan
Changing a public or cross-team API contract Yes Consumers affected
Choosing between two libraries Maybe An ADR may be enough

Sections of a good design doc

Section What it answers
Context What exists today and what problem we're solving
Goals / non-goals What success looks like; what we're deliberately not doing
Proposal The design, with a diagram and key interfaces
Alternatives Other options and why they lost
Risks Security, privacy, performance, operability, cost
Rollout and testing Feature flags, migration steps, rollback, test strategy
Open questions What still needs a decision

Design doc versus ADR

Design doc ADR
Purpose Explore and align before building Record one decision permanently
Size 2–6 pages 1–2 pages
After delivery Archived Kept and superseded when needed

Production example

Before splitting invoicing out of an order monolith, a five-page design doc with three reviewers from Finance, Orders and Platform surfaced that month-end batch jobs read invoice tables directly, which the original plan had missed. Fixing that on paper took two days; we estimated finding it after the split would have broken month-end billing for around 4,000 customers.

🔍 What the interviewer is checking

Checks whether the candidate can judge when up-front design is worth it and run a design review that leads to a decision.

Green flags

  • Clear criteria for when a design doc is needed
  • Includes non-goals, alternatives and non-functional risks
  • Time-boxes the review and drives to a decision
  • Links design docs to ADRs and spikes

Red flags

  • Never writes design down, or writes 30-page specs for everything
  • Only covers the happy path
  • Review has no owner or deadline

📚 Learn in depth

1. Why write before building

The cheapest place to change a design is before any code exists. A design doc forces the author to think through edge cases, gives affected teams a chance to object early, and leaves a record of why the system looks the way it does. Many large engineering organisations use some form of design doc or RFC process for exactly this reason.

2. A design doc's shape

+---------------------------------+
| Title, author, reviewers, date  |
| Status: Draft / In review / Approved
+---------------------------------+
| Context                         |
| Goals | Non-goals               |
| Proposal  + diagram             |
| Alternatives considered         |
| Risks: security, privacy, ops   |
| Rollout, testing, rollback      |
| Open questions                  |
+---------------------------------+

3. Non-goals: the scope fence

Reviewers naturally suggest improvements. Non-goals let you say "good idea, explicitly out of scope" without a debate. Example: "Non-goal: changing the invoice PDF format."

4. Covering the non-functional side

A design that only describes the happy path is half done. Ask: what fails, how we detect it (metrics, alerts in Application Insights), how we roll back, what personal information moves and where it's stored (APP 8 cross-border disclosure, Azure Australia East / Southeast), and what it costs to run.

5. Running the review

Day 0  Share draft, name reviewers, set deadline (3-5 days)
Day 1-4 Async comments in the doc; author replies or updates
Day 5  30-min decision meeting for unresolved items only
After  Status = Approved; key decisions -> ADRs; link from epic

The deadline matters: without one, review drifts for weeks.

6. Spikes versus paper

Some questions (throughput of a library, behaviour of a cloud service under failure) are faster to answer with a one-to-three-day spike than with discussion. Record the result in the doc.

Try it yourself

  1. Take a feature you shipped recently and write its non-goals in hindsight. Would they have prevented scope creep?
  2. Write a two-page design doc for a small change using the sections above.
  3. Add a 'Privacy and data' heading and list every personal field your design touches.
  4. Run a time-boxed review with two colleagues and a three-day deadline.
  5. Extract one decision from the doc into an ADR.

💻 Code

A design doc's proposal usually includes the key contract, written as code so reviewers can comment on real types.

// Proposed contract between Orders and the new Invoicing service (design doc section 3).
namespace Contracts.Invoicing;

/// <summary>Published by Orders when an order is confirmed. Consumers must be idempotent.</summary>
public sealed record OrderConfirmed(
    Guid OrderId,
    Guid CustomerId,
    DateTimeOffset ConfirmedAt,
    IReadOnlyList<OrderConfirmedLine> Lines,
    int SchemaVersion = 1);

public sealed record OrderConfirmedLine(string Sku, int Quantity, decimal UnitNet, string TaxCode);

A design doc skeleton kept next to the code:

# Design: Extract Invoicing from the Orders monolith
Author: [name] | Reviewers: [Finance], [Orders], [Platform] | Review by: [date]
Status: In review

## Context
## Goals
- Invoicing deploys independently of Orders
## Non-goals
- Changing the invoice PDF format
## Proposal
## Alternatives considered
## Risks (security, privacy, operability, cost)
## Rollout, testing and rollback
## Open questions

⚠ Common mistakes

  • Mistake: Writing a design doc for every change. Why it is wrong: It slows small work and makes docs feel like bureaucracy. Instead: Reserve them for big, cross-team or hard-to-reverse changes.
  • Mistake: No non-goals. Why it is wrong: Scope grows with every reviewer's suggestion. Instead: List what's deliberately out of scope.
  • Mistake: Documenting what you'll build but not why. Why it is wrong: Implementers fill the gaps with their own assumptions, and maintainers later 'fix' deliberate choices because nobody wrote down the reason. Instead: Give the reasoning for each significant choice and carry the lasting ones into ADRs.
  • Mistake: A design that quietly contradicts the team's architecture direction. Why it is wrong: The system drifts into inconsistent patterns that are harder to operate and learn. Instead: Reference the relevant ADRs and architecture principles, and call out any deliberate deviation for reviewers to approve.
  • Mistake: Describing only the happy path. Why it is wrong: Failure modes, privacy and operations are where designs fail in production. Instead: Include risks, monitoring, rollback and data handling.
  • Mistake: Open-ended review with no deadline. Why it is wrong: Review drags for weeks and the team starts building anyway. Instead: Name reviewers and set a three-to-five-day deadline.
  • Mistake: Leaving out alternatives. Why it is wrong: Reviewers propose them in comments and you re-argue from scratch. Instead: Show the options you rejected and why.
  • Mistake: Maintaining the doc forever. Why it is wrong: It drifts from the code and misleads. Instead: Archive it after delivery and keep the lasting decisions as ADRs.

🏛 Senior insight: trade-offs

A design document is mostly an alignment tool: its value is the disagreements it surfaces early. Senior engineers pick reviewers deliberately, including the team most likely to be hurt by the change, and they drive the review to a decision rather than waiting for consensus. They also know when to stop writing and run a spike.

Option When it fits Cost When not to
Ticket + PR description Routine change Minutes Cross-team impact
ADR One clear decision An hour Many interdependent decisions
Design doc Multi-sprint or cross-team change Days Small or easily reversed
Spike Unknowns that paper can't settle 1–3 days Answer is already known

A useful measure: how often do big changes get reworked after code review? If often, design is happening too late.

🔗 Follow-ups the interviewer may ask

  1. When: Candidate mentions recording decisions that come out of the design review. Why: Checks they know how ADRs differ from design docs and how to keep them useful.
    How to answer

    An architecture decision record (ADR) is a short document capturing one significant decision: the context, the decision, its status and its consequences, including the options you rejected.

    • Write one when a decision is hard to reverse, affects several teams or modules, or will be questioned later: choosing a message broker, an auth approach, a multi-tenancy model.
    • Keep them as numbered Markdown files in the repository, reviewed in a pull request like code.
    • Once accepted they are immutable: when the decision changes you write a new ADR that supersedes the old one.

    The trade-off: an ADR costs an hour to write but saves weeks of re-arguing or reverse-engineering a decision. Writing them for trivial choices kills the habit.

  2. When: Candidate gives a design doc example about a large refactoring or extraction. Why: Checks they can execute the plan safely while delivery continues.
    How to answer

    I treat a large refactoring as a series of small, behaviour-preserving steps merged to main continuously, not a big-bang branch. First I pin current behaviour with characterisation tests. Then I pick a technique: strangler fig to route traffic piece by piece to a new implementation, branch by abstraction to put an interface in front of the old code and swap implementations behind it, or parallel change (expand, migrate, contract) for APIs and database schemas. Feature flags and shadow comparisons let old and new paths run side by side. I prioritise hotspots (code that changes often and hurts), keep refactoring commits separate from feature commits, and define an end state so it does not drag on forever.

🛠 Real-world problems: how you handle them

Design review catches hidden table dependency before a service split
Situation
A [size] team was extracting invoicing from an order monolith on Azure SQL, serving about [number] customers. The initial plan was to move invoice tables into a new database in [time].
Signals
Nothing in production yet. During review, a Finance reviewer asked how month-end reconciliation would work; nobody on the team knew the reconciliation job's data source.
Investigation
Searched the codebase and SQL Agent jobs for references to invoice tables; used Query Store and `sys.dm_exec_query_stats` to find queries hitting those tables from other applications; found two month-end jobs and a reporting view reading them directly.
Resolution
Updated the design with a new section: publish invoice events and provide a read model for reporting, migrate the jobs before moving tables, and keep a compatibility view during transition. Re-reviewed in a 30-minute meeting and recorded the data-ownership decision as an ADR.
Prevention
Added 'Who else reads or writes this data?' to the design doc template, with Query Store checks as a standard step; included a Finance or Operations reviewer on any change touching billing data.

How to tell it (STAR)

**S:** At [company] we were splitting invoicing out of our order monolith. **T:** I owned the design and wanted it reviewed before we wrote code. **A:** I wrote a five-page design doc with goals, non-goals, alternatives and a rollout plan, and invited reviewers from Finance, Orders and Platform with a four-day deadline. A Finance reviewer's question led me to Query Store, where I found two month-end jobs reading invoice tables directly. I added a migration path for them and recorded the data-ownership decision as an ADR. **R:** We caught it on paper in [number] days instead of breaking month-end billing for about [number] customers, and the split went live [with no billing incidents].

↩ Usually asked after

More in Engineering Practice

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me