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.
An executive asks, 'Why can't we just run our services as containers behind a load balancer and call it a day?' Give me a structured one-page answer that connects architecture to cost, risk and time.
Sample Answer
Direct answer
"You can, and for a small start it is often right. Containers behind a load balancer solve one thing: running stateless code (code that keeps no important data of its own, so any copy can serve any request) and spreading requests across copies. The rest of the bill, which decides cost, risk and time, is everything that does not fit in that sentence: where data lives, how we release safely, what happens when a machine or a zone fails, and who is paged." The one-page answer maps each of those gaps to money, exposure and schedule.
The one page
| Question the executive is really asking | What "containers plus load balancer" gives | What is still missing | Effect |
|---|---|---|---|
| How fast can we ship? (time-to-market) | Repeatable packaging | Automated build, test and safe rollout | Without it, each release is manual and slow; with it, weekly or daily releases are possible. |
| What does it cost to run? (operating cost) | Pay for machines | Right-sizing, autoscaling, and the people who operate it | Idle capacity is paid for; a team must own upgrades and patching. |
| How often is it down? (availability) | Spread across instances | Redundant data tier, multi-zone placement, health checks | The weakest single component sets the ceiling. |
| What if someone attacks or a component breaks? (risk) | Isolation between processes | Secrets, network rules, backups, monitoring | Silent failure and breach exposure. |
Worked example: why the weakest part sets availability (illustrative, assumes independent failures)
Availability is the share of time a part is working. "Independent" means one failing does not make the other more likely to fail (for instance they are not on the same power feed). For reference, 99.9% availability allows 0.001 x 8,760 hours in a year, about 8.8 hours of downtime.
- Two app instances, each up 99.5% of the time (down 0.5% = 0.005). The app tier fails only when both are down at once, and with independent failures that happens 0.005 x 0.005 = 0.000025 of the time. So app tier availability is 1 - (0.005 x 0.005) = 1 - 0.000025 = 0.999975, or 99.9975%.
- One database, up 99.9%. Everything must be up together, so multiply: 0.999975 x 0.999 = 0.998975, about 99.90%. That is 0.001025 x 8,760 = about 9 hours of downtime a year.
- Add a standby database (a second copy in another availability zone, meaning a separate data centre within the region, that takes over if the first fails). The data tier fails only if both copies are down: 1 - (0.001 x 0.001) = 0.999999. Overall: 0.999975 x 0.999999 = about 0.999974, roughly 14 minutes a year (0.000026 x 8,760 hours = 0.23 hours).
- Real systems are worse: failover (the switch to the standby) takes time and failures are not fully independent. Treat these as ceilings, not promises.
Cost in plain numbers (illustrative): if capacity is sized for a peak that is 2.5 times the average, about 60% of it sits idle off-peak, so we pay for 100 to use 40 unless autoscaling (adding and removing instances automatically with load) or right-sizing (choosing instance sizes that match real usage) trims it. A standby database roughly doubles that one component's running cost, which is the price of removing the 9 hour ceiling.
Recommendation
Start with containers behind a load balancer plus the three cheap additions: a managed database with a standby, automated deployments with rollback, and basic alerts. Delay heavier machinery until a measured need, such as an availability target we are missing.
Heavier machinery, rarely needed at the start: multi-region means running the whole system in more than one geographic region to survive a regional outage, and a service mesh is an extra network layer that manages service-to-service traffic, security and retries. Both add cost and operating burden, so we adopt them only on a measured need.
Trade-offs and pitfalls
- Do not oversell complexity. "It's complicated" is not an answer.
- Do not undersell it either: "just containers" ignores the database and the on-call people.
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.
Write a one-page ADR that documents the decision to standardise service orchestration on a single platform. What alternatives, rationale, migration risks and rollback plan belong in it, and how do you keep it to one page?
Sample Answer
Direct answer
Interpreting "service orchestration platform" as the runtime that schedules and runs your services (an orchestrator is software that decides which machine each copy of a service runs on, restarts crashed copies, scales copies up or down and rolls out new versions; Kubernetes is the most common one), versus each team choosing its own, a one-page ADR (architecture decision record: a short document capturing one decision) needs five things: the decision in one sentence, two or three alternatives, the rationale tied to a real pain, migration risks, and a rollback plan. It stays to one page by linking out, using tight bullets, and giving each section a line budget.
The one-page ADR
# ADR-12: Standardise service runtime on one container orchestrator
Status: Proposed | Date: 2026-09-28 | Owner: platform lead
**Decision.** All new and migrated services run on the managed Kubernetes
cluster (a cloud provider operates the cluster's control machinery for us). Other runtimes need a written exception.
**Context.** Six services run on four different platforms (VMs, two PaaS
(platform-as-a-service) products, hand-rolled scripts). Each has its own deploy, logging and
on-call setup, so incidents take longer to diagnose and new joiners learn
four systems.
**Alternatives.** (1) Keep team choice. (2) Serverless functions (code the cloud vendor runs on demand, with no servers to manage) for
everything. (3) One orchestrator (chosen).
Rejected 1: keeps the cost we are trying to remove. Rejected 2: poor fit
for long-running and stateful services.
**Rationale.** One deploy path, one observability setup, one skills base.
**Migration risks.** Team learning curve; two systems in parallel during
the move; noisy-neighbour effects on shared nodes (one service hogging a machine's CPU or memory and slowing the others); cost increase before
old platforms are retired.
**Rollback.** Migrate one service at a time. Keep the old deployment
warm until the new one has run a full release cycle; rollback is
re-pointing traffic. Stop the programme if two consecutive migrations
miss their success checks (the agreed targets: deploy time no worse than before, no rise in incident count).
**Review.** 6 months, against example targets: services migrated 0 of 6 today, target 6 of 6; deploy time 40 min today, target under 15 min; time to diagnose an incident 2 h today, target under 1 h.
How to keep it to one page
- Decision first, then a sentence per section. Bullets, not paragraphs.
- Link to the cluster design, cost model and migration runbook instead of pasting them.
- One decision only. Choice of service mesh (a layer that manages service-to-service traffic) or ingress (the entry point that routes outside traffic in) is a separate ADR.
- Cut anything a reader would not miss: history of how you got here belongs in the linked proposal.
ML variant: model-serving platform choice (optional extension, only if the interviewer steers to ML)
Same shape, different options. For serving machine-learning models, compare three hosting styles:
| Style | Good for | Watch out for |
|---|---|---|
| Containers on the standard orchestrator | Steady traffic, GPU (graphics processor) scheduling, custom runtimes, reuse of the platform | You own scaling, upgrades and GPU capacity |
| Serverless functions | Spiky or low traffic, small models, no idle cost | Cold starts (delay when a new instance loads the model), size and time limits, poor GPU support |
| Managed model hosting from a cloud vendor | Speed to launch, built-in autoscaling and monitoring | Cost at scale, lock-in (hard to move away later), less control over the runtime |
A reasonable commit: containers on the standard platform for steady, latency-sensitive models, and a managed service for experiments. State what would flip it: if traffic is very spiky and models are small, serverless wins.
Pitfalls
- Standardising without an exception path creates shadow platforms.
- A rollback plan that says "revert" without saying what stays running during the move.
- Listing benefits with no measurable check; the review line above is what makes the decision testable.
Explain the C4 model. What does each level show, who is each level for, and what would you draw at each for a system you know?
Sample Answer
Direct answer
The C4 model (created by Simon Brown) describes a software system as four zoom levels of diagram: Context, Container, Component, Code. Each level answers a different question for a different audience, so you show only the level your reader needs instead of one giant box-and-arrow picture. In practice most teams draw the first two well, the third selectively, and the fourth almost never by hand.
The four levels
| Level | Shows | Audience | Question it answers |
|---|---|---|---|
| 1. System Context | Your system as one box, the people who use it, and the other systems it talks to | Everyone, including non-technical | What is this and who/what does it touch? |
| 2. Container | The separately runnable or deployable pieces inside the system: web app, API service, database, queue | Engineers, ops, security | What are the big moving parts and how do they talk? |
| 3. Component | The main building blocks inside ONE container (modules, controllers, services) | Developers working in that container | How is this service organised inside? |
| 4. Code | Classes and functions | Developers, rarely needed | Usually generated from code, if drawn at all |
"Container" here means a runnable/deployable unit (a service, a database, a single-page app). It has nothing to do with Docker specifically.
Worked example: a restaurant chain's "Order Tracker" system
- Context: Order Tracker as one box. People: Customer, Kitchen Staff, Support Agent. External systems: Payment Provider, SMS Gateway, the chain's existing Menu System. Arrows say what flows: "places orders", "sends receipts".
- Container: Customer Web App (React, a single-page app: a web app that loads once and updates without full page reloads), Orders API (a Java service), Notification Worker (a program that picks up messages from a queue, a waiting line of messages), Orders Database (PostgreSQL), Message Queue. Each box carries a name, type, technology and one-line responsibility; each arrow says why and how ("Reads and writes orders, SQL over an encrypted connection").
- Component: zoom into the Orders API only: Order Controller, Pricing Service, Payment Client, Order Repository, and how they depend on each other.
- Code: skip; the IDE or a generated class diagram covers it when someone needs it.
What the container level looks like as box-and-arrow text:
[Customer] --places orders (HTTPS)--> [Customer Web App: React]
[Customer Web App] --calls, JSON over HTTPS--> [Orders API: Java]
[Orders API] --reads and writes orders, SQL--> [Orders Database: PostgreSQL]
[Orders API] --publishes "order placed" event--> [Message Queue]
[Notification Worker] --consumes events--> [Message Queue]
[Notification Worker] --sends receipt text, HTTPS--> [SMS Gateway]
[Orders API] --charges card, HTTPS--> [Payment Provider]
Also useful beyond the four levels: a deployment diagram (which containers run on which infrastructure, for example the Orders API on three servers in one region) and dynamic diagrams (a numbered sequence of arrows showing one request, such as 1 place order, 2 charge card, 3 publish event, 4 send text), which C4 lists as supplementary views.
Rules that make the diagrams good
- Every element has a name, a type and a short description; every arrow has a label saying intent (and technology at container level).
- Include a legend for shapes and colours.
- Do not mix levels on one diagram (a database next to a Java class is a tell).
Trade-offs and pitfalls
- Drawing component and code levels for everything, then watching them rot. Draw only where the reader needs it.
- Unlabelled arrows: the reader cannot tell a synchronous call (the caller waits for the reply, like a phone call) from an event (the sender publishes a message and moves on, like leaving a voicemail).
- Treating C4 as a tool choice. It is a set of abstractions; you can draw it in a diagram-as-code tool (you write the diagram as text, for example in Structurizr or Mermaid, and the tool draws the boxes) or on a whiteboard.
You have a list of service-dependency pairs. Write a function that produces a Graphviz DOT graph from them, and explain why you might generate diagrams from data rather than draw them by hand.
Sample Answer
Approach
Turn the pairs into a set (removing duplicates), sort nodes and edges so the output is identical on every run, and emit one node line and one edge line per item in the DOT language (Graphviz's plain-text graph format: a -> b; means a directed edge). Escape quotes so an odd service name cannot break the file. The same structured data also produces a markdown summary table, so the diagram and the documentation come from one source.
Code (save as archdocs.py)
import json
import sys
def esc(text):
return text.replace("\\", "\\\\").replace('"', '\\"')
def to_dot(pairs, owners=None):
owners = owners or {}
edges = sorted(set(pairs)) # dedupe + stable order
nodes = sorted({n for pair in edges for n in pair} | set(owners))
lines = ["digraph services {", " rankdir=LR;", " node [shape=box];"]
for n in nodes:
label = esc(n) + ("\\n(" + esc(owners[n]) + ")" if n in owners else "")
lines.append(f' "{esc(n)}" [label="{label}"];')
for src, dst in edges:
lines.append(f' "{esc(src)}" -> "{esc(dst)}";')
lines.append("}")
return "\n".join(lines)
def to_markdown(services):
rows = ["| Service | Owner | SLO | Diagram |", "|---|---|---|---|"]
for name in sorted(services):
s = services[name]
rows.append(f"| {name} | {s['owner']} | {s['slo']} | [{s['diagram']}]({s['diagram']}) |")
return "\n".join(rows)
if __name__ == "__main__":
mode, path = sys.argv[1], sys.argv[2]
with open(path) as f:
data = json.load(f)
if mode == "dot":
owners = {n: s["owner"] for n, s in data["services"].items()}
print(to_dot([tuple(e) for e in data["edges"]], owners))
else:
print(to_markdown(data["services"]))
Sample input, saved as services.json, then two runs:
cat > services.json <<'EOF'
{
"edges": [["web", "auth"], ["web", "catalog"], ["catalog", "db"], ["auth", "db"], ["web", "auth"]],
"services": {
"auth": {"owner": "identity-team", "slo": "99.9% login success", "diagram": "docs/auth.svg"},
"catalog": {"owner": "catalog-team", "slo": "p95 < 300 ms", "diagram": "docs/catalog.svg"}
}
}
EOF
python3 archdocs.py dot services.json
python3 archdocs.py table services.json
Output of the first run (the duplicate web -> auth pair appears once):
digraph services {
rankdir=LR;
node [shape=box];
"auth" [label="auth\n(identity-team)"];
"catalog" [label="catalog\n(catalog-team)"];
"db" [label="db"];
"web" [label="web"];
"auth" -> "db";
"catalog" -> "db";
"web" -> "auth";
"web" -> "catalog";
}
Output of the second run:
| Service | Owner | SLO | Diagram |
|---|---|---|---|
| auth | identity-team | 99.9% login success | [docs/auth.svg](docs/auth.svg) |
| catalog | catalog-team | p95 < 300 ms | [docs/catalog.svg](docs/catalog.svg) |
Reading the code line by line
escputs a backslash before\and", so a name likea"bcannot end the quoted string early.edges = sorted(set(pairs)): thesetdrops the duplicate("web", "auth"), andsortedmakes the order the same on every run.nodes = sorted({n for pair in edges for n in pair} | set(owners)): a set comprehension that loops over each pair and then each name in it, so every service is listed once even if it appears in many pairs; the| set(owners)adds services that have an owner but no dependency edges, which would otherwise vanish from the picture (an isolated service is exactly the kind of gap a landscape diagram should show).rankdir=LR;tells Graphviz to lay the graph out left to right (the default is top to bottom);node [shape=box];makes every node a rectangle unless overridden.- The node loop writes one line per service, adding the owner on a second label line (
\nis a line break inside a DOT label) when one is known; the edge loop writes"src" -> "dst";. to_markdownbuilds one table row per service from the same data; SLO means service-level objective, the reliability target the team commits to (for example "p95 < 300 ms", meaning 95 percent of requests finish under 300 milliseconds).
Pipe the DOT output into dot -Tsvg (from the Graphviz tools) to get an image, or paste it into any online Graphviz viewer.
Why generate diagrams from data instead of drawing them
- Single source of truth: the dependency list already lives in a service catalog or config. A diagram built from it cannot disagree with it.
- Stays current: regenerate on every merge in continuous integration (CI, the automated build), so the picture never lags behind the system.
- Reviewable: a change to the dependency list appears as a small text diff in a pull request, which a screenshot of a hand-drawn box cannot offer.
- Consistent: every diagram gets the same shapes and names, which removes the arguments about icons.
- Cost of hand-drawing: nicer layout and emphasis. I would still hand-draw the executive overview and generate the detailed dependency views.
Complexity
Building the set is O(E) for E pairs and sorting is O(E log E) (nodes are at most 2E plus the number V of owned services), so the cost is O((E + V) log (E + V)), with O(E + V) memory for the output.
Edge cases
- Duplicate pairs are removed by the set.
- Names with quotes or backslashes are escaped (
to_dot([('a"b', 'c')])yields the node"a\"b"). - A service with no owner in the data gets no owner line, which is itself a useful documentation gap to flag.
- A service that is in the service data but appears in no pair is still drawn, as an unconnected box, because its name comes from the owners map.
- Cycles are valid in DOT and drawn as-is, which is helpful because circular dependencies are worth seeing.
- Very large graphs (hundreds of nodes) become unreadable: filter to one domain, or one hop from a chosen service, before drawing.
Unlock Full Question Bank
Get access to all 25 Architecture Documentation and Communication interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.