Scrivio Interview library

Java versions and evolution

32 questions in 10 subtopics.

Java 8 features

ConceptFoundations6 min read
Name the main language and library features of Java 8 and explain why default methods were needed for the others to work.
ScenarioIntermediate6 min read
A codebase uses Java 8 features heavily but in a dated style: anonymous classes, Optional.get() everywhere, and streams with side effects. You are reviewing it before a Java 21 upgrade. What do you prioritise changing and why?

Java 9 to 17 features

ConceptFoundations5 min read
List the most useful features added between Java 9 and Java 17 for everyday code, with the release each became final.
CodingFoundations6 min read
Rewrite in Java 17 style:
if (shape instanceof Circle) {
Circle c = (Circle) shape;
return Math.PI * c.r() * c.r();
} else if (shape instanceof Square) {
Square s = (Square) shape;
return s.side() * s.side();
}
throw new IllegalStateException();
ConceptIntermediate6 min read
Which JVM and runtime changes between Java 9 and 17 affect operations teams, as opposed to language features?

Java 21 LTS features

ConceptFoundations6 min read
What are the headline features of Java 21 LTS that became final in that release?
CodingFoundations6 min read
Use Java 21 record patterns and switch to write an evaluator for:
sealed interface Expr permits Num, Add, Mul {}
record Num(int v) implements Expr {}
record Add(Expr l, Expr r) implements Expr {}
record Mul(Expr l, Expr r) implements Expr {}
ScenarioIntermediate6 min read
Your team plans to switch a Spring Boot 3 service from a platform thread pool to virtual threads after upgrading to Java 21. What do you check before and after enabling them?

Java 25 LTS features

ConceptFoundations6 min read
Which features became final in Java 25 LTS that an application developer is likely to use?
ConceptIntermediate7 min read
Which Java 22 to 25 runtime changes matter for performance and operations of services moving from 21 to 25?
ScenarioAdvanced6 min read
Your organisation is on Java 21. Build the case for or against moving the fleet to Java 25 within a year, and describe how you would decide.

Release cadence and LTS

ConceptFoundations5 min read
Describe the Java release cadence since Java 10 and what LTS means. Which recent releases are LTS?
LeadershipAdvanced5 min read
Should your organisation follow every six-month Java release or stay on LTS releases only? Argue both sides and give your policy.
LeadershipPrincipal7 min read
Why did Java move from multi-year releases like Java 8 and 9 to a six-month cadence, and how has that changed how a company should plan its Java platform?

Preview and incubator features

ConceptFoundations6 min read
What is the difference between a preview feature and an incubator module in the JDK? How do you enable each?
LeadershipAdvanced6 min read
A team wants to use structured concurrency, still in preview in Java 25, in a production service. What is your policy and why?

Upgrading across LTS versions

DebuggingIntermediate7 min read
After upgrading from Java 8 to 17, a service fails with java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext. Why, and what else was removed in the same way?
ScenarioIntermediate7 min read
Plan the upgrade of a Spring Boot 2.7 service on Java 11 to Java 21. What has to change and in which order?
DesignAdvanced6 min read
Design a fleet-wide process for upgrading 500 services across LTS versions every two years with minimal disruption.
LeadershipPrincipal6 min read
Design a standing LTS upgrade programme for a company that will go through Java 25, 29 and later releases over the next decade. What is the sequencing, who owns what, and how do you fund it?
LeadershipPrincipal6 min read
Many companies stayed on Java 8 for close to a decade. What did that cost them, and how would you prevent the same situation in your organisation?

OpenJDK distributions and licensing

ConceptFoundations5 min read
What is the relationship between OpenJDK and builds such as Eclipse Temurin, Amazon Corretto, Azul Zulu, Microsoft Build of OpenJDK and Oracle JDK?
LeadershipAdvanced6 min read
Your company uses Oracle JDK on many servers and finance has raised licensing cost concerns. How do you assess options and plan a change?
LeadershipPrincipal6 min read
How should a large company decide its Java runtime vendor strategy for the next ten years, considering licensing, support, security patch speed and cloud providers?

Java 26 and later features

ConceptFoundations6 min read
How do you find out which features are in Java 26 and later releases, and how do you tell final features from preview or incubating ones before using them?
ScenarioIntermediate6 min read
Your team wants to adopt a feature that is final in Java 26 but your platform runs Java 25 LTS. What options do you have and what do you recommend?
LeadershipAdvanced6 min read
Design a process for evaluating each new six-monthly Java release (26, 27 and so on) for your 300-service fleet without adopting every release.
LeadershipPrincipal6 min read
Given the six-month release cadence, how do you explain to executives why the company needs a standing Java platform budget rather than one-off upgrade projects?

OpenJDK projects: Amber, Loom, Valhalla, Panama, Leyden

ConceptFoundations6 min read
Explain in one or two sentences each what Projects Amber, Loom, Valhalla, Panama and Leyden aim to do, and name one delivered result of each where one exists.
ScenarioIntermediate7 min read
A team proposes replacing JNI code with the Foreign Function and Memory API, and another wants to use the Vector API in production. How do you evaluate each?
DesignAdvanced7 min read
How should Project Leyden's startup and warm-up work affect your platform's choice between JVM with AOT cache, GraalVM native image and CRaC for fast-scaling services?
LeadershipPrincipal6 min read
Several long-running OpenJDK projects (Valhalla over ten years, Loom over five) changed Java substantially once delivered. How should a company factor such projects into a long-term technology strategy?