Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Product and Profile Image Upload Service

Design a retry-safe image-ingestion path that lets an authorized seller attach only complete, validated image bytes to a product. Walk through the same safe publication journey for a user replacing their social-app profile picture.

Problem statement

For this exercise, assume an authenticated seller requests an image upload for a product the seller is allowed to edit, transfers one image, completes the upload with a stable request identity, and observes a durable processing status.

The service verifies that the complete bytes match the declared integrity value and the accepted image-format policy before it publishes one ready image association. A product page or downstream catalog reader may resolve only ready images; partial, failed, superseded, or unverified uploads must never become visible.

A retry of initiation or completion returns the original logical upload outcome instead of creating another association, and asynchronous validation work may be delivered more than once.

The report supplies no numeric image-size limit, upload rate, latency target, availability target, retention rule, or variant policy, so state bounded assumptions and explain how the design changes if those bounds move.

Product editing beyond the image association, product search, pricing, checkout, recommendations, content moderation, image transformation, and seller onboarding are outside scope.

For this exercise, also use this upload service when an authenticated user replaces their own profile picture in a social-media application. The profile target is bound to the authenticated user; the client cannot select another owner.

Walk through image selection, authorized initiation, byte transfer, completion, durable status, and rendering the currently ready profile image. A local preview may show the selected file, but it is not a published profile image.

While a new upload is pending, uncertain, or failed, readers keep the previous ready image, or a placeholder if none exists. Only a successful conditional ready association changes what the profile reader renders. A stale validator cannot displace a newer ready association.

Apply the same integrity, accepted-format, retry, expiry, and cleanup rules to product and profile targets, with separate target identities. Profile editing beyond the image pointer, social-feed behavior, multi-device synchronization, folders, sharing, albums, resizing, and moderation remain outside scope.

The client-status behavior, ownership rule, previous-image policy, and all numeric evaluation bounds are practice assumptions.

What to build

  1. An authorized seller can idempotently initiate one image upload for a product and receive a stable upload and request identity. An authenticated user can initiate the same operation for their own profile target; product and profile targets cannot be confused.
  2. A seller can complete the byte transfer, after which the service verifies integrity and the accepted image-format policy before deciding ready or failed. The profile client uses the same completion and validation lifecycle, and a local preview is not publication.
  3. The service can atomically publish one ready image association while preventing partial, failed, stale, or unverified bytes from becoming visible. A profile reader retains the prior ready image or a placeholder while replacement is pending or failed; a stale validator cannot replace a newer ready pointer.
  4. A seller or authorized downstream reader can retrieve the durable upload status and resolve bytes only for the ready image version. The profile client can recover status after an uncertain response and render only the target's current ready image under the application's authorization policy.

At scale

  • The report identifies seller product-image upload but supplies no numeric file-size, throughput, latency, availability, or retention target; state bounded assumptions before choosing transfer, storage, and worker capacity.
  • Image byte transfers are materially larger and longer-lived than metadata requests, so separate their resource and retry boundaries and explain the chosen upload-expiry policy.
  • Completion and validation work may be retried or delivered more than once, but one stable request identity must converge on one logical upload outcome and one ready association.
  • A ready image may be read frequently after publication, while incomplete and failed uploads require a bounded cleanup policy chosen and justified by the candidate.