Scrivio Interview library

Utility libraries

21 questions in 5 subtopics.

Guava

ConceptFoundations6 min read
Which Guava features are still useful in a Java 25 codebase, and which have been replaced by the JDK? Give examples of each.
CodingFoundations6 min read
Using Guava, group a list of Order(customerId, amount) into a Multimap of customer id to orders, then print each customer's total. How would you do the same with only the JDK?
DebuggingIntermediate7 min read
After adding a new library, a service fails at startup with java.lang.NoSuchMethodError: 'com.google.common.collect.ImmutableMap com.google.common.collect.ImmutableMap.of(...)' from another dependency. Explain the cause and how you resolve it in Maven or Gradle.
LeadershipAdvanced6 min read
Guava is on the classpath of nearly every service in your organisation, often in conflicting versions pulled in transitively. Do you standardise on one version, ban it, or leave it alone?
DesignPrincipal7 min read
Your platform team maintains an internal 'commons' library that duplicates parts of Guava and Commons Lang plus company-specific helpers; 300 services use it. Do you keep investing in it?

Apache Commons Lang and Collections

ConceptFoundations6 min read
Which Apache Commons Lang 3 utilities do you still reach for, and which are better replaced by JDK methods? Mention StringUtils.isBlank versus String.isBlank.
ScenarioIntermediate7 min read
A security scan flags commons-collections 3.2.1 in an old service, referencing deserialisation gadget chains. Explain the risk and what to do.
DesignAdvanced7 min read
Your shared internal library depends on Commons Lang, Commons IO, Guava and Jackson. Consumers complain about version conflicts. How do you redesign the dependency approach of the shared library?
LeadershipPrincipal7 min read
Apache Commons components are maintained by volunteers, and many of your critical systems depend on them. What responsibility does a large company have toward such projects, and how do you act on it?

MapStruct

CodingFoundations7 min read
Write a MapStruct mapper from Order(id, customer, lines, createdAt) to OrderDto(orderId, customerName, lineCount, createdDate), and explain what MapStruct generates and when.
DesignIntermediate6 min read
Compare MapStruct with ModelMapper and hand-written mapping code for a service with 80 DTOs. Which would you choose and why?
LeadershipAdvanced6 min read
Teams increasingly generate code with annotation processors (Lombok, MapStruct, Immutables). Should your platform standards encourage, restrict or ban them?
LeadershipPrincipal6 min read
Across your company, mapping between layers (entity, domain, DTO, event) accounts for a large share of code and bugs. What architectural guidance would you give to reduce mapping cost without coupling layers?

Vavr and functional libraries

ConceptFoundations6 min read
What does Vavr offer that the JDK does not, for example Try, Either and persistent collections? Show how Try replaces a try-catch.
ScenarioIntermediate6 min read
A team rewrote a Spring service using Vavr Either and Try everywhere. New hires struggle, stack traces are hard to read and the code mixes with Spring's exception handling. How would you review this?
DesignAdvanced6 min read
A team proposes adopting a functional effects library (for example Vavr or a reactive library) as the standard way to write business logic in all new services. How do you evaluate the proposal?
LeadershipPrincipal6 min read
Over 20 years Java absorbed ideas from Guava, Joda-Time, Vavr and Lombok into the JDK (collections factories, java.time, records, pattern matching). What does this pattern mean for how you choose third-party libraries today?

Choosing and upgrading libraries

ScenarioFoundations6 min read
Dependabot opened 25 pull requests for library upgrades in your service. How do you handle them safely and efficiently?
DesignIntermediate7 min read
What criteria do you apply before adding a new third-party library to a production service?
LeadershipAdvanced6 min read
Your company has 400 services with libraries several major versions behind, and upgrades are blocked by fear of breakage. How would you create a sustainable upgrade practice?
LeadershipPrincipal7 min read
After Log4Shell and several supply chain attacks, the board asks how the company governs open-source libraries. What governance model do you put in place?