The interview problem

Practice prompt

Design checkpoint storage for a training job using 256 workers. Each checkpoint contains 4 TB of model and training state. Save every 20 minutes while minimizing training pauses, survive worker or coordinator crashes and restore onto a different worker count. Explain when a checkpoint is safe to advertise as recoverable.

Original system-design practice, not a reported interview. Sizes and timings are hypothetical; decimal storage units are used. Primary documentation retrieved September 27, 2026.

1. Define a recoverable training state

Weights alone may support inference but do not fully resume training. Inventory optimizer state, learning-rate scheduler, step counter, random-number state, mixed-precision scaler, data sampler position and any accumulated gradients. Checkpoint immediately after an agreed optimizer-step boundary to avoid storing a partially applied update; pipeline and asynchronous training need an explicitly coordinated consistent cut.

Specify whether recovery promises approximate continuation or a bitwise-identical trajectory. Different hardware, worker counts, reduction order and data partitioning can change numerical results even when the intended state loads correctly. Record framework, model code, configuration and dataset versions so operators can determine compatibility rather than infer it from a filename.

2. Coordinate an immutable snapshot

The training controller chooses a run ID, checkpoint ID, logical step and membership epoch. Workers stage their assigned state at that boundary into buffers that subsequent training updates cannot mutate. Once the required staging synchronization completes, training may resume while immutable staged data is uploaded. An asynchronous API return is not by itself evidence that either staging or durable upload has completed.

Use a checkpoint coordinator, worker upload agents, immutable blob storage and a strongly consistent metadata catalog. Each worker reports a shard manifest containing tensor names, shapes, dtypes, logical ranges, object keys, byte lengths and checksums. The coordinator verifies complete coverage of the expected state and matching step/epoch. Do not combine the newest available shard from every worker: individually valid shards from different steps can form an invalid checkpoint.

Use logical tensor ranges rather than making worker rank the only identity. A restore planner can map those ranges onto new workers. PyTorch distributed checkpointing supports parallel save/load and load-time resharding, but framework support does not automatically solve custom sampler state or guarantee compatibility across framework versions.

3. Publish only complete checkpoints

Model checkpoint states as preparing, uploading, validating, committed and aborted. Upload shards under unique attempt-specific paths; retry using the same shard identity and verify byte identity. After every required shard is durable under the selected storage contract, write an immutable global manifest and atomically publish a committed catalog entry referencing it.

Update the latest-recoverable pointer conditionally so a slow older attempt cannot replace a newer committed checkpoint. The catalog transaction checks the current coordinator fencing epoch before accepting a commit; a lease without that storage-side check cannot stop an obsolete coordinator after replacement. Readers discover only committed manifests, then verify schema, object presence and integrity before loading.

If the coordinator crashes before commit, a replacement inspects durable receipts and either finishes validation or aborts the attempt. If it crashes after commit but before notifying training, retry reads the committed catalog state. Partial uploads remain unreachable recovery candidates and can be garbage-collected later. Never delete the last known-good checkpoint merely because a new upload started.

4. Calculate the storage bottleneck

Four TB across 256 evenly sized worker shards is 15.625 GB per worker. At 25 GB/s effective aggregate storage throughput, transferring one checkpoint takes at least 160 seconds. A 20-minute interval generates an average of 3.33 GB/s, but provision for synchronized peaks, retries and competition with restores, not only the average.

With one immutable staged copy per worker, the design needs roughly 15.625 GB of extra memory per worker before serialization overhead and imbalance. Two overlapping copies double that requirement. Bound the number of in-flight checkpoints; if uploads cannot keep up, skip or delay a new checkpoint according to policy instead of exhausting host memory.

Keeping the latest three complete 4 TB checkpoints consumes 12 TB logically, excluding partial attempts and any separately pinned milestones. Two explicit complete storage copies require 24 TB; do not multiply again for a managed service's internal redundancy unless it is actually additional billed capacity in your model.

If restores sustain 10 GB/s aggregate, data transfer alone takes 400 seconds, about 6.67 minutes. Allocation, deserialization, resharding, validation and worker startup add time. A successful save benchmark is not a recovery-time benchmark.

5. Explain checkpoint frequency honestly

More frequent saves reduce recomputation but increase storage traffic and staging cost. With an idealized instantaneous checkpoint every 20 minutes and failures uniform within the interval, mean lost work is 10 minutes. This simple result excludes checkpoint completion lag and correlated failure patterns.

For a more realistic toy schedule, capture state every 1,200 seconds and commit it exactly 160 seconds later. At a failure just after a new capture, the latest committed state can still be from the previous interval. Its age ranges from 160 to just under 1,360 seconds over the steady-state cycle, with a mean of 760 seconds, or 12.67 minutes. This assumes failures sample time uniformly, uploads always succeed, staging time is negligible and training proceeds continuously. Track the age of the latest committed checkpoint in production.

6. Make restore a regularly tested path

Select a committed checkpoint compatible with the requested run configuration. Allocate destination tensors, read the required logical ranges and validate checksums. Restore optimizer and control state before advancing the training loop. Every participating worker must agree on checkpoint identity and step; a partial restore must fail the attempt rather than silently initialize missing tensors.

Exercise restores onto both the original and a supported changed topology. Check loss behavior, step counters, sampled data position and optimizer state against a controlled continuation. A changed world size can require a deliberate data-order policy; restoring tensors is not proof that the same examples will be consumed next.

Inject missing shards, corrupt bytes, coordinator replacement, upload timeouts and crashes during staging. Maintain a tested previous checkpoint for fallback. Read only trusted checkpoint formats under a controlled loader: training artifacts may contain serialized executable objects, so storage access is also a code-execution trust boundary.

7. Defend retention and failure choices

Local SSD staging can reduce pause time but is not durable against losing the host. Remote replication increases failure tolerance at a bandwidth cost. Incremental checkpoints save space when changes are sparse but create dependency chains and more complicated garbage collection. Pin the entire dependency closure of a retained checkpoint, not just its manifest.

Garbage collection must coordinate with in-flight uploads, restore readers and retention pins. Mark live manifests and their referenced objects, wait through a defined safety period and recheck ownership before deletion. A checkpoint that passed checksums can still contain a semantically wrong sampler state; integrity checks and recovery drills answer different questions.

Foundation: distinguish weights from resumable training state. Senior: recover a coordinator crash without advertising partial data. Staff: bound staging memory and preserve useful recovery semantics across topology changes.

Score 0–2 each for consistent state, publication protocol, capacity arithmetic, restore validation and retention safety. Compare with model distribution and GPU scheduling.

Sources and next steps

The commit protocol, capacity example and failure model are original. Validate the chosen framework and storage backend together; an API's existence does not establish the application's complete recovery guarantee.

Continue your preparation

Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.