📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

What is an architecture decision record? What format do you use, which decisions deserve one, and how do you keep a set of ADRs useful instead of letting them become a folder nobody reads?

Covers what an ADR is, the Nygard format (context, decision, status, consequences), which decisions warrant one, where to store them, superseding instead of editing, and keeping them discoverable and current.

Mid-Level Theory Intermediate adr architecture code-quality decision-making documentation engineering-practice

🎯 Key points

  • ADR = short record of one significant decision: context, decision, status, consequences
  • Write one when a decision is hard to reverse, cross-cutting or likely to be questioned
  • Store as Markdown in the repo (docs/adr), numbered, reviewed in a PR
  • Immutable once accepted: supersede with a new ADR, don't rewrite history
  • Record the options rejected and why, plus negative consequences
  • Keep it to one or two pages; link from code and the README
  • Statuses: Proposed, Accepted, Deprecated, Superseded
  • Review ADRs when assumptions change, e.g. scale or cost

⏱ 30-second answer

An architecture decision record (ADR) is a short document capturing one significant decision: the context, the decision, its status and its consequences, including the options you rejected.

  • Write one when a decision is hard to reverse, affects several teams or modules, or will be questioned later: choosing a message broker, an auth approach, a multi-tenancy model.
  • Keep them as numbered Markdown files in the repository, reviewed in a pull request like code.
  • Once accepted they are immutable: when the decision changes you write a new ADR that supersedes the old one.

The trade-off: an ADR costs an hour to write but saves weeks of re-arguing or reverse-engineering a decision. Writing them for trivial choices kills the habit.

🗣 Full answer (senior)

How I would answer this in an interview

"An ADR is a short, dated record of one architecturally significant decision. I use Michael Nygard's format: a title, a status (proposed, accepted, deprecated or superseded), the context that forced the decision, the decision itself in active voice, and the consequences, good and bad. I also add the options we considered and why we rejected them, because 'why didn't we just use X?' is the question that comes up two years later when everyone who was in the room has left.

The test I use for which decisions need one: is it hard or expensive to reverse, does it cut across modules or teams, or is it a choice someone will reasonably challenge later? Choosing Azure Service Bus over Event Grid for order events, deciding to use a single database with row-level tenancy, or adopting the outbox pattern all qualify. Choosing a logging library's sink or a variable name doesn't. I keep ADRs as Markdown in the repo under docs/adr, numbered, and I raise them as a pull request so the decision gets the same review as code, and the PR thread becomes part of the record.

To keep them useful, I treat accepted ADRs as immutable. If we change our mind, we write ADR 0023 that supersedes 0007 and mark 0007 as superseded with a link, so the history stays honest. I keep each one to a page or two, link them from the README and from the code that implements them, and revisit them when an assumption in the context changes, like traffic growing ten times. The mistake I see is writing ADRs after the fact to justify a decision, or writing so many trivial ones that nobody reads any of them."


The Nygard format

Section What goes in it
Title 0012 – Use Azure Service Bus for order events
Status Proposed, Accepted, Deprecated, Superseded by 0023
Context Forces at play: requirements, constraints, scale, team skills
Decision "We will…" in active voice
Consequences What becomes easier and harder; follow-up work; risks
Options considered (common addition) Each option with pros, cons and why it lost

Does this decision need an ADR?

