PracHub
QuestionsLearningGuidesInterview Prep
|Home/System Design/OpenAI

Design an Asynchronous Text-to-Video Generation Service

Last updated: Aug 5, 2026

Quick Overview

Design an asynchronous text-to-video service with durable jobs, long-running generation workers, and retrievable media assets. The case asks whether SQS fits while exploring idempotent submission, visibility timeouts, leases, cancellation races, dead letters, model versioning, storage, fairness, and failure recovery.

  • medium
  • OpenAI
  • System Design
  • Software Engineer

Design an Asynchronous Text-to-Video Generation Service

Company: OpenAI

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Onsite

## Design an Asynchronous Text-to-Video Generation Service Design a service in which a user submits a text prompt, the system performs a long-running video-generation job, and the user later retrieves the generated asset. Explain whether AWS SQS fits the work queue and how the design behaves when any component fails. ### Constraints & Assumptions - Generation is too slow and resource-intensive to keep an HTTP request open. - A submitted job must have a stable identity and an observable lifecycle. - Queue delivery may be duplicated, delayed, or reordered. - Generated assets are much larger than queue messages. - Do not assume traffic, generation time, model size, retention, or freshness targets; identify the values that would change the design. ### Part 1 — Define the Product and Job Contract Specify the submission, status, cancellation, and result APIs. Define the job states and the information needed to reproduce or investigate one generation. #### What This Part Should Cover - Idempotent submission and a stable job identifier. - Prompt and input validation, authorization, and policy checks. - Queued, running, succeeded, failed, and cancelled states with legal transitions. - Model version, parameters, ownership, timestamps, and output references. ```hint Separate acceptance from completion The submission response should confirm durable ownership of a job, not imply that a video has already been generated. ``` ### Part 2 — Choose the Queue and Worker Protocol Trace a job from durable acceptance through SQS to an eligible generation worker. Compare SQS with at least one alternative and explain how visibility timeouts, acknowledgement, and duplicate delivery interact with a long-running task. #### What This Part Should Cover - A database transaction or outbox that prevents accepted jobs from being lost before enqueue. - Small queue messages that reference durable job records and input objects. - Worker leases or heartbeats when generation can exceed a visibility timeout. - Conditional state updates and idempotency under at-least-once delivery. - The trade-off between a managed work queue and a replayable ordered log. ```hint A queue message is not the job record Keep the authoritative state in durable storage so a redelivery can decide whether work is still needed. ``` ### Part 3 — Handle Failure and Cancellation Explain recovery for enqueue failure, worker crash, timeout, duplicate delivery, malformed input, model failure, output-upload failure, poison messages, and cancellation racing with completion. #### What This Part Should Cover - Retryable versus terminal errors and bounded retry policy. - Dead-letter handling with an operator-visible reason and replay path. - Atomic publication of an output reference only after the asset is durable. - Cancellation checks before expensive phases and a conditional final commit. - Reconciliation for jobs stuck in transitional states. ```hint Make every transition conditional A late worker should not overwrite a cancellation or a success already committed by another attempt. ``` ### Part 4 — Scale and Operate the Service Discuss resource scheduling, backpressure, storage, delivery, fairness, observability, and deployment of new model versions. #### What This Part Should Cover - Batching and routing by model version, hardware need, or job priority. - Admission control, per-tenant quotas, and protection against one queue monopolizing workers. - Object storage for inputs and outputs plus controlled download access. - Queue age, state-transition latency, retry, failure, cancellation, and resource-utilization signals. - Versioned rollout and rollback without silently changing an accepted job. ```hint Measure age as well as depth A short queue can still contain a job that has been stranded for too long. ``` ### What a Strong Answer Covers - A durable asynchronous contract from submission to result retrieval. - A reasoned SQS choice with correct at-least-once and visibility-timeout semantics. - Explicit behavior for duplicates, partial failures, retries, cancellation, and dead letters. - Separation of metadata, queue messages, large assets, and model execution. - Capacity and operational decisions tied to stated workload assumptions. ### Follow-up Questions 1. When would a FIFO queue materially improve the design, and what would it cost? 2. How would you prevent a retried job from publishing two different results? 3. What happens when a worker remains healthy but generation exceeds the current lease? 4. How would you drain jobs accepted for an old model version during a rollback?

