The interview problem

Practice prompt

Design a private container artifact registry handling 100,000 image pushes and one million image pulls per day. Support resumable uploads, digest-based downloads, mutable release tags and multiple CPU platforms. Keep incomplete images out of release publication and prevent one tenant from accessing another tenant's content merely by knowing its digest.

Original system-design practice, not a reported company interview. Workload assumptions are hypothetical. OCI Distribution Specification v1.1.1 is the pinned technical reference, retrieved September 27, 2026; interview date not applicable.

1. Separate content identity from release names

Blobs contain bytes addressed by a digest. An image manifest describes its configuration and layers; an image index can refer to platform-specific manifests. A tag is a human-readable pointer to a manifest, so several tags can identify the same content and a mutable tag can later identify different content.

In this design, deployments resolve a release tag once and record the resulting digest. Re-reading the tag during the same deployment could select another release. Digest verification establishes byte integrity against the expected digest, not the publisher's identity or the absence of malicious code. Publisher trust and release approval are separate policies.

The proposed release contract requires every necessary image dependency to be available before a release tag becomes visible. This is our policy, not a claim that every OCI registry enforces the same publication rules.

2. Separate metadata decisions from byte delivery

authenticated client → repository authorization gateway
                         ├→ upload sessions → staging objects
                         │                       ↓
                         │               verified blob finalizer
                         ├→ manifest and tag metadata service
                         └→ authorized download → cache/object storage

metadata: repository membership, descriptors, tags, retention state
storage: immutable manifest bytes, layer/config bytes, upload staging

Use a transactional metadata store for publication state, repository membership and tag updates. Store large immutable bytes in object storage. Every storage location referenced by committed metadata must be durable under the chosen availability contract. Do not treat a successful staging write as a completed image.

Shard metadata by repository where practical, with special handling for very large repositories. Upload and download bandwidth scale independently from tag-write throughput. Keep authorization on the control path even when the data plane uses signed URLs or a cache.

3. Make upload completion a verified state transition

Create an upload session scoped to a principal and repository. Record its durable progress, expiration and byte quota. Clients resume from server-confirmed progress after a disconnect rather than blindly appending the last chunk again. Concurrent requests for the same session need offset or version checks so retries cannot reorder the byte stream.

Keep incomplete content in session staging. At finalization, verify the digest and size against the actual bytes, then install the immutable object and authorized repository membership. A digest mismatch fails finalization; it does not publish a partially useful blob. Concurrent uploads of identical bytes may converge on one stored object, while session-specific cleanup removes only redundant staging.

Preserve exact manifest bytes when calculating and serving their digest. Parsing JSON and serializing it again can change its bytes even if the fields have equivalent meaning. Keep parsed descriptors as metadata alongside the original bytes.

If the client loses the completion response, it can query authorized state and resume or recognize completion. The retry protocol must not assume that a timeout means no object was committed.

4. Publish the dependency graph before moving the tag

  1. Finalize required configuration and layer blobs.
  2. Validate and store each platform manifest with protected references to its required dependencies.
  3. Validate and store the image index once its required child manifests and dependencies are available.
  4. Apply release-policy checks, then atomically move the release tag to the approved digest.

Validation and retention protection must participate in a protocol that excludes concurrent deletion. A separate existence check followed by a later tag write leaves a race. The tag update should be a small metadata operation after bytes and dependencies are durable.

For concurrent release writers, this design offers an expected-version update or an immutable-tag policy. An expected-version mismatch rejects a stale publisher rather than silently replacing another release. These are proposed registry policies or extensions; do not assume universal OCI support for conditional tag updates.

OCI v1.1.1 permits rejecting ordinary missing manifest dependencies, but requires initial acceptance of otherwise valid manifests whose subject is absent. A subject association is not the same as a required image layer. Handle referrer attachments and their discovery separately; do not reject every missing subject under a blanket dependency rule.

5. Trace a multi-platform publication failure

A release index names an amd64 manifest and an arm64 manifest. The amd64 image is complete, but the arm64 upload has not finalized. Publishing the index immediately can make one class of deployment succeed while another fails to fetch a child manifest or layer.

Under this design, the release index waits for both required platform graphs. A separately named amd64-only artifact may be published if that narrower contract is intended. Do not advertise the two-platform release as complete because one platform passed a smoke test.

Regional replication has the same shape: metadata arriving first does not make all referenced bytes available locally. Gate regional release readiness on dependency availability or provide a verified origin fallback. If fallback is unavailable, return a clear availability failure rather than different bytes under the same digest.

6. Close the publication-versus-deletion race

Unsafe sequenceConsequence
Layer L finishes uploadingL exists but has no committed manifest reference
Collector marks L as unreferencedA deletion candidate is created
Publisher checks that L existsThe check succeeds
Collector deletes LThe earlier check becomes stale
Publisher commits manifest M and release tagA visible release references missing content

Use shared metadata coordination between publication and reclamation. For example, a publisher protects a live object generation and commits its reference in the same transaction. A collector can claim deletion only for an unprotected generation. If publication wins, deletion cannot claim it; if deletion wins, publication must retry after content is available again.

