Scrivio Interview library
LeadershipAdvanced6 min read · updated 12 November 2026

Your 300 services each pull hundreds of jars, and duplicate or conflicting classes cause recurring incidents. What standards would you put in place for dependency and classpath hygiene?

I would set standards in four layers: a company BOM or platform that aligns the versions of common libraries and is updated on a schedule, build checks that fail on dependency divergence, banned dependencies and duplicate classes, automated update tooling such as Renovate or Dependabot with test gates so drift stays small, and a habit of keeping shared libraries small with few transitive dependencies. An SBOM generated for every build then shows which jars run where, which also answers security questions in minutes.

Why this question is asked

With a handful of services, dependency conflicts are an occasional annoyance fixed by whoever hits them. With 300 services, each pulling hundreds of jars, they become a recurring class of incident: NoSuchMethodError after an upgrade, two logging bindings fighting, a class loaded from the wrong jar. At that scale the problem is not technical skill but the absence of shared rules. Interviewers ask this leadership question to see whether we can design standards that teams will actually follow. In this answer, we will recap why conflicts keep happening, then go through version alignment, build checks, automated updates, library design and SBOMs, and finish with how to roll the standards out.

1Why Conflicts Keep Happening

Each service's build resolves one version of every library from many requests: its own declarations, its frameworks, its internal shared libraries and their transitive dependencies. When those requests disagree, the build tool silently picks one, and at run time the class path's first-wins rule silently ignores any duplicate class. Neither step warns anyone. A conflict that is harmless today becomes an incident when one library is upgraded and starts calling a method the selected version does not have.

At 300 services, every team makes these choices independently, so the same conflict is discovered, debugged and fixed dozens of times, and services drift years apart in their versions. The goal of the standards is to make conflicts rare, visible at build time, and fixed once for everyone.

2Align Versions With a Company Platform

The first standard is a company bill of materials, a BOM, or in Gradle a platform, that pins versions of the libraries most services use: the framework, logging, JSON, HTTP clients, database drivers, observability and internal libraries. Services import it instead of choosing versions themselves. For Spring shops, the company BOM imports Spring Boot's own dependency management and then adds the internal libraries and a few overrides on top, so we benefit from Boot's tested combinations rather than rebuilding them.

XML
<!-- every service's pom.xml -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.acme.platform</groupId>
<artifactId>acme-platform-bom</artifactId>
<version>2026.11.0</version> <!-- one version number covers hundreds of libraries -->
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

The BOM is owned by a platform team and released on a schedule, for example monthly, plus urgent releases for security fixes. Each release is tested against a set of representative services before publication. Teams then upgrade one version number instead of fifty, and two services on the same BOM release are known to run the same versions.

3Fail the Build on Divergence and Duplicates

Alignment only works if the build refuses to drift. Three checks belong in a shared parent build or build plugin. Dependency convergence, the Maven Enforcer dependencyConvergence rule or Gradle's failOnVersionConflict, fails when two paths request different versions of the same artifact without an explicit decision. Banned dependencies fail when a service pulls in artifacts we have decided against, such as a second logging binding, the old javax namespace after a Jakarta migration, or libraries with known vulnerabilities. And duplicate class detection, for example the Maven duplicate-finder plugin or the extra-enforcer-rules banDuplicateClasses rule, fails when two jars on the class path contain the same class, which no version check can catch because the jars have different names.

Build checks and what each one catches
CheckCatchesTypical tool
Dependency convergencetwo versions of one artifact requestedMaven Enforcer, Gradle failOnVersionConflict
Banned dependenciesartifacts we decided againstEnforcer bannedDependencies
Duplicate classessame class in two differently named jarsduplicate-finder, banDuplicateClasses
Known vulnerabilitiesversions with published CVEsdependency scanning in CI

We roll these out in report-only mode first, publish the counts per team, and switch them to failing once the backlog is small, so the checks do not block every team on day one.

4Keep Drift Small With Automated Updates

