Technical Writing and Documentation Questions
The craft of producing durable, reference-quality written artifacts and keeping them accurate: READMEs and quick-start guides, design docs, RFCs and technical proposals, runbooks and deployment guides, model cards, datasheets and data dictionaries, bug reports and reproducible examples, postmortem write-ups, handoff documents, pull request descriptions, code comments, release notes, experiment reports, and knowledge-base articles. Covers structure and information design, writing for a specific audience and for future readers (including plain language and accessibility), templates and style standards, docs-as-code workflows with CI checks, testing of examples and snippets, documentation review and quality checks, versioning and freshness checks on the documents you own, keeping sensitive data out of docs, and measuring whether documentation works. Architecture decision records, API reference docs, PRDs and PR/FAQs, and live presentations are covered elsewhere.
Create the checklist an author works through before marking an engineering document 'final' or 'production-ready'. Which items are hard gates rather than advice, and who signs off on each?
Sample Answer
Direct answer. Before an engineering document (a design doc, runbook or API guide) is marked "final", I run a short checklist and split it into hard gates (the document cannot be marked final while any fail, and a named person signs off) and advice (good practice, author's judgement).
Terms. A design doc explains how something will be built and why. A runbook is step-by-step instructions for handling a task or alert. A changelog is a dated list of what changed. A staging host is a practice copy of production where steps can be tried safely. An architecture board is the group that approves significant technical designs. Internal-only hostnames are server names that only resolve inside the company network and reveal how it is laid out.
Hard gates, with sign-off
| Gate | What "pass" means | Who signs off |
|---|---|---|
| Accuracy | Every command, diagram and number tested or checked against the real system | A technical reviewer who did not write it |
| Owner and review date | Named owner, version, next review date | The owning team lead |
| Audience and purpose stated | First paragraph says who it is for and what to do with it | Reviewer (reads only that paragraph) |
| Security and privacy | No secrets, credentials, customer data or internal-only hostnames in a public doc | Security reviewer, for anything external |
| Actionable steps verified | For a runbook, someone else ran it end to end on a clean environment | The on-call engineer or team who will use it |
| Approvals recorded | Required stakeholders (for example, architecture board or legal for a public doc) approved | The approver themselves, recorded in the doc |
| Findable | Published in the agreed location, linked from the index or README | Author |
Advice (not gates)
- Consistent terminology, and acronyms defined on first use.
- Diagrams have text alternatives and readable labels.
- Length trimmed, headings scannable, examples included.
- Changelog entry describing what changed.
Worked example. A runbook for a failing job: the author lists "restart the worker with systemctl restart worker". The reviewer runs it on a staging host and finds it needs sudo. That is an accuracy gate finding, so the document stays "draft" until fixed and re-tested, but the missing changelog line is only advice and does not block.
Worked example: the security and approval gates. The security reviewer runs a scan over the public draft for credentials and internal hostnames. On a draft runbook containing SSH to db01.corp.internal and export API_KEY=AKIAABCDEFGHIJKLMNOP (AKIA-prefixed strings look like cloud access key IDs), this command:
grep -nEi "AKIA[0-9A-Z]{16}|password|\.corp\.internal|(^|[^0-9])10\.[0-9]+\.[0-9]+\.[0-9]+" runbook.md
prints lines 2 and 3 and exits 0. The draft runbook.md is three lines: line 1 # Runbook: database failover, line 2 SSH to db01.corp.internal, line 3 export API_KEY=AKIAABCDEFGHIJKLMNOP; the fixed draft keeps line 1 and has SSH to <db-host> and export API_KEY=<from secrets manager> on lines 2 and 3. The first match means the gate fails. After the author replaces them with <db-host> and <from secrets manager>, the same command prints nothing and exits 1 (no match, gate passes). I ran both. The scan catches only patterns you thought of, so the reviewer still reads the doc. For the approvals gate, a public doc is not final until the document carries a line such as Approved: <name>, architecture board, 2026-09-14 (link to ticket), written by the approver, which is what makes a signature traceable later.
Why split it this way. If everything is a gate, people rubber-stamp; if nothing is, "final" means nothing. Gates are the items where being wrong causes harm (a broken procedure at 3am, a leaked secret).
You need to adapt an internal architecture document for publication on a customer-facing knowledge base. What do you remove, what do you add for the customer, and how do you restructure it?
Sample Answer
Direct answer
I would not redact the internal document in place. I would write a separate, customer-oriented version from it: remove anything internal, sensitive or uncommitted, add what a customer needs to make decisions and act safely, and restructure from the way we built it to the way they use it. Then security, legal and support review before publishing.
What I remove
- Internal identifiers: hostnames, account and project IDs, internal tool and team names, ticket links.
- Security-sensitive detail: network layout, credential handling, unpatched weaknesses, anything that helps an attacker.
- Unreleased plans, roadmap hints and cost or margin information.
- Internal debate and blame ("we chose X because team Y could not deliver Z"), TODOs and stale sections.
- Commitments the company has not agreed to make. If it is not in a contract or service-level agreement (SLA, a formal promise such as availability), do not imply it.
What I add
- Who this is for and what problem it solves, in the customer's vocabulary, with a short glossary.
- Prerequisites, supported configurations and clear limits (quotas, regions, unsupported cases).
- A responsibility split: what we operate versus what the customer owns.
- Simplified diagrams, worked steps for common tasks, troubleshooting, and where to get support.
- Version and "last reviewed" date, so readers can judge currency.
How I restructure
Internal architecture documents follow history: context, alternatives, decision, rollout. Customers follow tasks: overview, key concepts, how it works (at the level that affects them), what you configure, limits and behaviour on failure, FAQ, contact.
Worked example
Internal: "Requests hit gateway gw-prod-eu-2, which forwards to the billing service, whose Postgres cluster fails over in about a minute (see incident 4471)." Customer version: "Requests are served from the region you select. If a component fails, the service recovers automatically. During recovery, write requests may return errors, so retry with backoff (a wait that grows between attempts). Availability commitments are in your agreement." The hostname, incident reference and the unverified failover time are gone; the actionable retry advice is added.
Trade-offs and pitfalls
Redaction leaks. A find-and-replace pass misses names hidden in diagrams and comments, so build the public version from scratch. Two versions cost maintenance, so name the internal owner and update the public page when the architecture changes. Only be candid about limits you can honour.
Design the pull-request checks for a repository of SRE runbooks: dead links, required front-matter keys and Markdown linting. Which tools would you use, how do failures surface, and how do you let an emergency runbook fix through during an incident without gutting the checks?
Sample Answer
Direct answer
Treat the runbook repository like code: every pull request (PR, a proposed change awaiting review) runs three automated checks in continuous integration (CI, the robot that runs on each PR). A link checker (lychee) catches dead links, a small script validates required front matter (the YAML metadata block at the top of each file, such as owner and last-reviewed date), and markdownlint-cli2 enforces Markdown style. Failures show up as inline annotations on the PR and as a red required check. For emergencies, an on-call engineer adds an emergency-fix label. That label makes only the checks that are cosmetic (lint) or depend on outside websites (external links) non-blocking, keeps the check that protects accountability (front matter) blocking, and automatically opens a follow-up issue so the debt is paid rather than forgotten.
Terms in plain words
- GitHub Actions: GitHub's built-in automation. A YAML file in
.github/workflows/tells GitHub what commands to run on each PR. - Required status check / branch protection: branch protection is a repository setting on the main branch. Marking a check as "required" there means GitHub refuses to merge a PR until that check is green.
- Triage rights: a GitHub permission level. Only people with at least that level (or higher) on the repository can add or remove labels, so the label cannot be applied by a random outsider.
- Inline annotation: an error message drawn on the exact file and line in the PR's Files tab.
continue-on-error: a step setting that lets the step fail without turning the whole job red.
Tools and what each one guards
| Check | Tool | Why this one |
|---|---|---|
| Dead links | lychee (a fast link checker that reads Markdown directly, with retries and caching) | Broken links to dashboards and other runbooks are the most common way a runbook fails someone at 3 a.m. |
| Required front matter | ~30-line Python script with PyYAML (a Python library that reads YAML) | Rules are specific to your team (owner, service, last_reviewed), so a small script beats a generic tool |
| Markdown style | markdownlint-cli2 (a linter: it flags style problems such as skipped heading levels or trailing spaces) | Consistent headings and numbered lists make steps skimmable under stress |
The workflow (GitHub Actions syntax, parsed as valid YAML)
name: runbook-checks
on:
pull_request:
types: [opened, synchronize, reopened, labeled] # 'labeled' re-runs checks when the emergency label is added
# No `paths:` filter on purpose: a required check that is skipped by path filtering stays "Pending" and blocks the PR
schedule:
- cron: "0 6 * * 1" # weekly full link crawl catches link rot nobody's PR touched
permissions: { contents: read, issues: write, pull-requests: read }
jobs:
docs-checks: # the ONE job name set as a required status check
runs-on: ubuntu-latest
env:
EMERGENCY: ${{ contains(github.event.pull_request.labels.*.name, 'emergency-fix') }}
steps:
- uses: actions/checkout@v4
- name: Front matter (always blocking, because no owner means nobody is accountable)
run: pip install pyyaml==6.0.3 && python scripts/check_front_matter.py $(git ls-files 'runbooks/*.md')
- name: Markdown lint
continue-on-error: ${{ env.EMERGENCY == 'true' }}
run: npx --yes markdownlint-cli2@0.23.3 "runbooks/**/*.md"
- name: Links
continue-on-error: ${{ env.EMERGENCY == 'true' }}
uses: lycheeverse/lychee-action@v2
with:
args: --no-progress --max-retries 2 --accept 200,429 "runbooks/**/*.md"
fail: true
- name: Open follow-up issue when the emergency path was used
if: env.EMERGENCY == 'true'
env: { GH_TOKEN: "${{ github.token }}" }
run: gh issue create --title "Post-incident doc cleanup for PR ${{ github.event.pull_request.number }}" --label docs-debt --body "Lint and link checks were non-blocking on this PR. Re-run and fix within 2 business days."
Reading the workflow step by step
- The workflow starts when a PR is opened, updated, reopened or labeled, on every PR (there is deliberately no
paths:filter, see the pitfalls). A weekly schedule also runs it. permissionsgives the job read access to the code and write access to issues, so it can open the follow-up ticket, and nothing more.EMERGENCYistrueonly when the PR carries the labelemergency-fix(thecontains(...)expression asks "is that name in the PR's label list?").- Front matter always runs and always blocks: if it fails, the job is red.
- Lint and links have
continue-on-errorset to that flag: normally a failure turns the job red, but on an emergency PR the failure is still printed and the job stays green. - The last step runs only when the flag is
trueand files the cleanup issue.
The front-matter check, run for real
import os, sys, pathlib, tempfile
import yaml
REQUIRED = ["title", "owner", "service", "last_reviewed"]
def check(path, text):
"""Return a list of problems for one runbook."""
text = text.replace("\r\n", "\n") # files saved on Windows use CRLF line endings
if not text.startswith("---\n"):
return ["no front matter block"]
end = text.find("\n---", 4)
if end == -1:
return ["front matter block is never closed"]
try:
meta = yaml.safe_load(text[4:end]) or {}
except yaml.YAMLError as e:
return [f"front matter is not valid YAML: {e.__class__.__name__}"]
if not isinstance(meta, dict):
return ["front matter is not a set of key: value pairs"]
# a key that is present but empty (`owner:`) is as useless as a missing one
return [f"missing key: {k}" for k in REQUIRED if meta.get(k) in (None, "")]
def main(paths):
failures = 0
for p in paths:
for problem in check(p, pathlib.Path(p).read_text()):
print(f"::error file={p}::{problem}")
failures += 1
return 1 if failures else 0
if __name__ == "__main__":
if len(sys.argv) > 1:
sys.exit(main(sys.argv[1:]))
with tempfile.TemporaryDirectory() as d:
os.chdir(d)
good = pathlib.Path("db-failover.md")
good.write_text("---\ntitle: DB failover\nowner: team-data\nservice: orders-db\nlast_reviewed: 2026-01-05\n---\n# Steps\n")
bad = pathlib.Path("cache-flush.md")
bad.write_text("---\ntitle: Cache flush\nservice: edge-cache\n---\n# Steps\n")
empty = pathlib.Path("dns-cutover.md")
empty.write_text("---\ntitle: DNS cutover\nowner:\nservice: dns\nlast_reviewed: 2026-02-01\n---\n# Steps\n")
crlf = pathlib.Path("vpn-reset.md")
crlf.write_bytes(b"---\r\ntitle: VPN reset\r\nowner: team-net\r\nservice: vpn\r\nlast_reviewed: 2026-03-01\r\n---\r\n# Steps\r\n")
code = main([str(good), str(bad), str(empty), str(crlf)])
print("exit code:", code)
Running it prints:
::error file=cache-flush.md::missing key: owner
::error file=cache-flush.md::missing key: last_reviewed
::error file=dns-cutover.md::missing key: owner
exit code: 1
The third file has owner: with nothing after it, which YAML reads as null. A plain k not in meta test would let it pass, defeating the rule that "no owner means nobody is accountable", so the check tests for an empty value too. The fourth file (Windows line endings) passes because the script normalises \r\n first.
The ::error file=...:: format is what makes GitHub draw the message on the exact file in the PR's Files tab, so the author does not have to open CI logs.
How failures surface
- One job name (
docs-checks) is marked as a required status check in branch protection, so a red result blocks merge. - Each tool writes file-level annotations, so the fix is visible where the author is already looking.
- Link checks accept HTTP 429 (rate limited) and retry twice, because a flaky third-party site should not fail the PR.
- The weekly scheduled run crawls everything, because links rot even when nobody edits the runbook.
Emergency path without gutting the checks
- Only people with triage rights can apply the label. GitHub itself enforces this (the workflow does not need to), so it is not a self-service bypass for anyone.
- Front matter stays blocking: it is local and takes seconds, but the real reason is that an emergency runbook with no owner or review date is the one nobody will fix later, which is worse than a lint warning.
- Lint and external links become non-blocking (
continue-on-error). Lint findings are cosmetic and cannot mislead a reader, and link checks depend on third-party sites that may be down or rate-limiting during the same incident, so a red result there does not mean the runbook is wrong. Lint is not slow; the point is that a style complaint should never delay a fix. - The bypass is not a branch-protection override or a disabled workflow. The checks still run and still report, so the author sees exactly what to clean up.
- The last step files a
docs-debtissue with a two-business-day target, and a weekly report counts how many emergency labels were used. A rising count is a signal to fix the checks or the on-call process.
Worked example
At 02:10 on-call needs to change step 3 of a failover runbook. They open a PR, add emergency-fix, and a teammate approves. Front matter passes, lint fails on a trailing-space rule and is shown but non-blocking, and the merge happens in minutes. The follow-up issue lands in the team queue the same night, and the author fixes the lint error next morning.
Trade-offs and pitfalls
- Making every check non-blocking during emergencies is tempting but teaches people to always use the label. Keep the blocking set as small as the cheapest useful checks.
- Do not run link checks against private internal URLs without an allowlist or auth, or every PR fails. Exclude those patterns explicitly and verify them another way.
- Pin the action and tool versions so a tool upgrade does not turn every PR red on the same morning.
- A required check whose workflow is skipped by a
paths:filter stays "Pending" forever (GitHub documents this), so a PR touching only a README would be unmergeable. Either drop the filter, as above, or add a tiny always-running job that reports the same check name. gh issue create --label docs-debtfails if that label does not exist, which would turn the emergency path red. Create the label once up front, and remember each new push to an emergency PR re-runs the step, so de-duplicate (for example search for an open issue with that title first).- The workflow file itself is part of the PR, so an author could edit it to weaken the checks. Put
.github/workflows/under CODEOWNERS with "Require review from Code Owners" enabled. - If the label is used often, the real problem is that the checks are too slow or too strict for normal work.
You need to write a design document for a feature that spans three teams. How would you structure it, who do you involve before and while you write it, and what keeps it useful after the work ships?
Sample Answer
Direct answer
I would write a design document (also called an RFC, request for comments, a proposal circulated for review) built around problem, goals and non-goals, proposal, cross-team contracts, alternatives, rollout and open questions. I would involve one technical lead per team before writing and name a decision owner, then review in the open while writing. To keep it useful after shipping, I update it to "as built", link the decisions to ADRs (short decision records) and give it an owner.
Structure
- Header: authors, reviewers per team, status (draft, in review, accepted, shipped), decision owner and date.
- Context and problem: what hurts today and for whom.
- Goals and non-goals: non-goals prevent three teams from each assuming the others will cover something.
- Proposal: the design at the level reviewers need, with one diagram.
- Contracts between teams: the interface (API or event shape), who owns each side, and who is on call for it. In a three-team feature this is the most valuable section.
- Alternatives considered: each with why it was rejected.
- Risks, rollout and rollback: sequencing across teams, what can be launched dark (hidden behind a flag), how to undo.
- Open questions: each with an owner and due date.
Who I involve and when
- Before writing: a 30-minute conversation with each team's tech lead and product counterpart, then a one-page problem statement they all agree to. Disagreement on the problem is cheaper to find here than in review of a forty-page design.
- While writing: a shared draft with dated comments, a named reviewer per team, and one live review meeting for the hard contract questions. Decisions and their owner are recorded in the document, not in chat.
- A decision method such as DACI (driver, approver, contributors, informed) so one person can close the review.
Worked example
Feature: unified notification preferences across the web app, mobile API and data platform. Goal: one place where a user's choices are stored. Non-goal: redesigning the notification content. Contract: the preference service owns storage; mobile and data teams read through a versioned read API; data receives change events. Open question: what happens for users with conflicting older settings? Owner: mobile lead, due before review two.
After shipping
Change status to shipped, edit the design to match what was actually built, and note the differences. Link ADRs for major decisions, add the owner and a review date, and point the README and runbook (the step-by-step guide for operating the system) to it. A design document that describes intentions rather than the built system misleads the next reader.
Pitfalls
Designing alone then presenting; skipping non-goals; writing the doc for approval rather than for the team that must maintain it.
Have you worked with a docs-as-code workflow? Explain what it is, how a team would adopt it, and the main benefit and main cost you have seen.
Sample Answer
Direct answer
Docs-as-code means treating documentation the way a team treats source code: plain-text files (usually Markdown) stored in Git next to the code, changed through pull requests (proposed changes that a teammate reviews before they merge), checked by automated tests in CI (continuous integration), and built into a website on every merge. If you have not used it, say so plainly and describe how you would pilot it; the shape of the answer below works either way.
What it looks like
payments-service/
src/retry.py
docs/
index.md
runbook-timeouts.md # a runbook: step-by-step guide an on-call engineer follows when something breaks
mkdocs.yml # site config for a static site generator
A change to the retry behaviour is one pull request containing the code in src/retry.py and the edit to docs/runbook-timeouts.md. The reviewer sees both together, and the merge publishes the site.
How a team adopts it
- Pilot with one repository and one team, not the whole company.
- Pick a static site generator (a tool that turns Markdown files into a website, for example MkDocs or Docusaurus) and publish from the main branch.
- Add cheap automatic checks first: Markdown lint (a tool that flags formatting mistakes such as a skipped heading level), a link checker (a tool that follows every link and reports ones that lead nowhere), and a build that fails on errors. A failed link check prints something like this (illustrative):
docs/index.md:12: broken link 'runbook-timeout.md' (file not found; did you mean runbook-timeouts.md?)
- Change the habit: add a line to the pull request template (the pre-filled text every new pull request starts with), such as "Docs updated, or not needed because ...". A filled-in line reads "Docs updated: docs/runbook-timeouts.md" or "Docs not needed because: internal refactor, no behaviour change". Also name a docs owner (the person responsible for the accuracy of a folder, often recorded in a CODEOWNERS file) for each folder.
- Move only the pages people use, starting with the runbooks and the quick start (the short getting-started page a new user follows first). Leave the archive where it is.
- Lower the barrier for non-Git users: an "edit this page" link on every page, so a product manager or support engineer can fix a typo in the browser.
Main benefit
Docs change in the same pull request as the behaviour they describe, so they are reviewed, versioned and released together. A reader can also look at the docs as they were at any past release. That is what keeps them from going stale silently.
Main cost
Contributors who do not live in Git face friction. Support staff, product managers and analysts either stop editing or file requests that engineers turn into pull requests, which recreates the bottleneck. The mitigations are the in-browser edit link, a light-touch review rule for docs-only changes, and a tool that shows a live preview. A second, smaller cost is upkeep of the pipeline itself: someone owns the build and the link checker, and broken builds must be fixed quickly or people will start ignoring them.
Pitfalls
- Moving everything and fixing nothing: a migrated pile of stale pages is still a pile of stale pages. Delete before you migrate.
- Making the checks noisy: a flaky link check (one that fails on some runs and passes on others for reasons unrelated to your change, such as a third-party site being briefly down) trains people to click past failures. Block on internal links and build errors, and treat external links as advisory.
- No owner: docs in the repository still rot if nobody is responsible for a folder.
Unlock Full Question Bank
Get access to all Technical Writing and Documentation interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.