Quick revision
The short answer
I would start with an inventory of every condition and the properties that drive it, because many turn out to be unused. Then reduce the number of switches, give each remaining one an owner and documentation, and cover the supported combinations with ApplicationContextRunner tests. Each service should expose its resolved configuration at startup or through actuator, and deprecated options are removed on a published schedule, so the surface keeps shrinking over the coming years.
What to remember
In this answer, we brought hundreds of starter conditions under control. We inventoried the conditions and the properties behind them, joined that with usage data from each service, and removed or simplified the switches that carried no real choice. The remaining switches got owners and documentation, the supported combinations got ApplicationContextRunner tests with bean snapshots, each service exposes what it resolved, and deprecated options are removed on a published schedule.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would start with an inventory of every condition and the properties that drive it, because many turn out to be unused. Then reduce the number of switches, give each remaining one an owner and documentation, and cover the supported combinations with ApplicationContextRunner tests. Each service should expose its resolved configuration at startup or through actuator, and deprecated options are removed on a published schedule, so the surface keeps shrinking over the coming years.
Why this question is asked
Internal starters grow by accretion: each team that needed something different got a new property and a new condition. After a few years, the result is hundreds of switches, and nobody can predict which beans a given service ends up with, so upgrades are scary and incidents are hard to explain. This is not a bug to fix in a week but a system to bring under control over years. Interviewers ask this scenario to see whether we can combine measurement, simplification, testing and a deprecation process. In this answer, we will recap why conditions multiply, take an inventory, reduce and own the switches, test the supported combinations, make each service's result visible, and run a deprecation schedule.
1Why Conditions Multiply
Every condition in a starter, such as @ConditionalOnProperty or @ConditionalOnMissingBean, is a switch that can change which beans exist. Two independent on and off switches give four possible configurations; ten give 1,024. Most of those combinations were never tested, and some contradict each other. Conditions are cheap to add and almost never removed, because nobody knows who still relies on them. So the number only grows, and with it the uncertainty.
2Taking an Inventory
We cannot reduce what we cannot see. The first step is a list of every condition in the internal starters, with the property or class that drives it and its default. Much of this can be generated: the configuration metadata files list the properties, and a small scan of the starters' bytecode or sources lists the condition annotations.
The second half of the inventory is usage. Each service can report its condition evaluation report, the record Spring Boot keeps of which conditions matched, at startup, to a central place, or we collect the effective values of the starter properties from deployment configuration. Joining the two tells us, for each switch, how many services set it to something other than the default.
| Group | Share of switches | Action |
|---|---|---|
| Never changed from the default | about half | Remove the switch, keep the default |
| Same non-default value everywhere | some | Change the default, then remove |
| Used by one or two services | some | Move into those services |
| Real variation across services | the rest | Keep, own and document |
3Reducing the Switches and Giving Each an Owner
With usage data, the reduction becomes ordinary work. A switch no service changes can be removed. A switch that every service sets the same way means the default is wrong: change the default, then remove the switch. A switch used by one service is often a sign that the behaviour belongs in that service rather than the shared starter, which it can provide by defining its own bean, since @ConditionalOnMissingBean lets it override ours.
The switches that remain get an owner, a team responsible for its behaviour and its questions, and documentation in the configuration metadata: what it does, what the default is, and when to change it. A new switch now requires the same: an owner, a description and a test, enforced in the starter's review checklist. That stops the growth while we reduce the existing set.
4Testing the Supported Combinations
We cannot test 1,024 combinations, and we do not need to. We define the supported combinations, usually the default plus a handful of documented variants such as 'no Micrometer', 'custom client bean' or 'feature disabled', and test each with ApplicationContextRunner, which starts a small context with the auto-configurations in milliseconds. Anything outside the supported set is explicitly unsupported.
Comparing against a stored snapshot of expected bean names is a cheap way to turn 'nobody can predict which beans a service gets' into a reviewed list: any change to the bean set of a supported combination shows up in the pull request.
5Making Each Service's Result Visible
Even with fewer switches, each service needs to be able to answer what it actually got. Spring Boot already has the data: the condition evaluation report and the actuator conditions and configprops endpoints. The platform starter can add a compact startup line listing the active platform features and their key settings, and the central usage report from the inventory step can keep running, so the platform team always knows which features are used where.
6Removing Options on a Published Schedule
Removal is where these efforts usually stall, because removing a switch breaks someone. A published schedule makes it predictable. An option is first marked deprecated in the metadata with a reason and a replacement, so IDEs warn developers, and the starter logs a warning at startup when it is set. The release notes announce the removal version, typically two minor releases later. The usage report shows which services still set it, so the platform team can contact them directly. Then the option is removed on the announced date, not postponed indefinitely.
- Usage report shows few usersor a better default exists
- Mark deprecated in metadatareason and replacement; startup warning
- Announce removal versionfor example two minor releases later
- Still used by services?YesContact owners, help them migrateNoRemove on the announced release
4 steps in order. Play them, or step through them one at a time.
7Follow-up questions
How long does a program like this take?
Typically a few quarters to see the benefit and a couple of years to reach a steady state, depending on how many services and starters there are. The inventory and the stop-the-growth rule take weeks; removal takes longer because it follows the release schedule and the services' own upgrade pace.
Should we split the starters instead of reducing conditions?
Sometimes. If a starter combines unrelated features, splitting it means services only add what they need, and many conditions disappear because the choice becomes a dependency instead of a property. But splitting without reducing switches just moves the problem into more jars.
What if a team insists on keeping a rarely used option?
We ask what it does for them and whether they can provide the behaviour themselves by defining their own bean, which the starter's @ConditionalOnMissingBean allows. If the option really serves an important need, it stays with that team as its owner, documented and tested.
8Conclusion
In this answer, we brought hundreds of starter conditions under control. We inventoried the conditions and the properties behind them, joined that with usage data from each service, and removed or simplified the switches that carried no real choice. The remaining switches got owners and documentation, the supported combinations got ApplicationContextRunner tests with bean snapshots, each service exposes what it resolved, and deprecated options are removed on a published schedule.
Open with
The core problem is combinatorial: every condition is a switch, and ten independent switches already give over a thousand possible configurations, most never tested. So I would run it as a multi-year program in five parts.
Then, if they want more
First, an inventory: list every condition in the starters with its driving property and default, which the configuration metadata mostly gives us, and collect usage from each service, for example by reporting the condition evaluation results for our own auto-configurations at startup. That usually shows that about half the switches are never changed.
Second, reduce: remove switches nobody changes, change defaults that everyone overrides the same way, and move one-service options into that service, which can override our beans thanks to ConditionalOnMissingBean. Every remaining switch gets an owner and documentation, and new ones need an owner, a description and a test.
Third, testing: define the supported combinations and test each with ApplicationContextRunner, comparing the resulting bean set to a reviewed snapshot. Fourth, visibility: each service exposes its resolved platform configuration through a startup line and the actuator conditions and configprops endpoints.
Fifth, deprecation on a published schedule: mark options deprecated in metadata, warn at startup, announce the removal release, contact remaining users from the usage report, and then actually remove them on time.
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.
- Official documentation
- Spring Framework reference, Core technologies
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 internal starters have grown to hundreds of conditions, and nobody can predict...": https://scrivio-interview-library.netlify.app/spring-boot/spring-configuration/d43730ce33/