Design a Batch Asset Upload API That Reports Partial Failures

Last updated: November 29, 2026

Quick Overview

Design the request and response contract for an endpoint that lets advertisers on ByteDance's ad platform register up to 100 creative assets in one call, where some items may be invalid or fail transiently, and the client may retry the whole request.

ByteDance
Software Engineering Fundamentals
Software Engineer
ByteDance
November 29, 2026
Software Engineer
Technical Screen
Software Engineering Fundamentals
Medium

0

0

0 solved


Design the request and response contract for an endpoint that lets advertisers on ByteDance's ad platform register up to 100 creative assets in one call, where some items may be invalid or fail transiently, and the client may retry the whole request.

Advertisers on Ocean Engine (ByteDance's ad platform) often upload creatives in bulk through APIs, and interviewers use this to probe API design judgment. They check per-item results, idempotent retries, clear separation of client errors from retryable server errors, and sensible limits.

What the Interviewer Expects
  • Return a per-item result keyed by index, not one all-or-nothing status
  • Distinguish invalid input (do not retry) from transient failure (retry)
  • Make the whole call idempotent with a client-supplied key
  • Set and document batch size limits
  • Choose status codes deliberately, such as 200 versus 207 Multi-Status versus 400
Key Topics to Cover
API design
idempotency
partial failure
error handling
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • Uploads take minutes: how would you make this asynchronous with a job resource?
  • How long do you keep idempotency keys and where?
  • How would you version this API without breaking existing advertisers?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Request: POST /v1/creatives:batchCreate with header Idempotency-Key and body {items: [{url, size, ...}]}, 1 to 100 items. Response: overall status, count accepted, and results[] with index, status (ac...

High-Level Design

Validate the envelope first and fail fast with 400 if it is malformed or too large. Process items independently so one bad item does not block the rest. Record the response under the idempotency key s...


Submit Your Answer
Markdown supported