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.
A newly trained model is going into production. How do a model card, the repository README and an API specification differ in purpose and reader, and which one does each question a stakeholder might ask belong in?
Sample Answer
Direct answer
They answer different questions for different readers. The model card explains what the model is for and how far to trust it (readers: product owners, risk, regulators, reviewers). The README (the front page of the code repository) explains how to build, run and change the project (readers: engineers who work on it). The API specification (a machine-readable contract such as OpenAPI, a standard format for describing HTTP endpoints) defines exactly how another system calls the model (readers: engineers integrating with it).
Terms used below: a schema is the agreed list of fields and their types; a datasheet is the equivalent document for a dataset (where it came from, how it was collected); drift means the model's live behaviour or input data slowly moving away from what it was tested on; integration tests are automated tests that call the real service the way another system would; an on-call engineer is the person currently responsible for responding when the service breaks. An HTTP 422 response ("Unprocessable Content") means the request was well formed but failed the service's validation rules, for example an empty text field.
Comparison
| Model card | README | API spec | |
|---|---|---|---|
| Purpose | Behaviour, evidence, limits | Working with the code | Exact call contract |
| Main reader | Product owner, risk, regulator | Maintainer, new contributor | Client developer, integration tests |
| Changes when | Model or data changes | Setup or process changes | Endpoints or schemas change |
| Format | Prose, tables, numbers | Markdown with commands | OpenAPI YAML/JSON, ideally validated |
Where each stakeholder question belongs
| Question | Belongs in | Why |
|---|---|---|
| Is it safe to use for loan decisions? | Model card | Intended and out-of-scope use |
| How accurate is it for group X? | Model card | Evaluation and fairness sections |
| How do I retrain it locally? | README | Build and run steps |
| Which Python version and dependencies? | README | Development environment |
| What fields does a request need, and what does a 422 error mean? | API spec | Contract for callers |
| What is the maximum input size? | API spec | Schema limit (the card may mention why) |
| Who do I contact when it misbehaves? | Model card, linked from README | Ownership |
| How was training data collected? | Model card, pointing to the dataset's datasheet | Provenance |
| Has performance drifted this month? | Monitoring dashboard, linked from the card | Live data goes stale in a document |
Worked example
A product owner asks, "Will it work on Spanish text?" That is a model-card question: the card's data section should say whether Spanish was in training and the evaluated accuracy. An engineer asks, "What does the endpoint return for empty text?" That is the API spec: a response schema and an example. Putting either answer in the wrong file means the right reader never finds it.
What each looks like in practice (illustrative). A single model-card line for the product owner:
Languages: trained on English and Spanish. Accuracy is reported separately per language in the evaluation table. Other languages are out of scope.
And an API-spec fragment (OpenAPI, written in YAML, a plain-text key: value format) for the empty-text case:
paths:
/classify:
post:
requestBody:
content:
application/json:
schema:
type: object
required: [text]
properties:
text: {type: string, minLength: 1, maxLength: 5000}
responses:
"200": {description: Label and score}
"422": {description: "Validation failed, for example empty text"}
The card says what to trust; the spec says exactly which request is accepted (a text of 1 to 5,000 characters) and what comes back when it is not.
Pitfalls
- Cramming everything into the README so the model card is skipped.
- Repeating numbers in three places; they diverge. Keep each fact in one place and link to it.
- Treating the API spec as documentation of model quality; it documents shape, not correctness.
Design a one-page postmortem template that works for both engineering readers and business stakeholders. Then fill in a short example for an outage that affected ten percent of users for three hours.
Sample Answer
Direct answer. A one-page postmortem answers, in plain order: what happened and how bad, why it happened, how we responded, and what we will change. A top block written for business readers (impact, duration, cause in one sentence, status) sits above an engineering block (timeline, root cause, contributing factors, action items). It is blameless: it describes systems and decisions, not individuals.
Template
TITLE / date / severity (how bad it was, on a scale such as SEV1 total outage to SEV3 minor) / author / status (draft, reviewed, closed)
SUMMARY (business readers): impact, duration, one-sentence cause, customer action needed
IMPACT: who, how many, what they experienced, measured how (include uncertainty)
TIMELINE (UTC): detection, escalation, mitigation, resolution
ROOT CAUSE and CONTRIBUTING FACTORS: technical cause, why it was not caught earlier
WHAT WENT WELL / WHAT WENT POORLY / WHERE WE GOT LUCKY
ACTION ITEMS: owner, due date, priority, how we will verify it worked
Example: an outage that affected ten percent of users for three hours (illustrative details)
Summary. On 14 March, 10% of users could not complete checkout for 3 hours (10:05 to 13:05 UTC). Cause: a configuration change reduced the connection limit (the cap on simultaneous connections the application may open to the database, also called pool size) on one of the ten database shards (the database is split into ten slices, each holding a share of users). Fixed by reverting the change. No data was lost. Affected customers were offered a retry link.
Impact. Users are assigned to shards by ID, so one shard of ten means about 10% of users. If we had 400,000 daily active users, that is roughly 40,000 users with failed checkouts; the estimate rests on the assumption that shard membership is even, and we checked actual failed-request counts in logs to confirm the range.
Timeline (UTC).
- 09:58 config change deployed to shard 7.
- 10:05 error rate on shard 7 rises; no alert fires (the alert threshold, the error level that triggers a page, covers the global rate only).
- 10:40 support tickets spike; the on-call engineer (whoever is currently responsible for responding to problems) is paged by support, not by monitoring.
- 11:20 root cause identified; 12:50 revert approved; 13:05 recovery confirmed.
Root cause and contributing factors. The root cause is the single change without which the outage would not have happened; contributing factors are conditions that let it last or go unnoticed. The change set the pool size too low for the traffic on that shard: the new limit was below what the shard needs even off-peak, and the old value had been sized for peak. Contributing: the global error-rate alert averages ten shards, so a 10% failure looks like noise; no canary (staged rollout to a small share first); the change review did not include capacity numbers.
What went well/poorly/luck. Well: once the revert was approved at 12:50, recovery was confirmed 15 minutes later. Poorly, three delays: 35 minutes from first errors (10:05) to the first page (10:40); 40 minutes from the page to an identified root cause (11:20), which is 75 minutes after the errors began; and 90 minutes from root cause to an approved revert (11:20 to 12:50). The approval delay is the biggest single lesson, since it was the longest wait and the fix was already known. Luck: it happened off-peak; at peak the same 10% of users would have seen failures on a larger share of their requests, and the pool would have been exhausted sooner.
Action items.
| Action | Owner | Due | Verified by |
|---|---|---|---|
| Per-shard error-rate alert | SRE | 2 weeks | Fire drill (a practice run that injects fake errors on purpose to see the alert fire) |
| Canary rollout for config changes | Platform | 6 weeks | Next change goes through canary |
| Capacity check in config review template | Engineering manager | 1 week | Template updated |
| On-call may revert a config change immediately, without waiting for approval | Engineering manager | 3 weeks | Written policy, then a timed revert drill |
Variants (same skeleton, different emphasis). Data-quality incident: replace "users affected" with which tables, which dashboards, and which decisions used bad numbers, and add a backfill plan. ML outage or recurring degradation: the impact includes a metric with a range ("precision fell 3 to 5 points, estimated from a labeled sample of 400 predictions"), the timeline includes feature snapshots and drift checks before and after, and the root-cause section separates data drift (inputs changed) from a code or pipeline change. The five-section short form is: what happened, impact, why, what we did, what changes, each opened with one sample sentence like "For 3 hours, 1 in 10 users could not check out."
You own a model or pipeline that a new engineer will inherit next month. How would you structure its documentation so data scientists, software engineers and product owners can each find what they need quickly, and what would you check before calling it handover-ready?
Sample Answer
Direct answer
I would build a "start here" page that routes each audience to their own path, organise the body around a takeover outline, meaning the standard section list a successor needs (overview, product context, training data and preprocessing, evaluation, operations, known issues), and call it handover-ready only after a cold-read test: the new engineer performs real tasks using nothing but the documents.
Structure
- Start here (half a page): what the model does in two sentences, who owns what, and three links: "I am a data scientist", "I am a software engineer", "I am a product owner".
- Overview and product context: the user problem, who consumes predictions, what a wrong prediction costs. Product owners stop reading here and should have what they need.
- Training data and preprocessing: sources, time window, filters, feature list, known biases, and how to regenerate the training set. Data scientists start here.
- Evaluation: metrics, the held-out set (examples kept aside from training so the score is honest), the current result, and what would count as a regression (a score drop compared with the current result).
- Operations: how it is deployed, how to retrain, monitoring and alerts, on-call actions. Software engineers start here.
- Known issues and decisions: open bugs with workarounds, past decisions and why, things I would fix given time.
Handover-ready checks
- Cold-read test: on a clean machine, the newcomer retrains on a small sample, finds the latest evaluation result, and responds to a mock alert (a practice alert fired on purpose), without asking me. Each question they do ask becomes a document fix.
- Access and ownership: repositories, data, dashboards, secrets managers and on-call rotation are granted and listed by name.
- Truth check: every command and link in the docs has been run or clicked this week.
- Product owner check: the owner can say, from the page alone, when the model should not be used.
- Live handover: a shadow period (the newcomer watches me work in week 2, then I watch them in week 3) and a paired first change, since some knowledge (why the decision threshold is 0.7: the model outputs a score from 0 to 1, and it flags a case only at or above the threshold, chosen by trading false alarms against misses) only surfaces in conversation. Capture it afterwards.
Worked example
With a month, week 1: draft and cold-read by a colleague who does not know the project. Week 2: fix gaps, add known issues, and run the first half of the shadow period, where the newcomer watches me retrain and handle a mock alert. Week 3: the new engineer does the retrain and alert exercises while I watch and answer only when they are truly blocked, logging every question I am asked. Week 4: paired change and release. Anything I still had to answer verbally in week 3 goes into the docs before I call it done.
What the pages might say (illustrative). Start here: "This model scores loan applications for fraud risk. Owner: risk-data team. Data scientists start at Training data; engineers at Operations; product owners read Overview and stop." Known-issues entry: "Scores drift after holiday periods. Workaround: retrain from the January snapshot. Not fixed because the retrain job needs a separate budget line."
Pitfalls
Documenting only the happy path, forgetting access rights, and ending with a document nobody has actually followed.
Outline a technical blog post that teaches peers about a model architecture you implemented. How do you choose what to include and what to link to instead?
Sample Answer
Direct answer. I would write the post around the decisions I made, not around the model's textbook description. The rule for include versus link: include anything a reader needs to understand or reproduce my choices, and link anything that is stable, well explained in existing documentation, and not specific to my implementation.
Running example. Say I implemented a small decoder-only transformer language model (a neural network that predicts the next token in a sequence) with rotary position embeddings (RoPE, a way of encoding token position by rotating the query and key vectors) and grouped-query attention (several attention heads share one set of keys and values to save memory).
Outline
- Hook and promise (about 150 words). What the model does, what the reader will be able to do after reading, and who the post is for. State the prerequisite up front: "you know what attention is".
- The problem and the constraint. Why this architecture: the memory budget, the sequence length, the latency target. One paragraph plus a small diagram of the whole model.
- The architecture in one picture. A block diagram with shapes annotated (batch, sequence, hidden size). Walk through one forward pass on tiny numbers, for example a sequence of 4 tokens and 2 heads.
- The three or four decisions that differ from the reference design. For each: the choice, the alternative, why I chose it, and the evidence (an ablation, meaning a run with that one part removed or swapped, and the measured result).
- The parts that were harder than the paper says. Numerical stability, initialization, a masking bug I hit. This is the section peers value most, because papers omit it.
- Reproduce it. Link to the repo at a tagged commit, the exact config, the seed, the command, and the expected loss curve shape.
- Limits and what I would do next.
Terms used above, in plain words
- Forward pass: one run of an input through the model to get its output (as opposed to the backward pass that updates the weights).
- Hidden size: how many numbers represent each token inside the model (the width of its vector).
- Scaled dot-product attention: each token scores every other token by multiplying its query vector with the other's key vector, divides by the square root of the head size to keep scores tame, turns the scores into weights with softmax, and takes a weighted mix of the value vectors.
- Numerical stability: avoiding overflow or NaN (not-a-number) values, for example when softmax exponentiates a large score.
- Initialization: the starting values of the weights before training.
- Masking bug: letting a token attend to future tokens it should not see, which makes training look great and generation fail.
- Loss curve: a plot of training error against steps; "expected shape" means it should fall steadily and roughly match yours.
What step 3 looks like filled in (tiny forward pass)
Take 4 tokens, hidden size 8, 2 query heads of size 4, and grouped-query attention with 1 shared key/value head.
- Input: shape (batch 1, sequence 4, hidden 8).
- Queries: split into 2 heads, shape (1, 2, 4, 4). Keys and values: 1 shared head, shape (1, 1, 4, 4). Both query heads read the same keys and values, so the key/value cache is half the size it would be with 2 full heads.
- Scores per head: a 4 by 4 grid (each token against each token). The causal mask blanks the upper triangle, so token 2 only sees tokens 1 and 2. Softmax turns each row into weights that sum to 1.
- Weights times values gives (1, 2, 4, 4); the two heads are concatenated back to (1, 4, 8).
Drawing this once, with the shapes in each box, is what lets a reader follow the rest of the post.
What step 4 looks like filled in (one decision entry, illustrative)
- Choice: grouped-query attention, 2 query heads per key/value head.
- Alternative: full multi-head attention, one key/value head per query head.
- Why: inference memory. The key/value cache halves, so the model fits a longer context on the same GPU.
- Evidence: ablation table with both variants trained with the same seeds and data: validation loss for each (mean and seed-to-seed spread), plus measured cache size and tokens per second. Conclusion in one line, for example "loss differs by less than the seed spread, memory halves, so I kept it".
Include versus link: the test I apply to each candidate paragraph
| Question | If yes | If no |
|---|---|---|
| Does understanding my result depend on it? | Include | Link |
| Is it specific to my implementation or data? | Include | Link |
| Is a good, stable explanation already public (the original paper, a well-known tutorial)? | Link, add one sentence of summary | Include |
| Would a reader need it in the next 60 seconds to keep following? | Include a two-line recap | Link |
So I link the derivation of scaled dot-product attention and the RoPE paper, and I include my ablation table and my masking bug. Links go with a one-sentence "why you might click", so the post still reads without leaving it.
Pitfalls. Re-deriving the whole paper (the post becomes a worse copy of it). Showing only the final code and no reasoning. Unpinned links to a moving branch, which rot: link to a commit or a versioned URL. Skipping a "what did not work" section, which is where credibility comes from.
You inherit an ETL pipeline that has no README. Outline the one you would write so the next engineer can run it, monitor it and roll it back, and tell me how you would find out the facts you do not yet know.
Sample Answer
Direct answer
I would treat the missing README as an investigation with a written output. First I would collect facts from the system itself (scheduler, code, run history), then confirm the rest with people, and only then write, marking every claim I have not verified. The README covers what the pipeline is for, how to run it, how to monitor it, and how to roll it back. ETL means extract, transform, load: pull data from sources, reshape it, and write it to a destination.
How I find out the facts I do not know
Prefer evidence from the system over memory, in this order:
- Scheduler definition. In Airflow (a workflow scheduler where a DAG, directed acyclic graph, is the set of tasks and their order), read the DAG file for schedule, task order, retries, owners and alerts.
- Code and history. Read the transformation code (for dbt, a tool that turns SQL files into tables and tests them, read the models and tests) and the version-control log for who wrote what and why.
- Run history. Look at the last 30 days of runs: durations, failures, manual reruns. Repeated failures point at known fragile steps.
- Consumers. Ask downstream users what breaks if it is late. That defines the SLA (service-level agreement, how fresh the data must be) the pipeline never wrote down.
- Lineage and access. Check what tables it reads and writes (lineage: which upstream data feeds which downstream tables), and which credentials it uses (the accounts and keys it logs in with, and what each is allowed to touch).
- The previous owner or on-call. Ask for tribal knowledge (facts only people remember, never written down), then check each answer against 1-5.
- Dry run. In a development copy, run one date partition (one day's slice of data) and compare the output to production.
Anything I cannot confirm goes in the README as UNVERIFIED (date, how to verify) rather than being silently omitted or guessed. A real line looks like this (illustrative):
UNVERIFIED (2025-06-10): retries assumed to be 3. To verify: read `retries` in the DAG file and compare with task logs from the last 30 days.
The README outline
- Purpose and consumers: who uses the output and what they rely on.
- Architecture and schedule: a text diagram plus when it runs.
- Inputs and outputs: source systems, destination tables, keys.
- Run it: normal run, single-date rerun, and backfill (re-running historical dates).
- Monitor it: the alerts, the freshness check, what "healthy" looks like.
- Roll it back: how to undo a bad load.
- Known failure modes: symptom, cause, fix.
- Ownership and escalation.
Worked example: a dbt and Airflow daily report pipeline
Airflow and dbt are just the example tools. The same steps apply to any scheduler and any transformation tool.
CRM export + orders DB
|
v
Airflow DAG daily_report (06:00 UTC)
extract -> load raw tables
|
v
dbt run: staging models -> mart models
|
v
dbt test (not-null, unique, row-count checks)
|
v
Dashboard "Daily Revenue" (needs data by 08:00 UTC)
Terms in the diagram: staging models are cleaned copies of the raw tables; mart models are the final business-ready tables the dashboard reads; the freshness check asks whether the newest data is recent enough (for example, the latest order_date is yesterday or today); a partition is one day's slice of a table, such as order_date = 2025-06-10.
Rollback for this shape: the recovery is idempotent (safe to repeat without duplicating) because it works per date partition: delete the partition, then rebuild it. The raw append step on its own is not idempotent, which is exactly how a double run duplicates a day. To undo a bad day, delete that day's partition in the mart and re-run the DAG for that date. Check afterwards that row counts match the source. If a schema change (a source column was renamed, added or removed) caused it, revert the dbt model and re-run.
Traced example (illustrative numbers): on 2025-06-10 the mart table holds 24,000 rows for that day, but the source system shows 12,000 orders, so the load ran twice. Step 1: delete the partition order_date = 2025-06-10 from the mart. Step 2: trigger the DAG for that one date. Step 3: count again. The mart now holds 12,000 rows, matching the source, so the fix is confirmed. Then re-run dbt test and check the dashboard.
What the Run, Monitor and Roll back sections contain (illustrative):
Run: normal: automatic 06:00 UTC. Single date: trigger DAG daily_report for 2025-06-10.
Monitor: healthy = mart row count within 10% of the same weekday last week, and
newest order_date is yesterday or later by 08:00 UTC. Alert: #data-oncall.
Roll back: delete the bad day's partition, re-run that date, compare counts to source.
Trade-offs and pitfalls
- Documenting from memory of one colleague spreads their mistakes. Cross-check.
- Do not document a rollback you have not tried in a dev copy.
- A README with no owner and no "last verified" date will be stale within months, so put both at the top.
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.