Conflicts grow with the distance between versions. A service three years behind faces dozens of breaking changes at once; a service one month behind faces one or two. Automated update tools such as Renovate or Dependabot open pull requests when a new BOM release or library version appears, and the service's tests decide whether the change can merge. With good tests, most updates merge automatically; the rest get a human look.

The standard I would set is measurable: every service runs a BOM release no more than three months old, with a dashboard by team. Being behind becomes visible, and the platform team can see which upgrades are hard for many services and help with them centrally.

5Keep Shared Libraries Small

Many conflicts come from internal shared libraries that drag large transitive trees into every service: a common library that depends on a specific HTTP client, a database driver and a JSON library forces those versions on everyone who uses it. The standard is that shared libraries expose small APIs, declare as few dependencies as possible, mark framework dependencies as provided or optional where they are only needed for integration, and never bundle unshaded third-party copies. A library that needs a dependency only internally can shade it with relocated packages, at the cost of a larger jar.

6Generate an SBOM for Every Build

Finally, every build publishes a software bill of materials, an SBOM, in a standard format such as CycloneDX or SPDX, listing every jar and its version in the artifact. Stored centrally, SBOMs answer questions that otherwise take days: which services run version X of a library, which are affected by a new vulnerability, which still carry the old namespace. During a security incident, that is the difference between an answer in five minutes and a week of asking teams. The same data feeds the drift dashboard and shows whether the standards are working.

Step throughDependency hygiene standards, from build to fleet
  1. Company BOMone version set, released monthly
  2. Build checksconvergence, banned dependencies, duplicate classes
  3. Automated updatesRenovate or Dependabot with test gates
  4. Small shared librariesfew transitive dependencies
  5. SBOM per buildwhat runs where, for operations and security

5 layers, from the top down. Step through them one at a time.

7Follow-up questions

How do you get 300 teams to adopt this?

By making the standard path the easiest one. The platform team publishes a parent build or build plugin that includes the BOM and the checks, provides automated update pull requests so teams do little manual work, starts every check in report-only mode, and fixes the hardest shared upgrades centrally. Progress is visible on a dashboard, and new services start from a template that already complies.

What about a team that genuinely needs a different version?

They override it explicitly in their build, with a comment and a ticket, and the convergence check accepts it because the decision is now visible. The platform team reviews such overrides periodically; if many teams need the same override, the BOM is probably wrong.

8Conclusion

In this answer, we saw that dependency conflicts recur because builds and class paths silently pick one version or one copy, and that at 300 services the fix is shared standards. A company BOM aligns versions and is released on a schedule, build checks fail on divergence, banned dependencies and duplicate classes, automated updates with test gates keep drift small, shared libraries stay small to avoid dragging transitive trees, and an SBOM per build shows what runs where. Rolled out with report-only checks first and a compliant service template, these turn a recurring incident type into a build failure.

What to say in the interviewAbout 90 seconds aloud

Open with

At that scale the problem is not that people cannot fix conflicts, it is that every team fixes the same conflict separately, and builds and class paths pick a version or a duplicate class silently.

Then, if they want more

So I would set standards in layers. First, a company BOM or Gradle platform that pins versions of the common libraries, built on Spring Boot's dependency management plus our internal libraries, owned by a platform team and released on a schedule, say monthly, with urgent security releases. Services import one BOM version instead of choosing fifty.

Second, build checks in a shared parent: dependency convergence, banned dependencies such as duplicate logging bindings, and duplicate class detection with something like the Maven duplicate-finder plugin, because two different jars can contain the same class and no version check sees that. I would start them in report-only mode and make them fail once the backlog is small.

Third, automated updates with Renovate or Dependabot and test gates, with a target such as no service more than three months behind the BOM, so drift stays small. Fourth, a rule that shared libraries keep small APIs and few transitive dependencies, so they do not force versions on everyone.

And finally, an SBOM generated for every build and stored centrally, so we can answer which services run which jars, which is also what security needs during a vulnerability.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Your 300 services each pull hundreds of jars, and duplicate or conflicting classes cause...": https://scrivio-interview-library.netlify.app/java/class-loading/391da2b2a9/