Signal Example ADR?
Hard to reverse Database engine, tenancy model Yes
Cross-cutting Auth approach, API versioning scheme Yes
Likely to be challenged Not using microservices Yes
Local and cheap to change Private method structure No
Covered by a team convention Naming, formatting No (that's a style guide)

ADR versus design document

ADR Design document
Scope One decision One feature or system change
Length 1–2 pages Several pages
Lifetime Permanent, immutable Working document, then archived
Written When the decision is made Before building, to get feedback

Production example

On a payments platform, new joiners kept proposing to replace the outbox table with direct publishing to Service Bus. After we wrote ADR 0009 explaining the dual-write problem, the incident it caused and the options rejected, the same debate stopped coming up in design reviews, and onboarding questions about messaging dropped noticeably. When we later moved to a managed CDC approach, ADR 0021 superseded 0009 and both stayed in the log.

🔍 What the interviewer is checking

Checks whether the candidate documents decisions so they outlive the people who made them, and knows when documentation is worth the cost.

Green flags

  • Names the core sections: context, decision, status, consequences
  • Has a clear test for which decisions need an ADR
  • Treats accepted ADRs as immutable and supersedes them
  • Keeps ADRs in the repo and reviews them in PRs

Red flags

  • Has never heard of ADRs or confuses them with meeting minutes
  • Wants an ADR for every small decision
  • Edits history when decisions change

📚 Learn in depth

1. Why decisions get lost

Code shows what was built, not why. Decisions live in meetings, chat threads and people's heads, and they leave with those people. Without a record, teams either blindly follow old decisions they don't understand or reverse them without knowing the original constraint, sometimes recreating the problem the decision solved.

2. Origin and format

Michael Nygard proposed ADRs in 2011 as lightweight, version-controlled records. Variants include MADR (Markdown ADR, with explicit options and decision drivers) and Y-statements ("In the context of X, facing Y, we decided Z, to achieve A, accepting B").

docs/adr/
  0001-record-architecture-decisions.md
  0007-use-outbox-for-integration-events.md   (Superseded by 0021)
  0012-use-azure-service-bus.md
  0021-use-cdc-for-integration-events.md
  README.md   <- index: number, title, status

3. Lifecycle

Proposed --(PR approved)--> Accepted --(new ADR)--> Superseded
                                  \--(no longer relevant)--> Deprecated

Immutability keeps the log honest: you can see what was believed at the time and why it changed.

4. Writing a good context section

The context is the most valuable part. Capture the forces: functional needs, quality attributes (latency, availability, data residency in Azure Australia East), constraints (budget, team skills, licensing), and assumptions ("we expect under 50 messages per second"). When an assumption breaks, it signals the ADR needs revisiting.

5. Consequences, including bad ones

An honest ADR lists downsides: "We accept eventual consistency between orders and invoicing", "Developers need local Service Bus emulation". This protects against the decision looking naive later.

6. Keeping them alive

  • Index file listing number, title and status.
  • Link from code: a comment like // See ADR 0012 at the composition root.
  • Architecture tests (NetArchTest, ArchUnitNET) that enforce a decision, referencing the ADR.
  • Review in a quarterly architecture session: which assumptions changed?

Try it yourself

  1. Write ADR 0001: "Record architecture decisions" for a project you work on.
  2. Pick a decision your team made in the last six months and write its ADR, including two rejected options.
  3. Install adr-tools or dotnet-adr and generate a superseding ADR.
  4. Add an architecture test that enforces one ADR (for example, Domain must not reference Infrastructure).
  5. Ask a new joiner to read the ADR index and tell you which decision surprised them.

💻 Code

An ADR in the MADR-style format, stored in the repository and reviewed in a PR.

# 0012. Use Azure Service Bus for order integration events

- Status: Accepted (2026-03-14)
- Deciders: [team names]
- Supersedes: none

## Context
Order, Invoicing and Fulfilment need order events. We need ordered delivery per order,
dead-lettering, and at-least-once delivery. Expected peak: ~200 msg/s. Hosted in
Azure Australia East; data must stay in Australia.

## Options considered
1. Azure Service Bus (topics + sessions): ordering per session, DLQ, managed.
2. Azure Event Grid: cheap push model, but no FIFO ordering guarantees.
3. Self-hosted RabbitMQ on AKS: flexible, but we operate it ourselves.

## Decision
We will use Azure Service Bus Standard topics, with the order id as the session id.

## Consequences
+ Ordered per order, built-in DLQ and retries.
- Consumers must be idempotent (at-least-once delivery).
- Local development needs the Service Bus emulator.
- Revisit if throughput passes ~1,000 msg/s (Premium tier cost).

An architecture test that enforces a decision and points back to its ADR:

namespace Orders.ArchitectureTests;

using NetArchTest.Rules;

public sealed class LayeringTests
{
    // ADR 0004: the domain layer has no dependency on infrastructure or EF Core.
    [Fact]
    public void Domain_does_not_depend_on_infrastructure()
    {
        var result = Types.InAssembly(typeof(Orders.Domain.Order).Assembly)
            .ShouldNot()
            .HaveDependencyOnAny("Orders.Infrastructure", "Microsoft.EntityFrameworkCore")
            .GetResult();

        Assert.True(result.IsSuccessful, string.Join(", ", result.FailingTypeNames ?? []));
    }
}

⚠ Common mistakes

  • Mistake: Writing ADRs after the fact to justify a decision already built. Why it is wrong: It loses the honest context and rejected options, and reads as a rationalisation. Instead: Write it as Proposed while deciding and review it in a PR.
  • Mistake: Editing an accepted ADR when the decision changes. Why it is wrong: It erases why the old decision made sense and when it changed. Instead: Write a new ADR that supersedes it and update the old status.
  • Mistake: Writing ADRs for trivial or easily reversible choices. Why it is wrong: The log fills with noise and people stop reading it. Instead: Reserve ADRs for hard-to-reverse or cross-cutting decisions.
  • Mistake: Leaving out the downsides. Why it is wrong: The decision looks naive later and nobody knows which risks were accepted. Instead: List negative consequences and the assumptions that would trigger a revisit.
  • Mistake: Storing ADRs in a wiki far from the code. Why it is wrong: They drift and are invisible to developers. Instead: Keep them in the repo, indexed, and link them from code.
  • Mistake: Long essays. Why it is wrong: Nobody reads ten pages to find one decision. Instead: One or two pages; link to a design document for detail.

🏛 Senior insight: trade-offs

ADRs are a tool for organisational memory and for making decisions explicit enough to argue about. The senior move is to use the Proposed status to get disagreement out early, and to record the assumptions that would make the decision wrong, so the team knows when to revisit it rather than defending it forever.

Option When it fits Cost When not to
ADR in repo Code-level architecture decisions Low Org-wide policy across many repos
Central ADR repo Platform decisions shared by many teams Discoverability effort Single-team service
Design document Large feature needing exploration Several days A single clear choice
Team convention doc Style and naming Low Real trade-off decisions

A useful health check: can a new joiner find out why the system uses its message broker in under five minutes?

🔗 Follow-ups the interviewer may ask

  1. When: Candidate mentions using ADRs to record a large refactoring or migration decision. Why: Checks they can plan and communicate a large change, not just record it.
    How to answer

    I treat a large refactoring as a series of small, behaviour-preserving steps merged to main continuously, not a big-bang branch. First I pin current behaviour with characterisation tests. Then I pick a technique: strangler fig to route traffic piece by piece to a new implementation, branch by abstraction to put an interface in front of the old code and swap implementations behind it, or parallel change (expand, migrate, contract) for APIs and database schemas. Feature flags and shadow comparisons let old and new paths run side by side. I prioritise hotspots (code that changes often and hurts), keep refactoring commits separate from feature commits, and define an end state so it does not drag on forever.

  2. When: Candidate mentions recording accepted risks or shortcuts in the consequences section. Why: Checks how they track and prioritise the technical debt those consequences create.
    How to answer

    Technical debt is the future cost of a shortcut, and the interest is the extra effort or risk it adds every time we work near it. I make it visible in a debt register with each item's impact, how often we pay its interest (change frequency, incidents, delays) and a rough cost to fix. I prioritise by interest, not by how ugly the code is: debt in a hotspot that slows every feature beats a messy module nobody touches. I get time by explaining it in business terms (lead time, incident risk, cost), by reserving a steady share of capacity, and by pairing debt fixes with features that touch the same area.

  3. When: Candidate compares ADRs with longer design documents. Why: Checks they know when a change needs a full design doc and how to run its review.
    How to answer

    A design document is worth writing when a change is big, cross-team, hard to reverse or has genuinely different options: a new service, a data migration, a change to an API contract other teams use. A ticket and PR are enough for everything else.

    A good one has: context, goals and non-goals, the proposal, alternatives considered, risks (security, privacy, operability), rollout and testing, and open questions, in two to six pages with a diagram.

    Review it time-boxed: name the reviewers, set a deadline of a few days, resolve comments, and hold a short decision meeting only for what's still open. Key decisions then become ADRs.

    The trade-off: a design doc costs a few days up front, but catching a wrong approach on paper is far cheaper than catching it in code review or production.

🛠 Real-world problems: how you handle them

The same messaging debate in every design review
Situation
A [size] team runs an order platform on Azure ([region]). The original architects chose an outbox table for integration events, then [left the company]. New engineers repeatedly proposed publishing straight to Service Bus from the request handler.
Signals
Design reviews revisiting the same decision every few months; a PR that removed the outbox and was only caught by a senior reviewer; onboarding questions in the team channel asking why the outbox exists.
Investigation
Searched the repo, wiki and chat history for the original reasoning and found it only in an old incident write-up about lost events after a dual write. Interviewed the remaining engineer who remembered it. Checked current throughput and whether the original constraint still held.
Resolution
Wrote ADR 0009 with the context (dual-write risk, the past incident), the options rejected and the consequences, and raised it as a PR so the team could challenge it. Linked it from the outbox processor code and the README. Added an architecture test so handlers can't reference the Service Bus sender directly.
Prevention
Made ADRs part of the definition of done for any cross-cutting change; added an ADR index and a 'decisions' slot to the quarterly architecture review where assumptions are rechecked.

How to tell it (STAR)

**S:** At [company] our order platform used an outbox for events, but the people who chose it had left, and every few months someone proposed removing it. **T:** I wanted to stop re-arguing a decision nobody could explain and make sure it was still right. **A:** I dug the original reasoning out of an old incident report, checked whether the constraint still applied, and wrote it up as an ADR with the rejected options and downsides. I raised it as a PR so the team could challenge it, linked it from the code, and added an architecture test so the rule was enforced. **R:** The debate stopped coming up in design reviews, a risky PR was blocked automatically [number] times, and when we later moved to CDC we wrote a superseding ADR in [time] instead of starting from scratch.

↩ Usually asked after

More in Engineering Practice

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me