Native images and AOT
16 questions in 4 subtopics.
GraalVM native image
Explain what GraalVM native image does at build time and why it makes Java applications start faster and use less memory.Describe how you build and test a Spring Boot 3 application as a native image with Maven or Gradle, and what you need installed.A Spring Boot native image builds successfully but fails at runtime with aClassNotFoundException from a JSON library used through reflection. How would you diagnose and fix it?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
What does Spring AOT processing do, and how does it relate to native images?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.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?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
Show two ways to register reflection hints for a class that Jackson deserializes in a Spring Boot native image.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?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
List the main costs and limitations of building a Spring Boot application as a GraalVM native image compared with running on the JVM.Compare GraalVM native image, CRaC (Coordinated Restore at Checkpoint) and JDK AOT caching (Project Leyden) for reducing startup of Spring Boot services.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.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?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?No question matches these choices.