Utility libraries
21 questions in 5 subtopics.
Guava
Which Guava features are still useful in a Java 25 codebase, and which have been replaced by the JDK? Give examples of each.Using Guava, group a list ofOrder(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?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.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?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
Which Apache Commons Lang 3 utilities do you still reach for, and which are better replaced by JDK methods? MentionStringUtils.isBlank versus String.isBlank.A security scan flags commons-collections 3.2.1 in an old service, referencing deserialisation gadget chains. Explain the risk and what to do.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?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
Write a MapStruct mapper fromOrder(id, customer, lines, createdAt) to OrderDto(orderId, customerName, lineCount, createdDate), and explain what MapStruct generates and when.Compare MapStruct with ModelMapper and hand-written mapping code for a service with 80 DTOs. Which would you choose and why?Teams increasingly generate code with annotation processors (Lombok, MapStruct, Immutables). Should your platform standards encourage, restrict or ban them?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
What does Vavr offer that the JDK does not, for example Try, Either and persistent collections? Show how Try replaces a try-catch.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?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?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
Dependabot opened 25 pull requests for library upgrades in your service. How do you handle them safely and efficiently?What criteria do you apply before adding a new third-party library to a production service?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?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?No question matches these choices.