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

📚 Interview question

How do you choose an architecture for a new .NET system from the business needs rather than from fashion? Explain quality attributes (scalability, availability, modifiability, cost), constraints, team size and skills, and how you turn them into a decision you can defend.

Choosing an architecture by ranking quality attributes, capturing constraints and team realities, mapping them to options with a decision table, and recording the choice in an ADR.

Mid-Level Theory Intermediate adr architecture architecture-decisions modular-monolith quality-attributes trade-offs

🎯 Key points

  • Start from business drivers and rank 3-5 quality attributes; they conflict, so aim for the balance that best serves the top drivers
  • Turn attributes into measurable scenarios, e.g. p95 < 300 ms at 500 req/s, 99.9% availability, change shipped in < 1 day
  • Constraints are fixed inputs: budget, deadline, compliance (Privacy Act / APPs, data in Australia East), existing skills and platform
  • Team size and Conway's law: one team of 6 rarely benefits from more than one deployable
  • Map attributes to options in a decision table (monolith, modular monolith, microservices, serverless) with costs
  • Explain the choice to stakeholders in business terms: cost per month, time to market, risk of outage or breach
  • Record the decision in an ADR and treat it as iterative: revisit with fitness functions and production data

⏱ 30-second answer

I start from the business drivers, not the technology. I ask what the system must be good at and turn that into a short, ranked list of quality attributes: scalability, availability, modifiability, security, cost. Then I make each one measurable as a quality attribute scenario ("p95 under 300 ms at 500 requests a second"), and I list the constraints I can't change: budget, deadline, compliance such as data staying in Azure Australia East, and the team's size and skills.

  • The ranking forces trade-offs: high availability and low cost pull in opposite directions.
  • Conway's law matters: one team of six almost never needs ten services.
  • I record the choice in an ADR with the alternatives I rejected.

The trade-off is always the same: the architecture that best serves the top two attributes will be worse at something else, and I want that cost written down.

🗣 Full answer (senior)

How I would answer this in an interview

"I treat architecture as a set of decisions that are expensive to change, so I want them driven by what the business actually needs. My first step is a conversation with the product owner and stakeholders to find the drivers: what makes this system succeed or fail. From that I pull out three to five quality attributes and rank them. For an internal claims tool it might be modifiability first, then security, then cost. For a ticketing site it's scalability and availability during on-sale spikes. I make each one concrete as a scenario, for example 'when a new state regulation lands, we can ship the rule change within two days', because 'it should be maintainable' can't guide a decision.

Next I write down the constraints, which aren't up for debate: budget, go-live date, compliance such as the Privacy Act and keeping personal data in Azure Australia East, the platform the organisation already runs, and the team. Team size and skills are the constraint people forget. A team of five .NET developers who've never run Kubernetes should not be handed fifteen services on AKS. Then I put the realistic options in a decision table against the ranked attributes, usually a well-structured monolith, a modular monolith, a few services, or serverless for spiky event-driven parts, and I score the costs as honestly as the benefits.

The mistake I see is choosing the architecture first, often microservices because that's what the last conference talk was about, and then justifying it. The other mistake is trying to optimise every attribute. My senior line is: an architecture is a set of trade-offs you chose on purpose, so if you can't name what you gave up, you haven't really chosen."


From drivers to decision

Step Output Example
Business drivers Why the system exists, what failure costs "Lose the contract if renewals are late"
Ranked quality attributes 3-5 attributes, in order Modifiability > Security > Cost > Scalability
Quality attribute scenarios Measurable stimulus/response "A pricing rule change ships in < 2 days"
Constraints Fixed inputs 6 developers, Azure, data in Australia East, live in 9 months
Options + decision table Scored alternatives Modular monolith wins on modifiability and cost
ADR Decision, alternatives, consequences ADR-0003: modular monolith on App Service

Common quality attributes and what they push you towards

Attribute Typical scenario Pushes towards Cost
Scalability 10x traffic at peak Stateless web tier, caching, queues, scale-out More moving parts, eventual consistency
Availability 99.95% monthly Redundancy, zone redundancy, health checks, graceful degradation Higher hosting cost, more testing
Modifiability Change a rule in a day Clear module boundaries, rich domain model, good tests Up-front design effort
Performance p95 < 200 ms Fewer network hops, efficient queries, caching Can conflict with modifiability
Security / privacy Personal data protected, NDB-ready Least privilege, encryption, audit, data residency Slower delivery, more process
Cost < $X per month Fewer services, PaaS, serverless for spiky loads Can limit availability and scale
Deployability Deploy daily with low risk CI/CD, feature flags, independent deployables Pipeline and versioning effort

Team and organisation

