Architecture Documentation and Communication Questions
Making an architecture legible to others: architecture decision records (templates, alternatives and consequences, lifecycle, supersession, tagging and discoverability), diagramming and visualization (C4, sequence, deployment, data-flow and trust-boundary diagrams, notation conventions), and communicating designs to technical and non-technical stakeholders. Covers capturing rationale, documenting what a system does under failure, load and consistency trade-offs, recording observability, SLO and security content, running design reviews, keeping docs and diagrams current, and presenting a system clearly under time pressure. The communication skill that separates a good design from an understood one.
Why do you record the reasoning behind a decision and not just the decision? What goes wrong later without it, and which elements of the rationale (constraints, alternatives, assumptions, revisit triggers) matter most?
Sample Answer
Direct answer
Because the decision tells people what was chosen, but only the reasoning tells them whether it is still the right choice. Without it, later engineers either avoid changing something they do not understand or change it without knowing what it was protecting. An ADR (Architecture Decision Record, a short document capturing one design decision) should therefore record the constraints, the alternatives, the assumptions and a revisit trigger, not just a title.
What goes wrong without it
- Re-litigation: the same argument recurs every year because nobody remembers it was settled or why.
- Cargo-culting: people copy a pattern into places where its reason does not apply (copying a practice because it worked elsewhere, without understanding why it worked).
- Frozen or reckless changes: "nobody dares touch it" or "let's rip it out" (a fence taken down without asking why it was built, from the idea known as Chesterton's fence: before removing something, find out why it was put there).
- Onboarding and handoff: newcomers and successors see structure but not intent.
- Audit: an auditor or reviewer asking "why did you accept this risk, on what evidence, and who agreed?" gets no answer.
Which elements matter most
- Constraints (time, budget, team skills, regulations, existing systems): the most valuable, because they explain the choice and expire on their own.
- Assumptions (what we believed about traffic, growth, users): these are what silently become false.
- Alternatives, and why each lost: stops people proposing the discarded option again.
- Revisit triggers (a measurable condition that reopens the decision): converts an assumption into a tripwire.
Worked example
Decision: run the app in a single region.
Constraints: launch in 3 months, 4 engineers, users almost all in one country.
Alternatives: multi-region (rejected: doubles operational work for the team we have).
Assumptions: traffic stays in one country; a few hours of regional outage is tolerable.
Revisit trigger: more than 20% of users outside the region, or the availability target is missed twice in a quarter.
Two years later a new team sees one region. Without the record they either spend months "fixing" it or never notice the company expanded. With it, the trigger tells them exactly when to reopen.
Other uses
- Handoff: the new owner gets the reasoning along with the code.
- Audit: a dated trail of who decided what, with which evidence.
- Future review: reviewers can compare current reality with the recorded assumptions.
Reusable structure
Title, status, date; context and constraints; decision; alternatives with reasons rejected; assumptions; consequences; revisit trigger.
ML angle: batch versus online inference
Inference is running a trained model to get predictions. Batch inference computes predictions in bulk on a schedule; online inference computes them per request. A short rationale for it:
| Question | Batch | Online |
|---|---|---|
| Freshness the product needs | Hours are fine | Seconds |
| Latency limit per request | None | Tight |
| Cost and infrastructure | Cheaper, simpler | Always-on serving |
| Failure mode | Stale predictions until next run | Errors visible to users |
Revisit trigger for the ML choice: if the freshness need drops below hourly, or volume grows enough to change the cost picture. That table lets a later reviewer grasp the trade-off in a minute. With numbers (illustrative): a store has 2 million users and a slowly changing catalog. Batch: one nightly job of about 1 hour, so recommendations are at most about 25 hours old: 24 hours between runs plus the hour the job itself takes. Online: at a peak of 500 requests per second, each needing about 20 ms of model compute, the always-on servers need 500 x 0.02 = 10 cores busy at peak, plus headroom. Rationale recorded: 24-hour freshness is acceptable, so batch is cheaper. Revisit trigger: if product needs a click reflected within 5 minutes, batch cannot meet it and the decision reopens.
Pitfalls
Writing only the conclusion, or recording rationale that is a sales pitch with no alternatives. And never editing an old ADR to make past reasoning look better.
What makes an architecture diagram good or bad? What conventions do you insist on for shapes, arrows, layering, legends and labelling, and what would make you send a diagram back?
Sample Answer
Direct answer
A good architecture diagram answers one question for a named audience at one level of abstraction, and a reader can understand it without the author in the room. A bad one mixes levels, has unlabeled arrows and no legend, and shows every component the author knows about. I insist on: a title stating purpose and audience, consistent shapes with a legend, arrows that say what flows and how, sensible layering, and metadata (owner, date, version). I send a diagram back when a reader would have to guess what an arrow means.
Conventions I insist on
- Shapes: one shape per kind of thing (service, data store, queue, external system), explained in a legend. Color never carries meaning alone (colour-blind and print readers).
- Arrows: labeled with a verb plus protocol ("submits order, HTTPS"); direction means "who initiates the call" and I say so on the legend.
- Sync versus async: solid line for a call the caller waits on, dashed for messages and events. Mixing them is a common source of wrong assumptions about failure.
- Layering: users at the top or left, data at the bottom or right; group things inside boundaries (zone, team, trust boundary) rather than scattering them.
- Labelling: names match the code repository and dashboards; every acronym is expanded once.
- Annotations: owner and team, a risk marker on single points of failure (SPOF, one component whose loss takes the system down), a link from each box to its runbook (the operating guide for when it breaks), and the date and version the diagram describes.
In the example below, gRPC is a fast request protocol between services, and the last node is the legend: a note box stating what solid and dashed arrows mean, deliberately connected to nothing so nobody reads it as a data flow. Note the queue-to-worker arrow points from the worker to the queue because, by the convention above, the arrow points at what is called and the worker polls the queue; if the broker pushes messages to the worker, draw it the other way and say so on the legend.
flowchart LR
U[Client] -->|POST order, HTTPS| A[API]
A -->|reserve stock, gRPC| S[Stock service]
A -.->|OrderPlaced event| Q[[Queue]]
W[Fulfilment worker] -.->|polls for events| Q
L[Legend: solid = waits for reply, dashed = event or message]
Structure views versus a sequence view These follow the C4 model (four zoom levels: Context, Container, Component, Code). A container view shows the deployable pieces (apps, services, databases); a component view zooms into the parts inside one container; both show structure, what exists and connects. Each diagram should sit at one such level of abstraction (zoom level). A sequence view (participants across the top, time flowing down) shows order and timing, so use it to show retries, timeouts and failure handling. If the question is "what happens when this fails", structure alone cannot answer it.
Worked example of sending one back
Submitted: a box "Backend" with unlabeled arrows to "DB" and "Cache", cloud icons, no legend, dated last year. My review: name the components ("Order API", "Orders database"); label each arrow; add a legend; mark the cache as a shared dependency; add the owner and a runbook link; remove the dated icons that convey nothing. After the edit a stranger can say what fails when the cache is down. The corrected diagram, as text:
[Order API] --reads/writes orders, SQL--> [Orders database]
[Order API] --reads hot items, Redis--> [Shared cache] (shared dependency, owner: platform)
Legend: solid = synchronous call. Owner: orders team. Runbook: link. Date: 2026-09-01
Send-back triggers
- Unlabeled arrows. 2. Mixed abstraction levels. 3. No legend, or unexplained icons. 4. More elements than a reader can hold, roughly fifteen or more, without grouping. 5. Undated or stale. 6. No indication of sync versus async. 7. Crossing lines that could be untangled by regrouping.
Trade-offs and pitfalls
- Strict conventions help only if the team shares them; agree on a template, not on taste.
- A beautiful diagram that is out of date is worse than an ugly one that is correct, so keep it in the repository next to the code.
What is an Architecture Decision Record, and what makes a good one? Walk me through what it contains and when your team would write one.
Sample Answer
Direct answer
An Architecture Decision Record (ADR) is a short document that captures ONE significant architecture decision: the situation that forced it, what was chosen, what else was considered, and what the team accepted as a consequence. A good ADR is written at the time of the decision, is honest about the downsides, and is never silently rewritten later, so a future engineer can learn why the system looks the way it does, not just how.
What it contains
- Title and number: a short statement of the decision, such as "ADR-0007: Use gRPC for internal service calls". (gRPC is Google's remote procedure call framework; REST is the common style of calling services over plain HTTP with JSON.)
- Status: Proposed, Accepted, Rejected, Deprecated, or "Superseded by ADR-00NN".
- Context: the forces at play (requirements, constraints, team skills, deadlines) in a few sentences a newcomer can follow.
- Decision: one clear sentence in active voice ("We will...").
- Alternatives considered: the real options and why each lost.
- Consequences: what gets easier, what gets harder, and what new risks we now carry. Both good and bad.
- Date and deciders, so people know who to ask.
Worked example (REST vs gRPC)
ADR-0007: Use gRPC for calls between Orders and Pricing
Status: Accepted (2025-03-12)
Context: Orders calls Pricing on every checkout. Both are internal, both
are owned by us, and we want a typed contract (request and reply shapes declared in a schema, so a mismatch is a build error rather than a production surprise).
Decision: We will define the contract in protobuf (a compact, typed message format declared in a schema file) and call Pricing over gRPC.
Alternatives: REST+JSON (familiar, easy to debug with curl, a command-line tool for sending web requests, but the
contract is only documentation); message queue (decoupled, but checkout
needs the price synchronously).
Consequences: (+) generated clients, compile-time contract checks.
(-) browsers cannot call it directly, so the public edge stays REST;
(-) the team must learn protobuf tooling and gRPC debugging.
When your team writes one
Write an ADR when a decision is hard to reverse, affects more than one team, had real alternatives, or would make a new hire ask "why on earth did we do it this way?". Cross-team adoption works best when the ADR arrives as a pull request (a proposed change others review) in a shared or per-repo folder, so the discussion happens on the record and other teams can link to it or reuse it rather than re-deciding.
Storing, versioning and surfacing them so rationale survives years
- Keep them in version control next to the code (for example
docs/adr/0007-use-grpc-for-internal-calls.md), one file per decision, numbered and never deleted. Git history (the stored record of every change and who made it) then gives you versioning and authorship for free. - Treat accepted ADRs as append-only (you add new records but never rewrite old ones): to change your mind, write a new ADR and mark the old one "Superseded by ADR-0015", with a link in both directions.
- Maintain an index page (or publish the folder to the docs site) listing number, title, status and date, so people can search rather than browse.
- Link ADRs from the places engineers actually look: the service README, the pull request that implemented it, and the service catalog entry (the internal directory listing each service with its owner and docs). Auditors get a dated, reviewed, immutable (cannot be altered afterwards) trail.
Trade-offs and pitfalls
- Too long: nobody reads a five-page ADR. Aim for one page.
- Too many: writing ADRs for trivial choices creates fatigue and buries the important ones.
- Decision without alternatives or consequences reads as a press release, not a record.
- Editing history: rewriting an old ADR destroys the very evidence it exists to preserve.
You are documenting a message-bus-based ingestion pipeline. What must the documentation tell producers, consumers and operators, and how would you diagram it so delivery guarantees and failure behaviour are unambiguous?
Sample Answer
Direct answer
A message-bus pipeline document is a contract with three audiences. Producers need to know what to send and what is promised on publish. Consumers need the delivery, ordering and duplicate rules, and what happens to a message that fails. Operators need retention, partition, capacity, alerts and replay steps. The diagram must show partitions, retries and the dead-letter path explicitly, because those are where delivery guarantees are decided.
Vocabulary first
- Broker: the server that receives messages and holds them until consumers read them.
- Topic: a named log of messages on the broker, like one labelled mailbox stream (here
model-updates). - Partition: one slice of a topic's log; messages with the same key always land in the same partition, which is why order is kept per key. The key is hashed to a number and mapped to a partition (for example hash 17 on 6 partitions is 17 mod 6 = partition 5).
- Consumer group: a set of consumers that share a topic, each partition going to exactly one member. With 6 partitions, at most 6 consumers in a group do useful work.
- Offset: a message's position number in its partition. Commit offset (acknowledge) means the consumer tells the broker "I have finished everything up to here", so a restart resumes after it.
- Retry with backoff: try again after a growing wait (for example 1 s, 4 s, 16 s) rather than hammering a failing system.
- Dead-letter topic: a separate topic where messages that keep failing are parked for a human, so they do not block the rest.
- Consumer lag: how many messages a consumer is behind the newest one in its partition.
- Retention: how long the broker keeps messages (here 7 days), which also limits how far back you can replay.
- Local outbox: a table in the producer's own database where the event is saved first, then sent to the broker later, so a broker outage cannot lose it.
What the document must tell each audience
| Audience | Must know |
|---|---|
| Producers | Topic name and owner; the message key and why (ordering scope); schema and version; when a publish counts as done; behaviour when the broker is down; size and rate limits |
| Consumers | Delivery guarantee (at-least-once); ordering scope; the idempotency key; retry policy and dead-letter behaviour; how far back they can replay; consumer group naming; schema deprecation policy |
| Operators | Retention and partition count; consumer lag and dead-letter depth alerts; replay and dead-letter runbooks; capacity and quotas; who is on call |
Delivery semantics in plain terms
- At-least-once: a message is redelivered if the consumer does not acknowledge it, so duplicates are possible. It is the honest default: consumers acknowledge after processing succeeds.
- Exactly-once: across a network you cannot generally guarantee a message is delivered once. Some brokers offer transactional exactly-once inside the broker boundary, but side effects outside it (a database write, an email) still need protection. The practical claim to document is "at-least-once delivery plus an idempotent consumer", meaning processing the same message twice has the same effect as once, achieved by recording processed event ids.
- Ordering: guaranteed only within one partition (a subset of the topic's log). Choosing the key decides what stays ordered.
Diagram: partitioning, consumer groups, retry and dead-letter
flowchart LR
P[Producer] -->|key = model_name| T
subgraph T[Topic model-updates: 6 partitions, retention 7 days]
P0[Partition 0]
P1[Partition 1]
P5[Partition 5]
end
P0 --> C1[Consumer A in group scorer]
P1 --> C2[Consumer B in group scorer]
P5 --> C2
C1 -->|success: commit offset| OK[Acknowledged]
C1 -->|failure: up to 3 retries with backoff| R[Retry topic]
R --> C1
R -->|still failing| D[Dead-letter topic, 14 days]
D --> O[Alert and replay runbook]
Reading the diagram: partitions 2 to 4 are left out for readability. Trace one failing message: it arrives on partition 0, Consumer A fails to process it, so it is sent to the retry topic and comes back to Consumer A after a wait; after 3 failed retries it moves to the dead-letter topic, an alert fires, and an operator follows the replay runbook. On success the consumer commits the offset and the message is done.
Example: model-update publisher and its versioned event contract
A publisher announces each new machine-learning model version. Key by model_name so version 7 is never processed before version 6 for the same model. Consumers ignore any event whose version is not newer than the one they hold, which also makes duplicates harmless. Trace: a consumer holds version 13. Event version 14 arrives, it is newer, so the consumer applies it and now holds 14. The same event is redelivered because the acknowledgement was lost (a duplicate): 14 is not newer than 14, so it is ignored. A late version 13 arriving afterwards is also ignored.
{
"event_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"event_type": "model.updated",
"schema_version": "1.2",
"occurred_at": "2026-09-28T09:15:00Z",
"model_name": "fraud-scorer",
"model_version": 14,
"artifact_uri": "registry://models/fraud-scorer/14"
}
Schema evolution rules
- Adding an optional field is safe: old consumers ignore it.
- Removing, renaming or changing the type of a field is breaking: publish to a new versioned topic (for example
model-updates.v2) and run both for a deprecation window. - Never reuse a field name with a new meaning.
- Every event carries
schema_version; consumers must tolerate unknown fields.
Failure behaviour, stated unambiguously
| Situation | What happens |
|---|---|
| Consumer crashes mid-message | Offset not committed, message redelivered (duplicate possible) |
| Message keeps failing | Three retries with backoff, then dead-letter topic and an alert |
| Broker unavailable to producer | Publish fails and is retried by the producer; document whether the caller is blocked or the event is queued in a local outbox |
| Partition count increased | Key-to-partition mapping changes (the key is hashed then reduced by the partition count: hash 17 goes to partition 5 of 6 but partition 1 of 8), so events for one key can end up in a different partition than earlier ones and ordering can briefly break; do it in a planned window |
Pitfalls: saying "exactly-once" without saying where; a diagram with a single arrow labelled "queue"; forgetting that the dead-letter topic needs an owner and an alert, or it becomes a silent graveyard.
Which architecture diagram would you show to executives, to engineering leadership and to the engineers implementing a change? How do a high-level and a detailed diagram differ in what they must include and avoid?
Sample Answer
Direct answer
Three audiences, three diagrams from the same underlying model. Executives get a system-context picture with a few boxes in business language. Engineering leadership gets a container-level view showing major services, datastores, ownership and risk. The implementing engineers get a detailed diagram of the specific change: components, interfaces, data flow and failure paths. The high-level diagram must show purpose, boundaries and risks and avoid technology detail; the detailed one must show interfaces and behaviour and avoid the whole-system sprawl.
Which diagram for whom
| Audience | Diagram | Must include | Must avoid |
|---|---|---|---|
| Executives | System context (C4 level 1: the system, its users, its neighbours) | Users, the product as one box, external systems, one risk marker, plain labels | Protocols, cloud service names, internal services |
| Engineering leadership | Container diagram (C4 level 2: services, datastores, queues) | Owners, dependencies, regions, where the change lands | Class or library detail, every endpoint |
| Implementing engineers | Component diagram of the affected service (C4 level 3: the parts inside one service) plus a sequence diagram of the changed flow (not a C4 level: it lists the parts across the top and shows the messages between them in time order, top to bottom, for one scenario) | Interfaces, data formats, error paths, what is changing (highlighted) | Unchanged parts drawn in full, marketing wording |
Visual conventions and audience assumptions
- Executives: one colour for "this is what changes", nothing else coloured, and no cloud vocabulary without a gloss. State the assumption on the slide, for example "assumes no cloud background".
- Leadership: colour by owning team, so ownership gaps are visible.
- Engineers: bold or dashed outlines for the changed parts, so review focuses on the diff.
Worked example: ML recommendation service
A recommendation service is a machine learning model that suggests products to a shopper. One diagram, three layers, drawn on the same canvas or as a toggle so the shared names and arrows agree.
- Backend engineers see the request path: API, feature lookup (fetching the stored facts about this shopper, such as recent clicks), model server (the program that runs the trained model and returns suggestions), cache.
- Data scientists see the training loop: raw events, feature store (a database of prepared inputs for the model), training job (the run that fits the model to past data), model registry (the versioned catalogue of trained models).
- Product managers see a simplified strip: shopper, "suggestions", business KPI (key performance indicator: click-through, the share of shown suggestions that get clicked).
Shared across all three layers: the boxes "Shopper", "Recommendations" (the model server plus its model) and "Suggestions". These keep one name each. The implementing engineer's diagram for, say, a change to feature lookup shows the API, feature lookup and feature store as full boxes, with the changed feature lookup drawn in a bold outline and a note "new: reads shopper's last 10 clicks"; the training loop appears as one greyed-out box so it does not compete for attention.
Pitfalls
- Showing engineers the executive picture (no actionable detail) or executives the engineer picture (noise).
- Different names for the same thing across the diagrams.
- No legend, no date, no owner: a diagram nobody can trust is worse than none.
Unlock Full Question Bank
Get access to all 13 Architecture Documentation and Communication interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.