Scrivio Interview library

Native images and AOT

16 questions in 4 subtopics.

GraalVM native image

ConceptFoundations6 min read
Explain what GraalVM native image does at build time and why it makes Java applications start faster and use less memory.
CodingFoundations6 min read
Describe how you build and test a Spring Boot 3 application as a native image with Maven or Gradle, and what you need installed.
DebuggingIntermediate6 min read
A Spring Boot native image builds successfully but fails at runtime with a ClassNotFoundException from a JSON library used through reflection. How would you diagnose and fix it?
ScenarioAdvanced6 min read
You are asked to move 20 Spring Boot services to native images to save memory. How would you assess which ones are good candidates?

Spring AOT

ConceptFoundations6 min read
What does Spring AOT processing do, and how does it relate to native images?
DebuggingIntermediate5 min read
A Spring Boot native image ignores a feature flag set with an environment variable at runtime: a bean annotated with @ConditionalOnProperty is never created. Explain why.
ScenarioAdvanced6 min read
Your platform team wants to run Spring AOT processing on the JVM (not native) for all services to reduce startup time. What constraints does this impose on service teams, and how would you roll it out?
LeadershipPrincipal6 min read
Making Spring AOT processing the default for all services would cut startup time, but it fixes the bean set at build time and some teams rely on runtime profiles to change beans per environment. As the senior technical leader, how do you decide and manage the change?

Reflection hints

CodingFoundations6 min read
Show two ways to register reflection hints for a class that Jackson deserializes in a Spring Boot native image.
ScenarioIntermediate6 min read
Your company has an internal library that uses reflection and dynamic proxies and is used by many services that want to build native images. How would you add native support to the library?
LeadershipAdvanced6 min read
Several teams tried native images and gave up because of missing reflection metadata in third-party libraries. As the architect, how would you decide whether native images are supported on your platform, and what would support mean?

Native trade-offs

ConceptFoundations6 min read
List the main costs and limitations of building a Spring Boot application as a GraalVM native image compared with running on the JVM.
DesignIntermediate7 min read
Compare GraalVM native image, CRaC (Coordinated Restore at Checkpoint) and JDK AOT caching (Project Leyden) for reducing startup of Spring Boot services.
DesignAdvanced7 min read
A team runs a Spring Boot service as a native image for faster scale-out, but under sustained load its p99 latency and throughput are worse than the JVM version. Explain why and the options.
LeadershipPrincipal7 min read
Leadership asks whether the company should bet on GraalVM native images or on the JDK's own AOT cache work (Project Leyden) for faster startup and lower memory across its Java fleet. As the senior technical leader, how do you frame the decision over the next five years?
LeadershipPrincipal6 min read
The engineering organisation is debating whether to standardise all new Java services on native images. As the senior technical leader, how do you decide on this technology bet?