Interview Prep Zoneby CuriouserLabs

Question 2 of 5 · architect level

What exactly is a starter? Design a company-internal starter for your platform team.

🎤 Say this first

A starter is just a dependency descriptor — a (usually empty) jar whose POM pulls a curated, version-aligned set of libraries; the paired auto-configuration jar does the wiring. A platform starter (e.g., acme-spring-boot-starter-observability) encodes organizational defaults — logging format, tracing, security headers, error contract, metrics tags — so every service gets policy-as-dependency: add one line to the build, get the paved road. Design rules: conditions everywhere so teams can override, properties with your own prefix, and back off from any user-defined bean.

The full picture

Anatomy of acme-starter-audit
// module 1: acme-audit-spring-boot-autoconfigure
@AutoConfiguration
@ConditionalOnClass(AuditClient.class)
@EnableConfigurationProperties(AcmeAuditProperties.class)
public class AcmeAuditAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean                       // team can replace it
    @ConditionalOnProperty(prefix = "acme.audit",   // team can disable it
        name = "enabled", havingValue = "true", matchIfMissing = true)
    AuditClient auditClient(AcmeAuditProperties props) {
        return new AuditClient(props.endpoint(), props.bufferSize());
    }
}
// + META-INF/spring/…AutoConfiguration.imports listing the class
// + config metadata json -> IDE completion for acme.audit.*

// module 2: acme-audit-spring-boot-starter — empty jar, POM depends on
// autoconfigure module + audit client lib. Teams add ONE dependency.
  • Why platform teams love this: upgrades ship as version bumps (Renovate PRs) instead of migration wikis; compliance ('all services must log X') becomes a dependency, auditable from the build graph.
  • Design discipline: never force — every bean @ConditionalOnMissingBean, every feature toggleable by property, sensible matchIfMissing. A starter that can't be overridden becomes a fork magnet.
  • Version alignment: manage through your own BOM importing Spring Boot's; starters should not pin versions Spring's BOM already manages.
  • Testing: ApplicationContextRunner lets you assert conditions in plain unit tests — starter without tests = platform-wide blast radius.

🔄 Likely follow-up questions

  • How do you roll out a breaking change in an internal starter across 80 services?
  • Starter vs shared library with manual config — where's the line?
  • How do you keep starters from becoming a god-dependency that slows every build?