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.
Your product ships a new release every quarter. How do you version and migrate your documentation, including guides and how-to pages, so readers on old releases are not misled?
Sample Answer
Direct answer
Treat each supported release as a frozen snapshot of the docs, keep one moving "latest" copy, and make every page announce which version it describes. Readers on old releases land on the docs that match what they run, and anything they might mistake for current carries a clear banner and points to the newer page. Version the reference and how-to pages by release, and keep conceptual overviews shared unless they truly diverge.
Structure
- Docs live in the same repository as the code (docs-as-code, meaning documentation stored and built like source code). Each release branch or tag has its own docs, so a doc fix can be back-ported (copied onto older supported versions) with the code fix. A release branch is a long-lived branch holding one released version so it can still get fixes; a tag is a permanent label on one commit.
- Publish a version selector and stable URLs. For example
/docs/latest/,/docs/3.2/,/docs/3.1/. Tools built for this include Docusaurus (itsdocs:versioncommand snapshots the current docs), mike for MkDocs (mike deploypublishes a version; MkDocs is a static site generator that turns Markdown into a website), and Read the Docs (a hosted service that builds docs from your branches and tags). The tool matters less than the rule. If you have no tool yet, Docusaurus is an easy start because versioning is built in; use mike if you already run MkDocs; Read the Docs suits open-source projects that want hosted builds. - Banners on old versions: "You are reading docs for 3.1. The latest version is 3.2." linking to the equivalent page if one exists.
- Search-engine hygiene. Point old versions' canonical link (the tag telling search engines which URL is the preferred copy) at the latest page, or mark them noindex (an instruction telling search engines not to list the page), so a search does not land people on outdated instructions.
- Support policy tied to docs. Fix errors in supported versions (say, the last two releases). Older versions are frozen, labelled archived, and not edited.
- Migration path. Each release ships an upgrade guide (what changed, what breaks, how to migrate) and a changelog (the dated list of changes per release). Pages whose behaviour changed link to it.
Which content gets versioned
| Content | Versioned per release? | Reason |
|---|---|---|
| API and CLI reference | Yes, generated from that release's code | Exactness matters |
| How-to guides that use specific features | Yes | Steps and screenshots change |
| Concepts and architecture overviews | Shared, with "since 3.0" notes | Rarely diverge |
| Tutorials | Latest only, tested each release | Cost of maintaining many |
Worked example
Release 3.2 renames the setting max_conn to pool_size. In the 3.2 docs the reference page documents pool_size, and the how-to says "Set pool_size". The 3.1 snapshot still says max_conn, with the banner. The upgrade guide has an entry: "3.2: max_conn is renamed pool_size; the old name works until 4.0 and logs a warning." A reader on 3.1 googles max_conn, arrives at the 3.1 page, sees the banner, and finds the migration note one click away. Without versioning, they would see 3.2 text and set a name their release ignores.
Trade-offs and pitfalls
- Copying the whole docs tree per release is simple but multiplies review work. Mitigate with a check that a fix to latest raises a "back-port?" prompt for supported versions.
- Conditional text ("in 3.1 only") on one page avoids duplication for small differences but gets unreadable past two or three variants. Snapshot when differences pile up.
- Broken links between versions are common; run a link checker (a tool that follows every link and reports ones that lead nowhere) per version in CI.
- What would change my call: for a hosted service with one live version, version only the API (by API version) and keep a dated changelog instead of full snapshots.
Write the first-run guide for a developer who needs to clone, set up, run and make a small change to a Node.js microservice locally. How do you make sure the guide still works six months from now?
Sample Answer
Direct answer
A first-run guide's job is to get a new developer from nothing to "I changed the code and saw the result" without asking anyone, so it reads as an ordered path with a visible checkpoint after each stage. To keep it true six months later I do not rely on people remembering to update it: I run the guide's own commands in automated checks and pin the versions it depends on.
The guide (illustrative service orders-service)
FIRST-RUN GUIDE: orders-service (about 20 minutes)
Last verified: <date>. Owner: orders team.
0. You need: Git, Docker, and nvm (a tool that switches Node.js versions).
1. Get the code
git clone git@github.com:acme/orders-service.git && cd orders-service
2. Use the pinned Node version (from the .nvmrc file)
nvm install && nvm use
Check: node --version -> matches the number in .nvmrc
3. Install dependencies exactly as locked
npm ci
Check: finishes without errors. (npm ci installs from package-lock.json only.)
4. Configure
cp .env.example .env (defaults work locally, no secrets needed)
5. Start the database
docker compose up -d --wait db
Check: docker compose ps -> db is "healthy" (--wait blocks until it is; without it,
step 6 can start before Postgres accepts connections and fail with connection refused)
6. Create tables
npm run migrate
7. Run the service
npm run dev
Check (new terminal): curl http://localhost:3000/health -> {"status":"ok"}
8. Make a small change
In src/routes/health.js add version: "local" to the JSON response.
The dev server restarts on save. Check: curl again -> now includes "version":"local".
9. Test and finish
npm test -> all tests pass. Update the test that checks the health body.
Create a branch and open a pull request (a request for teammates to review your change).
STUCK? Common failures: port 5432 busy (stop local Postgres), wrong Node version (redo step 2).
Keeping it true in six months
- Run the guide in CI (continuous integration, automated checks that run on every change): a job replays the automatable steps on a clean machine (steps 2 to 7 and 9: pinned Node, install, configure, database, tables, a health check of the running service, and the tests; step 8 is a human edit and stays manual) on every change to files the guide depends on, and weekly, so upstream drift is caught even when nobody edits the repo.
name: first-run-guide
on:
pull_request:
paths: ["docs/first-run.md", "package.json", "package-lock.json", "docker-compose.yml", ".env.example"]
schedule:
- cron: "0 6 * * 1"
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- run: npm ci
- run: cp .env.example .env
- run: docker compose up -d --wait db
- run: npm run migrate
- run: |
npm run dev &
curl --retry 10 --retry-connrefused --retry-delay 2 -fsS http://localhost:3000/health
- run: npm test
How to read it:
-
on: pull_requestwithpaths:means the job runs on a pull request only when one of those listed files changed. -
schedulewith cron"0 6 * * 1"means every Monday at 06:00 UTC (fields: minute 0, hour 6, any day, any month, day-of-week 1 = Monday). -
runs-on: ubuntu-latestpicks a fresh Linux machine;actions/checkout@v4copies the repository onto it. -
docker compose up -d --wait dbstarts the database container in the background and waits until its healthcheck reports healthy (the compose file must define ahealthcheck, for example one runningpg_isready), so the next command does not race Postgres start-up; Postgres is the database server itself..envis a local file of settings, andnpm run migrateruns scripts that create the tables. The lockfile (package-lock.json) records the exact dependency versions, which is whynpm cigives everyone the same install. -
The
npm run dev &line starts the service in the background andcurl --retrywaits for/healthto answer, so step 7 is protected too. -
Pin what can move:
.nvmrc, the lockfile, and a specific image tag for the database. -
One command per stage through
npm runscripts, so the guide references scripts and only the scripts change. -
Ownership at change time: a pull request template box "does this change the first-run steps?"
-
Newcomer feedback loop: the first task for each new hire is fixing whatever in the guide was wrong, plus a last-verified date in the file.
-
A weekly job that fails is only useful if someone owns the failure notification.
Same craft for a non-engineer
If a marketing manager needs BI (business intelligence) reports, the guide has the same bones but different content: what you can ask for (list of available reports), the request path (form or ticket link, the fields to fill, for example metric, date range, audience), what to expect (turnaround time, delivery format, who to contact) and a worked example of one filled-in request. No terminals, no jargon, one checkpoint: "you receive a link to a dashboard".
Pitfalls
- Steps that assume state (a running database, a token) nobody mentioned.
- A guide that duplicates the README and is updated in only one of them.
Your codebase has thin documentation and new hires take weeks to become productive. Propose a prioritised documentation plan for the first three months, including how you decide which documents to fix first and how you measure the effect.
Sample Answer
Direct answer
Do not try to document everything. Spend the first weeks finding the few documents that, if they existed, would remove the most repeated questions and the most days from a new hire's ramp-up, write those first, and measure onboarding time before and after. Plan in three months: discover and fix the top items (month 1), fill the core set with owners (month 2), and make upkeep routine and measured (month 3).
How to decide what to fix first
- Ask the people who just joined (the last three or four hires): where did you get stuck, what did you ask twice, which question did you answer for the next person? Their answers are better evidence than a guess.
- Mine repeated questions in the team chat channel and support threads, and note which systems get the most "how do I..." asks.
- Score each candidate by (how many people it blocks) times (how often) times (how painful when missing) divided by (effort to write). Write the highest scores first.
Worked example (rate people, frequency and pain 1 to 5, effort in days): setup README 5 x 3 x 5 = 75, divided by 2 days = 37.5; "how we ship" guide 3 x 4 x 5 = 60, divided by 3 = 20; architecture overview 4 x 3 x 4 = 48, divided by 5 = 9.6; a rarely used legacy billing-job page 1 x 1 x 5 = 5, divided by 4 = 1.25. Order: README, ship guide, architecture, billing page last. - Default first set for a codebase: a README that gets a laptop to a running app, an architecture overview, a "how we ship" guide, then service pages.
Three-month plan (with owners and check-ins)
| Period | Deliverables | Owner | Check-in |
|---|---|---|---|
| Days 1-30 | Interview 4 recent hires; rank the gaps; ship the setup README and "first-week checklist"; baseline measurement | Doc lead (the person driving this, possibly a new hire) | Weekly 15 minutes with the engineering manager |
| Days 31-60 | Architecture overview, service pages for the top services, runbooks for the top alerts; each doc gets a named owner | Each service's owning team | Bi-weekly review; demo to a fresh hire |
| Days 61-90 | Upkeep: PR template prompt, "last verified" dates, a quarterly review; retire dead pages; second measurement | Engineering manager | End-of-plan review of the metrics |
The 30/60/90 framing (goals for days 30, 60 and 90) also suits a new hire paying down doc debt (the pile of missing or stale documentation that builds up like unpaid bills): they are the ideal tester, because they discover the gaps as they hit them, and each fix is a visible deliverable.
Optional variant: if the newcomer joins an AI project, first two weeks (short checklist)
- A README that runs the project end to end.
- A model card (a short document stating what the model is for, how it was trained and evaluated, and its limits).
- A data schema (columns, meaning, source, freshness).
- An experiment reproducibility guide (which code, data snapshot, environment and seeds reproduce the baseline result).
The payoff is fewer interruptions for senior people and a faster first useful contribution.
Public versus internal split (optional, secondary to the core plan)
Internal docs (runbooks, architecture, incident history) are for engineers and can be blunt. Public engineering content (blog posts, API docs, talks) should reflect the real platform, so derive it from the internal source of truth and review it for accuracy, rather than writing a separate, prettier version that drifts. Example: the internal runbook says "restart with svcctl reload, then check the queue depth dashboard"; the public API guide keeps the same reload behavior and error codes but drops internal hostnames and the dashboard link. Each part gets its own owner and timeline, and its own metrics.
How to measure the effect
- Ramp time (how long until a new hire is productive): days from start date to first merged PR, and to first on-call shift (their first turn being the engineer who responds to alerts). Compare hires before and after.
- Questions to mentors counted for each new hire (or the fraction of onboarding questions answered by a link).
- Docs feedback: a simple "did this help" at the bottom of each page, and a survey of each new hire at week 4.
- Treat before/after comparisons with caution: hires differ in seniority, so compare like with like and report the count of hires.
Pitfalls
Writing many pages nobody needs; giving no owners, so they rot; and reporting page counts as success.
Design a README-driven development process for your team to improve documentation quality. How do you enforce updates in pull requests, and how do you avoid it becoming box-ticking?
Sample Answer
Direct answer
README-driven development means writing the README (the front-page document explaining what a project does and how to use it) before the code, as a lightweight spec: if you cannot explain the feature simply, the design is not ready. To keep docs current I would combine a CI (continuous integration, automatic PR checks) rule that ties code changes to docs changes, an executable README so wrong instructions fail a build, and human review that reads the docs diff against the code diff. To avoid box-ticking, every waiver (an explicit, recorded exception to the rule) needs a real reason, and a monthly audit checks the docs the way a new joiner would use them.
The process
- Design PR first. A new feature starts as a pull request (PR, a proposed change awaiting review) that changes only the README or a docs page: what it does, the command or API call, one example, and what it does not do. Reviewers argue about behaviour here, when changes are cheap.
- Implementation PR second. The code PR must keep that documented behaviour true, or change the docs in the same PR.
- Enforcement in the PR. The CI rule is the script below: it fails any PR that touches public code without touching the docs, unless the author supplies a reason.
- Executable README. CI extracts the quickstart commands from the README and runs them in a clean container (a fresh, disposable environment with nothing left over from earlier runs, so hidden setup cannot make broken instructions look like they work). If the instructions stop working, the build breaks.
Enforcement script (tested in a scratch repo)
#!/usr/bin/env bash
# Fail a pull request that changes public code without touching docs, unless the PR says why not.
# Usage: check_docs.sh <base-ref> [skip-reason]
set -euo pipefail
base="$1"; reason="${2:-}"
changed=$(git diff --name-only "$base"...HEAD)
code=$(echo "$changed" | grep -E '^src/' || true)
docs=$(echo "$changed" | grep -E '^(README\.md|docs/)' || true)
if [ -n "$code" ] && [ -z "$docs" ]; then
if [ ${#reason} -ge 15 ]; then echo "docs skipped, reason: $reason"; exit 0; fi
echo "src/ changed but no README/docs change. Update docs or give a real reason (15+ chars)."; exit 1
fi
echo "docs check passed"
Running it against a PR that changes src/cli.py only:
$ ./check_docs.sh main
src/ changed but no README/docs change. Update docs or give a real reason (15+ chars).
$ ./check_docs.sh main "n/a"
src/ changed but no README/docs change. Update docs or give a real reason (15+ chars).
$ ./check_docs.sh main "internal refactor, no behaviour change"
docs skipped, reason: internal refactor, no behaviour change
After a commit that adds a README section, the same command prints docs check passed.
Reading the script line by line
set -euo pipefail: stop at the first error (-e), treat an unset variable as an error (-u), and fail a pipeline if any part of it fails (pipefail).reason="${2:-}": the second argument, or an empty string if none was given.git diff --name-only "$base"...HEAD: list the names of files changed on this branch since it split frombase. The three dots compare against the common ancestor, so commits made onmainafter you branched do not show up.grep -E '^src/'keeps only lines that start withsrc/(-Eenables extended regular expressions).|| trueis needed becausegrepexits with status 1 when nothing matches, which underset -ewould kill the script.${#reason} -ge 15: the reason's length is at least 15 characters.
Be honest about that last check: it only stops lazy waivers such as n/a. internal refactor, no behaviour change passes it, as the trace shows, whether or not it is true. The length rule is a speed bump; the real defence is a reviewer reading the reason and the team watching the waiver rate.
Worked example
The team adds a --retries flag to a command-line tool. PR 1 adds a "Retries" section to the README: default of 3, one example command, and a note that retries apply only to network errors. Reviewers say "network errors only is surprising, should timeouts count?" and the answer is settled before any code exists. PR 2 implements it, and CI runs the README example command.
Avoiding box-ticking
- The waiver needs a reason of substance, and the reviewer must agree with it. A repeated "n/a" gets discussed, not waved through.
- Reviewers are told to check the docs diff against the code diff, not just that a docs diff exists.
- Monthly fresh-eyes audit: pick five merged PRs, and someone who has not seen the feature follows the README cold. Every place they get stuck becomes a fix.
- Watch the waiver rate. If 60 percent of PRs use it, the rule is wrongly aimed (too broad a path filter, meaning the rule that decides which changed paths must come with docs) or being gamed. Tighten the paths to public interfaces only.
Trade-offs and pitfalls
- Path rules only detect that a docs file changed, not that it is right. That gap is why the executable README and human review matter.
- README-first can be slow for tiny changes. Limit the design-PR step to user-visible behaviour, and let internal refactors skip it with a stated reason.
- Executable docs need a clean environment. Flaky setup steps (ones that pass on some runs and fail on others) will train people to ignore red builds.
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).
Unlock Full Question Bank
Get access to all 40 Technical Writing and Documentation interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.