Situation Usually fits
1 team, < 10 developers, one domain Monolith or modular monolith, one deployable
2-4 teams, clear subdomains Modular monolith with team-owned modules; extract a service only where scale or cadence differs
Many teams, independent release cadence, mature platform and on-call Services aligned to bounded contexts

Production example

For a [state government licensing system] we ranked modifiability and security above scalability, because peak load was about 40 requests a second but the rules changed every budget cycle. We chose a modular monolith on Azure App Service in Australia East, recorded it in an ADR, and shipped rule changes in an average of [1.5 days] in the first year, with hosting under [$2,000] a month.

🔍 What the interviewer is checking

Checks whether the candidate derives architecture from measurable business needs and constraints, and can explain the trade-offs they accept.

Green flags

  • Ranks a small set of quality attributes and makes them measurable
  • Treats team size, skills and compliance as constraints
  • Uses a decision table and records the decision in an ADR
  • Names what the chosen option is worse at

Red flags

  • Starts with a technology or a style ("microservices, obviously")
  • Says every attribute is critical
  • Never mentions cost, team or operations

📚 Learn in depth

1. Architecture is about the attributes, not the features

Almost any architecture can deliver the features. A to-do list works as a monolith, as microservices or as a set of Azure Functions. What differs is how well each delivers the non-functional qualities: how it scales, fails, changes and costs. That's why the SEI's Attribute-Driven Design and ATAM methods start from quality attributes.

Business goals ──► Quality attributes (ranked) ──► Scenarios (measurable)
        │                                            │
        ▼                                            ▼
   Constraints ──────────────► Candidate architectures ──► Decision table ──► ADR
                                        ▲
                         Team size, skills, platform

2. Quality attribute scenarios

A scenario has six parts: source, stimulus, environment, artefact, response and response measure. You rarely need all six in an interview, but the response measure is the key part, because it makes the attribute testable.

Attribute Stimulus Response measure
Performance 500 search requests/s during business hours p95 < 300 ms
Availability One availability zone fails Service continues, < 1 min of errors
Modifiability New payment method requested Shipped in < 5 developer days, no change outside Payments module
Security Stolen access token used Rejected after 5 min (token lifetime), event logged

These scenarios later become fitness functions: load tests, chaos experiments, architecture tests and SLO alerts.

3. Trade-offs are built in

Attributes interact. The classic tensions:

  • Availability vs consistency (CAP / PACELC): replicating data across regions means choosing between stale reads and higher latency.
  • Performance vs modifiability: indirection and module boundaries cost a little latency; collapsing them for speed couples code.
  • Scalability vs cost: scale-out, zone redundancy and premium tiers cost money every month.
  • Security vs usability and speed of delivery: MFA, approvals and audit trails slow people down.

Ranking forces the team to say which side wins when they conflict.

4. Constraints and Conway's law

Constraints remove options before scoring. Common ones in Australia:

  • Data residency: personal or health data kept in Australia East / Southeast, often a contract or IRAP requirement for government work.
  • Privacy Act 1988 and the APPs: collection minimisation, access requests, and Notifiable Data Breaches reporting push you towards clear data ownership and audit.
  • ACSC Essential Eight: patching, MFA and application control affect the platform you choose.

Conway's law says the system mirrors the communication structure of the organisation. If you have one team, a ten-service design will be maintained as a distributed monolith by that one team. The inverse Conway manoeuvre (shape teams to get the architecture you want) only works when you can actually change the org chart.

5. The decision table

                     Weight  Monolith  Modular monolith  Microservices
Modifiability          5        2            4                4
Cost                   4        5            4                2
Scalability            2        3            3                5
Deployability          3        3            3                5
Team fit (6 devs)      5        4            5                1
------------------------------------------------------------------
Weighted total                 63           77               59

The numbers aren't science; the value is that the team argues about weights and scores in the open, and the ADR captures why.

6. Reversible vs irreversible decisions

Jeff Bezos's "one-way and two-way doors" applies well. Choosing a logging library is a two-way door. Splitting the database per service, picking event sourcing, or picking a cloud provider are one-way doors. Spend analysis on the one-way doors and keep options open (for example, module boundaries in a monolith) until you have data.

Try it yourself

  1. Pick a system you know and write five quality attribute scenarios with response measures.
  2. Rank them with a colleague; note where you disagree and why.
  3. Build the weighted decision table above for your system with three options.
  4. Write a one-page ADR using the Michael Nygard template (context, decision, consequences).
  5. Turn one scenario into a fitness function: a k6 or Azure Load Testing script that fails the build if p95 exceeds the target.

💻 Code