Physical deletion also needs generation safety. A stale delete request must not remove newly uploaded bytes placed under a reused logical digest key. Use generation-specific physical objects or an equivalent conditional-delete mechanism, with metadata selecting the current verified generation. Metadata fencing alone is insufficient if the eventual storage deletion ignores it.

Keep active upload leases and retention windows, but do not rely on a grace period alone to eliminate arbitrary races. Expired staging cleanup must not remove a committed object that has become shared by manifests. Traverse nested manifests when protecting required image dependencies.

7. Keep deduplication separate from access

Tenant A uploads digest D. Tenant B guesses D and requests it. The fact that D physically exists is not permission for B to read it. Enforce access to the relevant repository and its content membership before serving a manifest, blob or existence result.

For a cross-repository mount, verify permission to use the source content and write the target association. A global deduplication index must not become an authorization shortcut. Decide how denied existence checks avoid revealing private content, and apply that policy consistently.

Scope signed download URLs to the authorized object and a limited lifetime. A shared cache can hold immutable bytes while the gateway still controls who may receive them. Never make private tag metadata public merely to improve cache hit rate. Cross-tenant physical deduplication saves storage but complicates information leakage and lifecycle accounting; repository-scoped deduplication is simpler and may be preferable initially.

8. Size bytes separately from request counts

Assume each pushed image references 400 MB of compressed layers and 80% of those referenced bytes already exist within the chosen deduplication scope. These are byte-based reuse assumptions, not percentages of images.

referenced push bytes = 100,000 × 400 MB = 40 TB/day
new logical layer bytes = 40 TB × 20% = 8 TB/day
30 days of this new content = 240 TB

The retention estimate excludes deletion, replication, configuration/manifest bytes and staging. It also assumes the stated reuse rate persists. Clients that check for authorized existing blobs can avoid some uploads; server-side deduplication alone does not guarantee that duplicate bytes never cross the network.

Now assume one million cold-client pulls per day each transfer 400 MB:

client delivery = 1,000,000 × 400 MB = 400 TB/day
average bandwidth = 400,000 GB / 86,400 seconds ≈ 4.630 GB/s
hypothetical five-times peak ≈ 23.148 GB/s

90% byte cache hit rate:
origin delivery = 40 TB/day ≈ 0.463 GB/s average

Cache hits reduce origin traffic, not the bytes delivered to clients. Client-side layer reuse would reduce the assumed cold-pull volume and should be modeled separately. Large layers, range requests, hot releases and regional fan-out affect both bandwidth and request load.

With 10,000 concurrent resumable sessions each holding 100 MB of unfinished data, staging alone is 1 TB. Account for incomplete uploads in per-principal and per-repository quotas. Otherwise an attacker or broken build fleet can exhaust storage without ever completing an image.

9. Define deletion and release approval precisely

Removing a tag does not necessarily remove its manifest or shared layers. Retention roots can include other tags, explicitly retained digests, active publication state and approved rollback releases. Decide how untagged manifests and attachments age out. Blob deletion must not break content still protected by the registry's contract.

A mandatory scanner or approval service can keep a release tag from advancing while content remains stored. That is a release-policy decision, not a failure of digest verification. If unapproved images must not run, enforce approval by digest at deployment admission or an equivalent authorization boundary; withholding a release tag alone does not prevent a client from pulling an already accessible digest. Expose states such as uploaded, verified, policy-pending and release-approved so users know what is blocked.

Rollback resolves to a previously approved digest whose dependencies are still retained. A tag history entry without retained content is insufficient. Test restoration of metadata and immutable objects together; recovering only tags can leave apparently healthy releases unreadable.

Failure analysis and follow-ups

  • Upload disconnects halfway. Resume from durable session progress and validate the final complete bytes.
  • Two uploads finalize the same digest. Install verified immutable content idempotently and clean up only session-specific staging.
  • Publisher crashes before tag update. Content can remain untagged under the retention policy; retry publication using durable state.
  • Collector races publication. Use reference protection and deletion claims under shared coordination, including physical object generations.
  • A region has only metadata. Gate readiness or use an authorized origin fallback; do not promise local completeness.
  • A digest is known but unauthorized. Enforce repository access independently of physical deduplication.
  • A release tag changes mid-deployment. Resolve once and deploy by the recorded digest.

Test failures between byte finalization, membership insertion, reference protection and tag commit. Include concurrent platform uploads, stale tag writers, expired sessions and unauthorized mount requests. Monitor completion failures, dangling required references, staging age, origin bandwidth and regional readiness lag.

Self-review rubric

A strong answer separates tags from content, makes uploads resumable and verified, enforces repository authorization and publishes complete platform dependencies. It sizes storage and bandwidth with explicit reuse assumptions. An excellent answer closes deletion races through physical storage, preserves exact manifest bytes, distinguishes subject associations from required layers and separates release trust from digest integrity.

Sources and attribution

Retrieved September 27, 2026; release publication date not established. This pinned version is the reference, not a claim about the latest version. Architecture, publication/retention policy, tenant scenario and calculations are original practice. No company interview attribution is claimed.

Continue your preparation

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