Scrivio Interview library
ScenarioAdvanced6 min read · updated 12 November 2026

A team proposes CRaC in production so new instances serve traffic within milliseconds during scale-out. What questions do you ask before approving it?

Before approving CRaC in production, I would ask six groups of questions: which vendor JDK builds support it and whether we accept that dependency; what privileges checkpoint and restore need on our container platform and whether security policy allows them; how secrets in the snapshot are protected and rotated after restore; how the application handles restored connections, clocks, host names, random generators and caches; how restore is tested in CI and what the fallback to a normal start is; and whether the JDK AOT cache would give enough of the benefit with far less risk.

Why this question is asked

Serving traffic within milliseconds of scale-out is a real business benefit: a service that takes 20 seconds to become ready is overloaded for those 20 seconds every time traffic spikes. But CRaC copies a whole running process, memory and all, and runs those copies across the fleet. Approving it is a decision about vendors, platform security and application correctness as much as about performance. Interviewers ask this scenario to see whether we can review a promising proposal without either blocking it or waving it through. In this answer, we will recap what CRaC does, then go through the questions about the vendor, the platform, secrets, restored state, testing and fallback, and the cheaper alternative.

1A Quick Recap of What Is Being Proposed

CRaC, Coordinated Restore at Checkpoint, starts a JVM, lets it start up and warm up, and then writes a snapshot of the whole process to disk. New instances are started by restoring that snapshot, so they begin life with the beans already created and the hot code already compiled. The application cooperates through callbacks: before the checkpoint it closes connections and files, after restore it reopens them.

The team's proposal therefore has three parts that we must review separately: a different JDK in production, a new operation in the container platform (checkpointing and restoring processes), and a change in how the application treats its own state. Each part has its own risks.

2Questions About the Vendor and the Platform

The first question is which JDK we would run. CRaC is an OpenJDK project but not part of mainline OpenJDK, so it is available only in some vendor builds, such as Azul's and BellSoft's. So we ask: which build, which support contract, how fast do its security updates arrive compared with our current JDK, and what happens if that vendor stops shipping CRaC builds? If the answer is that we fall back to a normal start on a standard JDK, that is acceptable; if the application cannot run without it, the dependency is much stronger.

The second question is what the platform must allow. The classic checkpoint engine uses CRIU, a Linux tool that dumps and restores processes, and in a container it usually needs extra capabilities such as CAP_CHECKPOINT_RESTORE or CAP_SYS_PTRACE, or a privileged container. Many security policies forbid exactly those. Some vendors offer engines that need fewer privileges; the team should state which engine they use and exactly which privileges, and the platform security team must agree before we go further. We also ask where snapshots are stored and how they reach new nodes, because a snapshot of a large heap can be hundreds of megabytes.

3Questions About Secrets in the Snapshot

The snapshot contains the heap, and the heap contains whatever the application had read by then: database passwords, OAuth client secrets, signing keys, access tokens. So the snapshot file is a secret store, and we ask how it is protected: who can read the storage, whether it is encrypted at rest, how long it is kept, and whether the same snapshot is used across environments. A snapshot taken in staging with staging credentials must never be restored in production.

Then we ask about rotation. If every restored instance starts with the token read at checkpoint time, the token may already be expired, and if it leaks, every instance shares it. The application should fetch fresh credentials in its restore callbacks, or, better, take the checkpoint before credentials are loaded at all, which Spring's automatic checkpoint at startup helps with, and load them after restore.

4Questions About Restored State

Every restored instance is a copy of the same process, so anything that should be unique or current is a potential bug. We ask the team to show, for each kind of state, what goes wrong and what they do about it.

State that a restore copies
StateWhat goes wrong after restoreExpected handling
Database and broker connectionsSockets are gone; pools hold dead connectionsClosed before checkpoint, reopened after restore
Clock-based valuesTimers and caches think no time has passedReset timers, expire time-based caches
Host name, IP, instance idEvery copy reports the first hostRecompute after restore
Random number generatorsEvery copy produces the same sequenceReseed security-relevant generators
In-memory cachesStale data from checkpoint timeClear or refresh after restore
Credentials and tokensExpired or shared across all copiesFetch fresh after restore
Each row needs an owner and a test before approval.

A good answer covers each row with a test, not just a statement. A team that has thought about these will usually have found at least one surprise already, often a library that caches the host name or a pool that does not reconnect cleanly.

