Quick revision
The short answer
I would require every team to bind each group of properties with @ConfigurationProperties under a prefix that names the team or service, never scattered @Value annotations for groups. Each class carries safe defaults in code, so environments supply only what really differs, and @Validated constraints for required values, so misconfiguration fails at startup. The build generates configuration metadata with spring-boot-configuration-processor, and the platform turns that metadata into a catalogue page listing every service's properties for operators.
What to remember
In this answer, we designed configuration conventions for a fleet: a prefix per team or service, typed @ConfigurationProperties classes instead of scattered @Value, safe defaults in code with only real differences per environment, @Validated constraints so misconfiguration fails at startup, and metadata from the configuration processor turned into a generated catalogue for operators. Putting all of it into the shared build template and platform starter makes the conventions the default rather than a burden.
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 require every team to bind each group of properties with @ConfigurationProperties under a prefix that names the team or service, never scattered @Value annotations for groups. Each class carries safe defaults in code, so environments supply only what really differs, and @Validated constraints for required values, so misconfiguration fails at startup. The build generates configuration metadata with spring-boot-configuration-processor, and the platform turns that metadata into a catalogue page listing every service's properties for operators.
Why this question is asked
With 100 services, configuration stops being a detail of each codebase and becomes something operators, platform engineers and other teams have to work with every day. Without conventions, each service invents its own names, defaults hide in code, and the only way to learn what a service accepts is to read its source. Interviewers ask this design question to see whether we can set standards that are easy to follow, cheap to check and useful to the people running the system. In this answer, we will go through the five requirements one by one, prefixes and typed properties, defaults, validation, metadata and the catalogue, and then see how to roll them out without slowing teams down.
1Prefixes That Say Who Owns a Property
A prefix is the first part of a property name, such as payments in payments.client.timeout. In a fleet, the prefix answers the first question during an incident: who owns this value? So I would require a prefix per service or team for everything the team defines, for example payments.*, orders.* or search.*, and forbid custom properties directly under Spring Boot's own namespaces such as server.* or spring.*.
Inside the prefix, names follow Spring Boot's style: lower case kebab-case, grouped by component, such as payments.client.base-url and payments.client.timeout. Shared platform libraries get their own prefix, such as platform.tracing.*, so a service property can never collide with a library property.
2Typed Properties Instead of Scattered @Value
Each group of related properties gets a @ConfigurationProperties class, usually a record. That gives one place that lists everything a feature reads, typed values such as Duration and DataSize instead of strings parsed by hand, full relaxed binding, and the hooks for validation and metadata. @Value remains acceptable for a single isolated value, but a review that finds three @Value annotations for the same prefix asks for a properties class.
Notice how much this small class tells an operator: three keys, their types, which one is required, the defaults and the allowed range. Everything below in this design builds on classes like this one.
3Safe Defaults in Code, Differences per Environment
The default for each property lives in the class, next to the field, and it must be safe in any environment: a modest pool size, a short timeout, a feature switched off. Environments then supply only what really differs, typically URLs, credentials references and sizes for production load. A production values file with five entries is easy to review; one with eighty copied defaults hides the two values that matter.
Some values have no safe default, the provider URL in our example. Those get no default and a @NotNull or @NotBlank constraint, so forgetting them is impossible rather than silently wrong.
4Validation That Fails at Startup
Every properties class carries @Validated and constraints for required values and ranges. A misconfigured service then refuses to start, with a message that names the property, the bad value and where it came from. In Kubernetes that shows up as a pod that never becomes ready during a rollout, so the rollout stops on the first pod and the old version keeps serving traffic. Compare that with a service that starts happily and fails on the first payment.
5Metadata and a Catalogue for Operators
The spring-boot-configuration-processor reads the properties classes during the build and writes META-INF/spring-configuration-metadata.json into the jar, with each property's name, type, default and description taken from the Javadoc. IDEs use it for completion in application.yml, and we can use it too.
The platform pipeline extracts that file from every service's build and publishes it as a generated page per service: property, type, default, description, and whether it is required. Operators get one catalogue to look up what a service accepts, and because it is generated from the code, it is never out of date. The same data lets CI flag unknown properties in a values file, a common typo such as payments.client.time-out that would otherwise be ignored silently.
- Team writes a @ConfigurationProperties recordprefix, types, defaults, constraints, Javadoc
- Build runs the configuration processorwrites
spring-configuration-metadata.json - Pipeline extracts the metadataone file per service version
- Catalogue page is generatedproperty, type, default, required, description
- CI checks values files against itunknown or deprecated keys fail the build
5 steps in order. Play them, or step through them one at a time.
6Rolling Out the Conventions
Standards only work if following them is the easy path. I would put the processor dependency, a properties class template and the metadata extraction into the shared build template and platform starter, so new services comply by default. An ArchUnit test in the shared test library can flag @Value annotations whose keys share a prefix, and the unknown-key check runs in the same pipeline that deploys the service.
For the existing 100 services I would not demand a rewrite. Teams convert their configuration when they next change it, starting with the services that caused configuration incidents, and the catalogue itself shows progress, because a service with no metadata has an empty page that everyone can see.
| Requirement | How it is checked |
|---|---|
| Prefix per team or service | review rule and catalogue listing |
@ConfigurationProperties for groups | ArchUnit test in the shared test library |
| Safe defaults in code | review; prod values file stays short |
@Validated for required values | CI context start per environment |
| Generated metadata | pipeline fails if the metadata file is missing |
7Follow-up questions
Why forbid custom properties under spring.* or server.*?
Because those namespaces belong to Spring Boot and its libraries. A custom spring.payments.timeout may collide with a future Spring property, confuses readers about who owns it, and does not appear where people look for the team's settings.
Where should secrets fit in these conventions?
The properties class can hold a secret value, such as a password, but its source should be a secret store or a mounted secret file, never a default in code or a values file in Git. The catalogue marks such properties as secret and does not show their values.
How do you deprecate a property safely?
Keep binding the old name for a release, mark it deprecated in additional metadata with its replacement, and let the CI check warn on values files that still use it. Spring Boot's properties migrator module can also report renamed properties at startup during a migration.
8Conclusion
In this answer, we designed configuration conventions for a fleet: a prefix per team or service, typed @ConfigurationProperties classes instead of scattered @Value, safe defaults in code with only real differences per environment, @Validated constraints so misconfiguration fails at startup, and metadata from the configuration processor turned into a generated catalogue for operators. Putting all of it into the shared build template and platform starter makes the conventions the default rather than a burden.
Open with
I would ask every team for five things. First, a prefix that names the team or service, like payments, for all their own properties, in kebab-case, and nothing custom under spring or server.
Then, if they want more
Second, every group of related properties is bound with a @ConfigurationProperties class, normally a record, so there is one typed place listing what a feature reads. No scattered @Value annotations for groups. Third, safe defaults in code with @DefaultValue, so each environment only supplies what really differs, and the production values file stays short enough to review.
Values with no safe default, like an API URL, get no default. Fourth, @Validated with constraints for required values and ranges, so a misconfigured pod fails at startup with the property, value and origin in the message, and a rollout stops on the first pod.
Fifth, the spring-boot-configuration-processor in the build, so each jar contains metadata with names, types, defaults and Javadoc descriptions. The platform then extracts that metadata into a generated catalogue page per service for operators, and CI uses it to reject unknown or deprecated keys in values files, which catches typos.
To make this stick, I would put the processor, a template and the checks into the shared build template and platform starter, and convert existing services as they change.
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 Boot reference
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 "Design the configuration conventions for 100 services: property prefixes, typed...": https://scrivio-interview-library.netlify.app/spring-boot/externalized-configuration/3d1ca6f2dd/