Quick Answer: Design an asynchronous text-to-video service with durable jobs, long-running generation workers, and retrievable media assets. The case asks whether SQS fits while exploring idempotent submission, visibility timeouts, leases, cancellation races, dead letters, model versioning, storage, fairness, and failure recovery.

Related Interview Questions

  • Design a Payment Lifecycle from Hold to Charge and Settlement - OpenAI (medium)
  • Design a Payment Orchestration System - OpenAI (medium)
  • Design an Online Chess Service from Launch to Scale - OpenAI (medium)
  • Design a Highly Available Conversational AI Service - OpenAI (medium)
|Home/System Design/OpenAI

Design an Asynchronous Text-to-Video Generation Service

OpenAI logo
OpenAI
Jul 19, 2026, 12:00 AM
mediumSoftware EngineerOnsiteSystem Design
0
0

Design an Asynchronous Text-to-Video Generation Service

Design a service in which a user submits a text prompt, the system performs a long-running video-generation job, and the user later retrieves the generated asset. Explain whether AWS SQS fits the work queue and how the design behaves when any component fails.

Constraints & Assumptions

  • Generation is too slow and resource-intensive to keep an HTTP request open.
  • A submitted job must have a stable identity and an observable lifecycle.
  • Queue delivery may be duplicated, delayed, or reordered.
  • Generated assets are much larger than queue messages.
  • Do not assume traffic, generation time, model size, retention, or freshness targets; identify the values that would change the design.

Part 1 — Define the Product and Job Contract

Specify the submission, status, cancellation, and result APIs. Define the job states and the information needed to reproduce or investigate one generation.

What This Part Should Cover Guidance

  • Idempotent submission and a stable job identifier.
  • Prompt and input validation, authorization, and policy checks.
  • Queued, running, succeeded, failed, and cancelled states with legal transitions.
  • Model version, parameters, ownership, timestamps, and output references.

Part 2 — Choose the Queue and Worker Protocol

Trace a job from durable acceptance through SQS to an eligible generation worker. Compare SQS with at least one alternative and explain how visibility timeouts, acknowledgement, and duplicate delivery interact with a long-running task.

What This Part Should Cover Guidance

  • A database transaction or outbox that prevents accepted jobs from being lost before enqueue.
  • Small queue messages that reference durable job records and input objects.
  • Worker leases or heartbeats when generation can exceed a visibility timeout.
  • Conditional state updates and idempotency under at-least-once delivery.
  • The trade-off between a managed work queue and a replayable ordered log.

Part 3 — Handle Failure and Cancellation

Explain recovery for enqueue failure, worker crash, timeout, duplicate delivery, malformed input, model failure, output-upload failure, poison messages, and cancellation racing with completion.

What This Part Should Cover Guidance

  • Retryable versus terminal errors and bounded retry policy.
  • Dead-letter handling with an operator-visible reason and replay path.
  • Atomic publication of an output reference only after the asset is durable.
  • Cancellation checks before expensive phases and a conditional final commit.
  • Reconciliation for jobs stuck in transitional states.

Part 4 — Scale and Operate the Service

Discuss resource scheduling, backpressure, storage, delivery, fairness, observability, and deployment of new model versions.

What This Part Should Cover Guidance

  • Batching and routing by model version, hardware need, or job priority.
  • Admission control, per-tenant quotas, and protection against one queue monopolizing workers.
  • Object storage for inputs and outputs plus controlled download access.
  • Queue age, state-transition latency, retry, failure, cancellation, and resource-utilization signals.
  • Versioned rollout and rollback without silently changing an accepted job.

What a Strong Answer Covers Guidance

  • A durable asynchronous contract from submission to result retrieval.
  • A reasoned SQS choice with correct at-least-once and visibility-timeout semantics.
  • Explicit behavior for duplicates, partial failures, retries, cancellation, and dead letters.
  • Separation of metadata, queue messages, large assets, and model execution.
  • Capacity and operational decisions tied to stated workload assumptions.

Follow-up Questions Guidance

  1. When would a FIFO queue materially improve the design, and what would it cost?
  2. How would you prevent a retried job from publishing two different results?
  3. What happens when a worker remains healthy but generation exceeds the current lease?
  4. How would you drain jobs accepted for an old model version during a rollback?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More OpenAI•More Software Engineer•OpenAI Software Engineer•OpenAI System Design•Software Engineer System Design

Your design canvas — auto-saved

PracHub

Master your tech interviews with 9,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.