5Questions About Testing and the Fallback

CRaC adds a new way for the application to start, so it needs its own tests. We ask whether CI creates a checkpoint, restores it, and runs the same smoke and integration tests against the restored process as against a normal start. Without that, the first time anyone sees a restore bug is in production during a traffic spike, which is the worst possible moment.

We also ask what happens when restore fails, because sometimes it will: a kernel difference on a new node pool, a snapshot that is missing, a policy change. The answer we want is an automatic fallback to a normal JVM start with a clear log and a metric, so a failed restore costs seconds, not an outage.

Step throughStarting an instance with CRaC and a fallback
  1. Snapshot present and matching this image?
    YesTry restoreNoNormal start
  2. Restore succeeded?
    YesRun afterRestore refreshNoLog, count, normal start
  3. Refresh succeeded (credentials, pools, caches)?
    YesPass readiness, serve trafficNoExit and let the platform restart normally

3 steps in order. Play them, or step through them one at a time.

A failed restore should cost a normal startup, never an outage.

6Would the AOT Cache Be Enough?

The last question is the most useful one: what is the cheapest option that meets the goal? The JDK AOT cache, from JEP 483 in JDK 24 and improved in JDK 25 with method profiles, is in mainline OpenJDK, needs no special privileges, stores no heap data and changes no application behaviour. It will not give millisecond startup, but if it takes readiness from 20 seconds to 12, and the readiness probe and autoscaler are tuned, the scale-out problem may be solved well enough.

So we ask the team for numbers: current time to ready, time to ready with the AOT cache, and time to ready with CRaC, and how those translate into overload during a typical spike. If CRaC's extra gain is large and the questions above have good answers, we can approve a limited rollout on one service with a clear rollback. If the AOT cache closes most of the gap, we take it first and revisit CRaC later.

7Follow-up questions

What would make you say no outright?

A design where the application cannot start without CRaC, so a vendor or platform change would cause an outage, or a plan that stores snapshots containing production credentials without encryption and access control. Either would turn a performance improvement into a reliability or security risk that the benefit does not justify.

Why take the checkpoint before credentials are loaded?

Because then the snapshot never contains them. With Spring's automatic checkpoint during startup, the checkpoint happens before lifecycle beans start, so connection pools have not connected yet. If credentials are also fetched lazily, each restored instance fetches its own, and nothing sensitive is written to disk.

How would you limit the rollout if you approve it?

One service, one environment, behind a switch that falls back to a normal start, with dashboards for restore success, time to ready and errors after restore. After a few weeks of clean data, and a security review of the snapshot storage, it can expand service by service.

8Conclusion

In this answer, we reviewed a CRaC proposal as six groups of questions. We asked about the vendor build and our dependency on it, the privileges checkpoint and restore need on the container platform, the protection and rotation of secrets held in the snapshot, the handling of restored connections, clocks, host names, random generators and caches, the CI tests and automatic fallback to a normal start, and finally whether the JDK AOT cache would meet the goal with far less risk.

What to say in the interviewAbout 80 seconds aloud

Open with

I like the goal, but before approving I would want answers in a few areas. First the vendor: CRaC is not in mainline OpenJDK, so which vendor build would we run, how quickly does it get security updates, and can the service still start normally on a standard JDK if we change our minds.

Then, if they want more

Second the platform: checkpoint and restore with CRIU usually needs extra Linux capabilities or a privileged container, so I would want the exact privileges and an agreement from the security team.

Third secrets: the snapshot holds the heap, so credentials and tokens are in it; I would want the snapshots encrypted and access-controlled, never shared across environments, and ideally the checkpoint taken before credentials are loaded, with fresh ones fetched after restore.

Fourth restored state: connections, clocks, host names, random number generators and caches all get copied, so I would ask how each is refreshed and tested. Fifth testing: CI should checkpoint, restore and run the integration tests against the restored process, and a failed restore must fall back to a normal start with a metric.

And finally I would ask for numbers with the JDK AOT cache, because if it gets readiness close enough, it gives most of the benefit with much less risk.

About this answer

Last updated
12 November 2026
Versions it names
Java 24, Java 25
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "A team proposes CRaC in production so new instances serve traffic within milliseconds...": https://scrivio-interview-library.netlify.app/java/startup-and-footprint/a7cab97e9e/