Senior engineering skills
Design Docs and Technical Writing
A design doc is how a decision gets made once, by the right people, and stays made. This page shows the shape of one, a complete worked example (moving the bank's money transfers from synchronous to queued processing), bad and better versions of the hard sections, decision records, diagrams, review, and two templates to copy. Every document, number, date and name in the examples is invented for this page.
Why and when
Part 1 of 6 · what a document buys, and when to skip it
A meeting against a document
A decision made in a meeting lives in the memory of the people who were there. A week later each of them holds a different version.
- Writing is also the cheapest test of a design: a gap that hides in talk shows on the page.
When a design doc is worth it
Match the writing to the cost of being wrong. A two-way door can be walked back through cheaply, a one-way door cannot.
| Size | Risk | Reversible? | Write |
|---|---|---|---|
| Under a day | Low | Yes, revert the commit | A good pull request description |
| Days, one team | Low to medium | Yes, two-way door | A one-pager or an ADR |
| Weeks, or crosses teams | Medium | Yes, with effort | A design doc |
| Any size | High: money, data, security | No, one-way door | A design doc and an ADR |
| An urgent fix in an incident | Already happening | Not the question | Fix first, then a post-mortem |
One-way doors: a data model others read, a public API, a vendor contract, anything that deletes data. Size does not matter here: a one-line schema change can be one.
The life of a design doc
The status line at the top of the doc says where it is in this cycle. A doc without a status is assumed to be current, which is how stale designs get built.
| Step | Who | Output |
|---|---|---|
| Problem | Author, with the people who feel it | Half a page that others agree is true |
| Draft | Author, one early reader | A design and at least two alternatives |
| Review | Named reviewers, with a deadline | Comments, each resolved in the doc |
| Decision | One named approver | A dated line in the decision log |
| Build | The team | The doc updated when the design changes |
| Archive | Author | Status "Implemented", links to the code and the runbook |
Anatomy and a worked example
Part 2 of 6 · the sections, then one whole doc written out
The sections, in order
The order follows the reader's questions: why, what, why this way, what can go wrong, how it ships, what was decided.
| Section | Question it answers | Length | Common mistake |
|---|---|---|---|
| Title and status | What is this, and is it current? | 4 lines | No status, no date, no approver |
| Context and problem | What hurts, for whom, how much? | 1 to 2 paragraphs | Describes the solution |
| Goals and non-goals | What does done look like, and what is out? | 3 to 5 bullets each | Goals that cannot be measured |
| Requirements | What load, latency, correctness? | A small table | "Fast" and "scalable" with no number |
| Proposed design | How does it work? | 1 diagram, half a page | Code-level detail, no picture |
| Alternatives | What else was possible? | A table, 3 to 4 rows | Strawmen, or "do nothing" missing |
| Trade-offs | What do we give up? | 3 to 5 bullets | Only benefits listed |
| Risks and mitigations | What could go wrong, and then what? | A table | No likelihood, no owner |
| Rollout and rollback | How does it reach users, and come back? | Phases with dates | "Deploy to production" |
| Testing and observability | How do we know it works, today and at 3 am? | 5 bullets | Tests only, no metrics or alerts |
| Security and privacy | What new data, access or attack surface? | 3 bullets | "N/A" |
| Cost | What does it cost to build and to run? | 2 lines | Run cost forgotten |
| Open questions | What is not decided yet? | A short list | No owner, no date |
| Decision log | Who decided what, when? | One line per decision | Decisions left in comment threads |
Related: the first four groups are the same order as the interview framework in System Design Foundations: requirements, estimates, design, deep dives.
Example: status, context and problem
The doc proposes moving the bank's transfers from synchronous to queued processing. The header says who decides and by when, and the problem is stated with numbers and no solution.
Example: goals, non-goals, requirements
Each goal is a number someone can check after launch. Non-goals name the nearby work a reader would otherwise assume is included.
Note: "time to final state" gets worse on purpose, from 4.2 s to 5 s. Writing that row is what makes the trade visible before anyone builds it.
Example: the proposed design
One before picture, one after picture, then a few lines for what the pictures cannot show.
Example: alternatives and trade-offs
Every option is scored on the same criteria, which come from the goals. The option not chosen still gets its real strength written down.
| Option | G1: double debits | G2: accept p99 | New parts | Effort | Verdict |
|---|---|---|---|---|---|
| A. Do nothing, add servers | Still 37 a quarter | 4.2 s: the partner is the limit | None | Days | Fixes neither goal |
| B. Stay synchronous, add idempotency key | 0 | 4.2 s, 1.8% still time out | None | 2 weeks | Meets G1 only. Built first, as phase 0 |
| C. Queue with outbox and workers | 0 | About 150 ms | Queue, workers, relay | 6 weeks | Chosen: meets G1 to G3 |
| D. Event log with a saga per transfer | 0 | About 150 ms | Event log, saga engine | 4 months | More than three steps need. Revisit if steps grow |
Example: risks, rollout, testing
Each risk has a likelihood, an impact and a mitigation that already exists in the design. Each rollout phase has an exit condition and a way back.
Example: security, cost, open questions, decision log
The last sections are short, and they are the ones readers come back for a year later.
Shape to copy: the whole doc is about two pages. Detail that reviewers do not need to decide (table definitions, queue settings) goes in an appendix or the pull request.
The hard sections
Part 3 of 6 · a bad and a better version of each
Problem statement: symptom or problem
A problem statement names who is hurt, how much and why, and contains no solution. If it names a technology, it is a solution in disguise.
| Bad | Better |
|---|---|
| "Transfers are slow, so we need a queue." | "On salary days 1.8% of transfers time out, because the request waits up to 6 s for the partner bank." |
| "The transfer service does not scale." | "Retries after a timeout debited 37 customers twice last quarter." |
Test: could two different designs solve this statement? If only one can, rewrite it.
Goals and non-goals
A goal is a result you can measure after launch. A non-goal is something reasonable that a reader would expect, and that you are choosing not to do.
| Bad | Better | |
|---|---|---|
| Goal | "Make transfers reliable and fast." | "Zero double debits. Accept p99 under 200 ms on a salary day." |
| Goal | "Introduce a queue." (a task) | "99.9% of transfers final within 30 s." (a result) |
| Non-goal | "Rewriting the whole bank." (nobody expected it) | "Scheduled transfers." (the next thing someone will ask for) |
Alternatives without strawmen
A reviewer trusts the choice only if the losing options were given a fair hearing. Always include "do nothing" and the cheapest partial fix.
| Bad | Better |
|---|---|
| "We considered cron jobs. They are outdated." | "A cron sweep every minute meets G1 and G2, and fails G3: final state takes up to 60 s." |
| One option, described three ways | Options that differ in kind: do nothing, patch, queue, event log |
| The rejected option has no strengths | "B takes 2 weeks and meets G1. We build it first." |
Interview point: "what else did you consider, and what would make you choose it?" is the most common follow-up to any design story. The alternatives table is the answer.
Trade-offs with numbers
A trade-off names what gets worse, by how much, and why that is acceptable. An adjective cannot be reviewed, a number can.
| Bad | Better |
|---|---|
| "Slightly more latency." | "The final result arrives 0.4 s after the response at the median, 5 s at p99." |
| "Some operational overhead." | "A queue and 4 workers: about 18,000 rupees a month and 2 new alerts." |
| "Eventually consistent." | "For up to 5 s a customer can see PENDING. The balance already shows the debit." |
Risks: likelihood and impact
Place each risk on a two by two. The cell decides how much design effort it earns.
| Low impact | High impact | |
|---|---|---|
| Likely | Automate it. A job that always fails: retries, then dead-letter queue | Design it out. A job delivered twice: idempotency key |
| Unlikely | Accept it. One line in the doc, no work | Detect and rehearse. Queue outage: outbox, alert, runbook |
| Bad | Better |
|---|---|
| "The queue might go down." | "Queue outage: low likelihood, high impact. Outbox rows wait, the relay resumes. Owner: reliability." |
Rollout with a way back
A rollout plan is a list of phases, each with an exit condition and a rollback that has been tried. Mark the point after which there is no way back.
| Bad | Better |
|---|---|
| "Deploy to production in sprint 14." | "Flag on for staff, then 10%, 50%, 100%. Hold each step 3 days." |
| "Roll back if there are issues." | "Roll back if any double debit, or final state p99 over 5 s for 10 minutes. Flag off, workers drain the queue." |
Decision records and diagrams
Part 4 of 6 · the smallest useful document, and pictures that explain
An ADR, worked
An architecture decision record (ADR) is one decision on one page, numbered, kept in the repository next to the code. It is never edited after acceptance: a later ADR supersedes it.
- Status values: Proposed, Accepted, Rejected, Deprecated, Superseded by ADR-N.
- Consequences list the bad ones too. That is the part a future reader needs.
ADR, design doc, RFC, one-pager, post-mortem
Five documents, five jobs. Teams use the names loosely, so check what yours means by "RFC" before writing one.
| Document | Purpose | Length | Lifetime | Audience |
|---|---|---|---|---|
| One-pager | Agree the problem is worth solving | 1 page | Until the decision to start | Manager, product, leads |
| Design doc | Choose and explain one design | 2 to 6 pages | Updated until shipped, then archived | Reviewers, the building team |
| RFC | Ask many teams for comment on a shared change | 2 to 6 pages | Open for a fixed comment period | Everyone affected |
| ADR | Record one decision and its consequences | Half a page | Permanent, never edited | Future maintainers |
| Post-mortem | Learn from an incident | 1 to 3 pages | Permanent, actions tracked | The whole engineering group |
Related: the shape of a blameless post-mortem is on Debugging in Production. A design doc often ends as two or three ADRs: one per decision worth keeping.
Which diagram for which question
Pick the diagram from the question the reader is asking. Two questions need two diagrams.
| Question | Diagram | Shows |
|---|---|---|
| Who and what does this system talk to? | Context | The system as one box, users and external systems around it |
| What runs, and what talks to what? | Container, component | Services, databases, queues, and the calls between them |
| What happens, in what order? | Sequence | Messages between parties over time |
| Where does this data go? | Data flow | Stores and processes, arrows named by the data |
| What states can this thing be in? | State | States and the events that move between them |
| Where does it run? | Deployment | Regions, networks, machines, what is replicated |
The C4 levels
C4 is four zoom levels of the same system. A design doc usually needs levels 1 and 2, and level 3 only for the part that changes.
Note: a C4 "container" is anything that runs or stores data (a service, a database, a queue). It does not mean a Docker container.
Five rules, and a redraw
The first diagram tries to show everything about transfers at once. The second answers one question: what happens to a transfer after it is accepted?
| Rule | Check |
|---|---|
| One idea per diagram | You can write its caption as one short sentence |
| Label the arrows | Each arrow says what moves or what is asked |
| A legend only if needed | If shapes or colours carry meaning, say what. Better: do not make them carry any |
| Same notation throughout | A box is always the same kind of thing, in every diagram of the doc |
| Readable at a glance | About 9 boxes at most, real names, no crossing lines |
Writing and review
Part 5 of 6 · sentences, readers, and getting to a decision
Eight writing rules, and bottom line up front
These eight fix most technical writing. Apply them when editing, not while drafting.
| Rule | Bad | Better |
|---|---|---|
| Lead with the conclusion | "We looked at several options over two weeks and..." | "We recommend option C. Reasons below." |
| One idea per paragraph | Problem, design and risk in one block | Three short paragraphs, each with a first sentence that states its point |
| Numbers over adjectives | "Significantly faster" | "p99 from 4.2 s to 150 ms" |
| Active voice | "The balance is updated." | "The worker updates the balance." |
| Define terms once | job, task, message, event for one thing | "A job is one queued transfer." Then only "job" |
| Short sentences | One 45-word sentence with three "which" | Three sentences, under 20 words each |
| Lists for parallel items | Five steps in one paragraph | A numbered list of five steps |
| Owner and date on open questions | "TBD: retention period" | "Retention, 14 or 90 days: Hemkesh Agrawani, 11 Nov" |
"Bottom line up front" is the first rule applied to a whole document: write in the order of the reader's attention, not the order you discovered things.
One change, three readers
The same change, written three times. Nothing is hidden from anyone: each reader gets the part they act on first.
| Reader | Asks | Give them |
|---|---|---|
| Executive | What changes for customers, what does it cost, how risky? | Outcome, cost, date, the worst case |
| Reviewer | Is it right, what is missing? | Design, numbers, alternatives, assumptions |
| On-call | How do I know it broke, how do I stop it? | Signals, thresholds, the switch, the runbook |
Asking for review
Say what kind of feedback you want, from whom, by when, and what happens after. "Please take a look" gets typo fixes or silence.
- Show a rough draft to one person early. A wrong direction is cheap to fix on day 2.
Reviewing someone's doc
Review the decision first and the wording last. Label each comment as blocking, a question, or a suggestion.
| Check | Ask |
|---|---|
| Is the problem real? | Who is hurt, how often, how do we know? |
| Are the numbers there? | Load, latency, cost, and where each came from |
| What is missing? | An alternative, a failure case, a reader (security, support, on-call) |
| What is the riskiest assumption? | What must be true for this to work, and has anyone tested it? |
| Can it be undone? | Where is the one-way door, and is it marked? |
Disagreement and the decision
A review ends with a decision by a named person, written in the doc. It does not need everyone to agree.
| Term | Means | Use for |
|---|---|---|
| Consensus | Everyone thinks this is the best option | Rare, slow. Team values, working agreements |
| Consent | Nobody has a blocking objection: "I can live with it" | Most design decisions |
| Disagree and commit | State the objection once, on record, then build the decision as if it were yours | After the approver has decided |
Everyday technical writing
Most of an engineer's writing is small. The same rule holds for all of it: the first line carries the point.
| Document | Must contain | Tiny example |
|---|---|---|
| Pull request description | What, why, how tested, how to roll back | "Adds Idempotency-Key to POST /transfers. Why: retries caused double debits. Tested: retry returns the same transfer. Rollback: revert, the column is nullable." |
| Commit message | Subject under 50 characters, imperative. Body says why | "Reject transfers with a reused key" then "A retry used to create a second transfer." |
| Incident update | Impact, status, next action, time of next update | "14:20. 1 in 50 transfers delayed about 2 minutes. No money lost. Adding workers. Next update 14:50." |
| Status report | On track or not, what changed, what you need | "Amber. Phase 2 slips 3 days: partner sandbox was down. Need: a sandbox contact." |
| Email asking for a decision | The decision, options, your pick, the deadline | "Decision needed by Thursday: keep dead-letter jobs 14 or 90 days? I recommend 14. Reply '14' or '90'." |
| README | What it is, how to run it, how to test it, who owns it | "Transfer workers. Run: make run. Test: make test. Owner: payments team." |
| API doc entry | Purpose, parameters, responses, errors, one example | "POST /transfers. 202 with id. 409 if the key was used with a different body. 422 if the balance is too low." |
| Runbook step | One action, the exact command, the expected result | "3. Set flag transfers.queued to off. Expect: queue depth falls to 0 within 5 minutes." |
Related: commit messages and pull requests are covered in full on Git in Depth.
Reference
Part 6 of 6 · failure modes, templates, interview answers
How design docs fail
Seven ways, and the fix for each.
| Failure | Fix |
|---|---|
| Solution before problem | Get the problem section agreed before drafting the design |
| No alternatives | "Do nothing", the cheap patch, and one option different in kind |
| No numbers | A requirements table: today and design-for |
| No rollout | Phases, exit conditions, rollback, the one-way door |
| Too long | 2 to 6 pages, the rest in an appendix. Summary first |
| Written after the fact | Share the problem and a rough draft before writing code. If it is already built, write an ADR instead |
| Never updated | A status line, an update when the design changes, "Implemented" with links at the end |
A design doc template
Copy it, answer each prompt, and delete any section that truly does not apply, saying why in one line.
An ADR template
One file per decision, numbered in order, in docs/adr/ of the repository it affects.
Interview questions
These are behavioural questions about influence. Answer with one real story and the document that carried it.
| Question | Shape of a good answer |
|---|---|
| How do you drive a technical decision across teams? | Agree the problem first, write options with numbers, name one approver and a date, record the decision where everyone can find it |
| When do you write a design doc, and when not? | By cost of being wrong: one-way doors and cross-team work get a doc, a reversible one-day change gets a pull request |
| Tell me about a design of yours that was challenged. | What the objection was, what you changed because of it, what the doc said afterwards |
| You disagree with the decision. What do you do? | State it once with evidence, get it recorded, then commit fully. Reopen only with new data |
| How do you handle a review that will not converge? | Move from comments to a short call, write both options side by side, let the approver decide |
| How do you explain a technical trade-off to a non-engineer? | Outcome, cost, risk, date. One number each, no mechanism |
| How do you keep documents from going stale? | A status line, ADRs that are superseded and never edited, docs next to the code, "update the doc" in the definition of done |
Related: how to talk through a design live, without a document, is on the Interview Playbook.
Cheat sheet
| When you need to | Do this |
|---|---|
| Decide whether to write a doc | Size, risk, reversibility: one-way doors always get one |
| Start a doc | The problem, with numbers and no solution, agreed first |
| Justify the choice | One alternatives table, columns from the goals, "do nothing" included |
| Ship safely | Phases, exit conditions, rollback, the one-way door marked |
| Keep one decision forever | An ADR: context, decision, status, consequences |
| Be read | Answer first, numbers over adjectives, written for the reader |
| Get a decision | Ask for specific feedback by a date, one approver, consent, then commit |
Back to Senior Skills.