A lightweight way to keep quality attribute scenarios honest is to store them as data next to the code and check them in CI.

docs/
  architecture/
    adr/
      0001-record-architecture-decisions.md
      0002-modular-monolith-on-app-service.md
    quality-attributes.json   # ranked scenarios, read by tests
src/
  Licensing.Api/
  Modules/
    Applications/
    Payments/
    Notifications/
tests/
  Licensing.ArchitectureTests/
  Licensing.LoadTests/
{
  "ranked": [
    { "attribute": "Modifiability", "scenario": "New fee rule ships in < 2 days, touching only the Payments module" },
    { "attribute": "Security",      "scenario": "Personal data stays in Australia East; every access is audited" },
    { "attribute": "Cost",          "scenario": "Hosting < 2000 AUD per month at current load" },
    { "attribute": "Performance",   "scenario": "p95 < 300 ms at 50 requests per second" }
  ]
}
namespace Licensing.ArchitectureTests;

using System.Text.Json;

// Keeps the ranked attribute list valid so ADRs and fitness functions can reference it.
public sealed record QualityAttribute(string Attribute, string Scenario);
public sealed record QualityAttributes(IReadOnlyList<QualityAttribute> Ranked);

public class QualityAttributeTests
{
    [Fact]
    public async Task Top_attributes_are_ranked_and_measurable()
    {
        await using var stream = File.OpenRead("docs/architecture/quality-attributes.json");
        var doc = await JsonSerializer.DeserializeAsync<QualityAttributes>(
            stream, new JsonSerializerOptions(JsonSerializerDefaults.Web));

        Assert.NotNull(doc);
        Assert.InRange(doc.Ranked.Count, 3, 5);          // force a real ranking
        Assert.All(doc.Ranked, qa => Assert.Matches(@"\d", qa.Scenario)); // each has a number
    }
}

⚠ Common mistakes

  • Mistake: Picking the architecture first ("we're doing microservices") and finding reasons afterwards. Why it is wrong: The decision ignores the actual drivers and usually overpays for scale nobody needs. Instead: Derive ranked quality attributes and constraints first, then score options.
  • Mistake: Listing every quality attribute as "high priority". Why it is wrong: Attributes conflict, so an unranked list can't settle any trade-off. Instead: Force a ranking of 3-5 and agree which wins in a conflict.
  • Mistake: Vague attributes like "must be scalable". Why it is wrong: Nobody can design or test against it. Instead: Write scenarios with a response measure: load, latency, recovery time, change lead time.
  • Mistake: Ignoring team size and skills. Why it is wrong: A small team can't operate many services, so delivery slows and on-call burns people out. Instead: Treat team topology and operational maturity as a hard constraint.
  • Mistake: Forgetting compliance constraints such as data residency and the Privacy Act. Why it is wrong: They can rule out a design late and force rework. Instead: Capture them on day one with the security and privacy people.
  • Mistake: Not writing the decision down. Why it is wrong: Six months later nobody remembers why, and the decision gets relitigated or silently eroded. Instead: Write an ADR with alternatives and consequences.
  • Mistake: Treating the decision as permanent. Why it is wrong: Drivers change: traffic grows, teams split. Instead: Set review triggers ("revisit when we pass 3 teams or 1,000 req/s") and fitness functions.

🏛 Senior insight: trade-offs

The senior move is to make the trade-offs explicit and cheap to revisit. I spend real analysis only on one-way doors: data ownership, event sourcing, cloud and region, synchronous vs asynchronous integration. For two-way doors I pick the simplest thing and move on. I also check what the platform already gives us before designing anything clever: Azure App Service with zone redundancy and Azure SQL Database's built-in high availability (zone-redundant configuration in the General Purpose, Business Critical and Hyperscale tiers, plus automated backups with point-in-time restore) often meet a 99.9-99.95% target on their own. Geo-replication or failover groups to Australia Southeast are an extra cost I add only when the recovery objectives demand regional failover.

I justify the decision to non-technical stakeholders in business terms, not architecture terms: "this option costs about $2k a month instead of $15k, gets the first release out three months sooner, and still lets us split Payments out if card volume grows tenfold." Then I treat it as iterative. I measure the outcome, not the diagram: DORA metrics (lead time, deployment frequency, change failure rate, time to restore), SLOs for the top scenarios, and hosting cost per month, and I review the ADR when production data contradicts the assumptions.

Option When it fits Cost When not to
Monolith One team, simple domain, early product Low Several teams fighting over one codebase
Modular monolith 1-4 teams, real domain complexity Low-medium; needs boundary discipline Parts need truly independent scaling or release cadence
Microservices Many teams, independent cadence, mature platform High: network, data consistency, ops Small team, unclear domain boundaries
Serverless (Functions) Spiky, event-driven, short tasks Low at low volume Long-running, latency-sensitive, chatty workloads

