Design a Tier-Aware AI Video Generation Service
Company: OpenAI
Role: Software Engineer
Category: System Design
Difficulty: medium
Interview Round: Technical Screen
# Design a Tier-Aware AI Video Generation Service
### Prompt
Design a service that accepts a generation request, runs an expensive video-generation workflow asynchronously, and lets the user retrieve the completed video. Focus on distributed-system behavior rather than model architecture.
Start with one service level for all users. Then extend the design to support product tiers with different queue priority or quota. Explain how the system behaves when each major component fails.
**Candidate hint:** Treat a generation as a durable state machine. Separate accepting work, scheduling scarce compute, executing stages, and publishing an output.
### Constraints & Assumptions
- Generation is too slow for a synchronous request/response connection.
- Worker capacity is scarce, heterogeneous, and may fail during a job.
- Client retries must not create unintended duplicate jobs or charges.
- Large intermediate and final artifacts should not flow through the control-plane database.
- State assumptions about cancellation, progress, maximum attempts, and output retention.
### Clarifying Questions to Ask
- Is priority strict, weighted, or bounded by a fairness requirement?
- Can a failed generation resume from a checkpoint, or must it restart?
- Are identical requests allowed to share work?
- What progress and completion guarantees are exposed to users?
### What a Strong Answer Covers
- Durable APIs, job states, idempotency, and artifact ownership
- Admission control, scheduling, fairness, tiering, and capacity isolation
- Reliable coordination between queues, schedulers, and compute workers
- Retry, lease, checkpoint, cancellation, and duplicate-execution semantics
- Storage and delivery of large outputs plus lifecycle cleanup
- Failure analysis, overload behavior, security boundaries, and observability
### Follow-up Questions
1. How do you stop high-priority work from starving the base tier?
2. What happens when a worker finishes after its lease has expired and another worker retried the job?
3. How would you drain a compute pool for maintenance without losing work?
4. Which signals distinguish insufficient capacity from a model-stage regression?
Quick Answer: Design an asynchronous AI video generation service around scarce, failure-prone compute rather than model internals. Cover durable job states, idempotency, artifact storage, retries, leases, cancellation, tier-aware scheduling, fairness, overload, and component failures.