🔗 Follow-ups the interviewer may ask

  1. When: Candidate describes a decision table or matching architecture to system type Why: Checks they can apply the method to concrete systems with different drivers
    How to answer

    I pick per system, from its drivers, not one house style:

    • Admin app (simple rules, few users): layered or vertical slices, EF Core directly, server-rendered UI. Optimise for delivery speed; no DDD ceremony.
    • Insurance policy administration (complex, long-lived rules): a modular monolith aligned to bounded contexts (Policy, Rating, Claims, Billing), rich DDD aggregates, a Clean/hexagonal core per module, events between modules. Optimise for modifiability and correctness.
    • Payments platform (high scale, strict compliance): a few services split by scaling and PCI DSS scope, idempotent APIs, outbox/inbox, strong observability. Optimise for availability, security and auditability.

    Each choice goes in an ADR with options, consequences and revisit triggers. The trade-off: consistency across systems vs fit for each.

  2. When: Candidate mentions revisiting decisions or fitness functions Why: Checks they understand how to keep an architecture healthy as drivers change
    How to answer

    Evolutionary architecture (Ford, Parsons and Kua) is architecture designed to support guided, incremental change, rather than a fixed upfront design. The key tool is fitness functions: automated checks that protect the characteristics you care about, such as dependency rules (architecture tests), latency budgets, or startup time, run in CI or production. Around that, I keep boundaries modular (often a modular monolith first), make decisions reversible where possible and defer irreversible ones to the last responsible moment, record decisions in ADRs, and rely on continuous delivery, feature flags and observability so each change is small and safe.

  3. When: Candidate says attributes should be measurable Why: Checks they can make non-functional requirements testable
    How to answer

    A quality attribute scenario makes a non-functional requirement testable. It names the stimulus (what happens: 500 search requests a second), the environment (under what conditions: normal peak, one zone down) and the response measure (the number that decides pass or fail: p95 under 300 ms).

    A fitness function automates that check so it runs continuously:

    • a load test (Azure Load Testing or k6) run as a pipeline stage in Azure DevOps or GitHub Actions, with a pass/fail criterion like p95(response_time_ms) > 300 that fails the build;
    • an architecture test (NetArchTest, ArchUnitNET) that fails if Payments references Applications;
    • an SLO alert in Application Insights / Azure Monitor for what only production can show.

    Scenarios are revisited as load and priorities change. The trade-off: every fitness function costs pipeline time and upkeep, so automate the few attributes that really matter.

🛠 Real-world problems: how you handle them

Microservices proposal for a low-traffic, rule-heavy licensing system
Situation
A [state agency] needed a new licensing platform: about [40] requests a second at peak, rules that change every budget cycle, personal data that must stay in Australia, and a team of [6] .NET developers. The initial proposal from a vendor was [12] microservices on AKS.
Signals
Estimated hosting of [$15k] a month, no one on the team with Kubernetes on-call experience, and a delivery plan where the first [4] months were platform work with no user-visible features.
Investigation
I ran a two-hour quality attribute workshop with the product owner, security and operations, produced ranked scenarios, and built a weighted decision table for monolith, modular monolith and microservices. I checked load forecasts against Azure App Service benchmarks and drew a C4 container diagram for each option to show the operational footprint.
Resolution
We agreed a modular monolith on Azure App Service (zone redundant) with Azure SQL in Australia East, with module boundaries aligned to the [Applications, Assessment, Payments, Notifications] subdomains. The decision and the rejected options went into ADR-0002 with explicit triggers for revisiting.
Prevention
Architecture tests (ArchUnitNET) guard module boundaries; a monthly review of DORA metrics and hosting cost; the ADR lists triggers (more than [3] teams, sustained load over [500] req/s) that reopen the decision.

How to tell it (STAR)

**S:** At [company] we were starting a licensing platform for [a state agency], and the vendor proposal was [12] microservices on AKS for a team of [6]. **T:** I was asked to recommend the architecture and get agreement from the product owner and security. **A:** I ran a quality attribute workshop, ranked modifiability, security and cost above scalability, and built a weighted decision table with hosting estimates. I showed that peak load was [40] req/s and that the team had no Kubernetes on-call experience. I proposed a modular monolith on App Service and wrote ADR-0002 with clear triggers for splitting later. **R:** We shipped the first release [3] months earlier than the original plan, rule changes averaged [1.5] days, and hosting came in at about [$2k] a month instead of [$15k].

↩ Usually asked after

More in Senior-Level Architecture

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me