YouTube
Design video upload, processing, and playback as distinct lifecycles.
Clarify this prompt before choosing components
Ask the highest-impact questions first, agree on priorities, and record the interviewer’s answers. If a detail is unspecified, state an assumption and explain which decision depends on it. The numbers in this worked lesson are exercise assumptions, not company facts.
| Ask the interviewer | Why the answer changes the design |
|---|---|
| Creator uploads, playback, recommendations or live first? | Each has different correctness and scaling pressures. |
| Maximum upload size, processing delay and supported devices? | Specify resumable ingestion, rendition jobs and publication validation. |
| Moderation, copyright and revocation requirements? | Media presence is not permission to publish or play it. |
Use the Interview Playbook for the shared 45-minute sequence and fresher, intermediate, senior and staff evidence. Start with one complete operation. Extend the answer with the failure/recovery traces below, then defend a workload-specific alternative and a measurable rollout. Scope and evidence matter more than a large component list.
YouTube: Understand the building blocks
Choose a mechanism because it satisfies a requirement. These explanations describe the exercise design, not undisclosed implementation choices at the named company.
YouTube: Quick vocabulary
| Term | Meaning and role in this exercise |
|---|---|
| API: Application Programming Interface | The contract for requests, responses and errors between components. An API route does not itself enforce every business invariant. |
| CPU: Central Processing Unit | General-purpose compute whose time/concurrency must be bounded for judging, processing or encoding. |
| GPU: Graphics Processing Unit | Parallel compute often used for inference/encoding. Its memory and scheduling limits are separate from ordinary request-server limits. |
| URL: Uniform Resource Locator | Names a resource and access location. Normalize carefully and do not trust an imported address as a safe server fetch destination. |
| GC: Garbage Collection | Reclaiming unreferenced data or runtime memory. File cleanup must respect active sessions, committed manifests and the declared grace policy. |
| TTL: Time to Live | An entry/grant lifetime. Logical expiry, physical cleanup and urgent revocation are distinct conditions. |
| PK: Primary Key | The declared row identity in a database schema; it does not automatically enforce every cross-row business rule. |
| DAG: Directed Acyclic Graph | A dependency graph with no directed cycles, used here to order required processing steps before publication. |
| VOD: Video on Demand | Playback of already published media at a viewer-selected time, with different availability/latency constraints from live media. |
YouTube: Object storage, chunks and content hashes
What it means: Object storage keeps large named byte objects. Chunking divides a file into smaller pieces; content hashes identify or verify bytes under a specified hash protocol.
Why this problem needs it: Uploads and playback bytes have different storage/access paths from catalog metadata.
How to use it: Upload to a versioned session, verify all required chunks and checksums, then atomically publish metadata referencing the complete manifest.
Example in this design: Publish only a verified versioned media manifest.
When it fits: Useful for resume, reuse or large bytes that should not flow through metadata database rows.
Alternative and limits: Whole-file upload is simpler for small files. A hash match or completed upload does not authorize publication or resolve a concurrent file revision.
YouTube: Transcoding and a dependency graph
What it means: Transcoding converts input media into required encoded outputs. A dependency graph records which validation/encoding/packaging steps must finish before publication.
Why this problem needs it: One source video needs compatible quality/device outputs.
How to use it: Create versioned jobs for required renditions, bound compute concurrency, retry failed attempts safely, and mark the manifest ready only after required outputs are verified.
Example in this design: Bound encoding workers and require the selected outputs before readiness.
When it fits: Useful when uploads must play on different devices or at multiple bandwidth levels.
Alternative and limits: Serving an already compatible source can be a simpler baseline. A completed task does not imply all outputs or a newer input generation are ready.
YouTube: Adaptive Bitrate (ABR), renditions and segments
What it means: A rendition is an encoded bitrate/resolution version; a segment is a short time interval of media. ABR selects a suitable rendition for upcoming intervals.
Why this problem needs it: Bandwidth changes require a concrete player adaptation policy.
How to use it: Estimate throughput and buffer health; switch only at compatible aligned boundaries. The manifest identifies available versions and segments.
Example in this design: A four-second 3 Mbps segment takes eight seconds at 1.5 Mbps; five buffered seconds risk a stall.
When it fits: Useful when viewer bandwidth changes and the player must trade picture quality against stalls.
Alternative and limits: A fixed rendition is simpler but may stall or waste bandwidth. ABR cannot fix missing segments or incompatible encodings.
YouTube: HTTP Live Streaming (HLS), DASH and manifests
What it means: HLS distributes media through HTTP playlists and segment requests. DASH means Dynamic Adaptive Streaming over HTTP and uses its own presentation description; they are packaging/player protocol choices.
Why this problem needs it: Players need a standard manifest/segment protocol.
How to use it: Prepare compatible renditions and manifest entries, publish references only to verified media, and configure live-playlist freshness for the latency contract.
Example in this design: The manifest names aligned rendition segments and its declared cache policy.
When it fits: Useful when supported players should fetch adaptive media through HTTP caches.
Alternative and limits: Select the protocol by device support, latency and media protection requirements. A manifest is an index of media, not the video bytes or a rights decision.
YouTube: Content Delivery Network (CDN)
What it means: A CDN serves cacheable content from distributed locations nearer viewers, reducing repeated origin reads and network distance.
Why this problem needs it: Popular videos should not send every segment read to the origin.
How to use it: Use stable versioned media URLs, a bounded cache policy, and the agreed signed-access or entitlement checks. Plan cold-cache and miss admission at the origin.
Example in this design: Plan a cold-title miss burst rather than trusting the average cache hit rate.
When it fits: Useful when many geographically distributed users fetch the same media bytes.
Alternative and limits: Direct object storage/origin delivery can fit a small workload. A CDN neither transcodes media nor independently knows every rights change.
Interview scope and guarantees
Upload video, process playable renditions, retrieve metadata, and stream with adaptive quality. Search and recommendations are separate extensions. A video becomes playable only when a valid manifest references ready segments; processing failure should be visible to the uploader.
Capacity worksheet
Assume 100,000 uploads/day at 200 MB each: 20 TB/day input. Three output renditions totaling 2× input add 40 TB/day. One million concurrent viewers at 3 Mbps require 3 Tbps of delivery, so CDN distribution matters far more than scaling metadata API instances.
Concrete API contract
POST /videos/uploads {requestKey,size,checksum} -> 201 {videoId,uploadId,partUrls,expiresAt}
POST /uploads/{uploadId}/complete {parts,checksum} -> 202 {videoId,state:"processing"}
POST /videos/{id}/publish {expectedVersion} -> 202 {processingState}
GET /videos/{id} -> {metadata,manifestUrl}
GET /videos/{id}/processing -> {renditions,state}Data model and access paths
videos(video_id PK,owner_id,state,source_key,visibility,version)
transcode_tasks(video_id,profile,generation,state,output_prefix)
manifests(video_id,version,segment_keys,checksum)
rights(video_id,viewer_scope,expires_at)
uploads(upload_id PK,video_id,owner_id,request_key,request_hash,state,expires_at); UNIQUE(owner_id,request_key)Evolve a solution and explain each change
Read the diagram
Store and serve video / Upload an original object and create metadata without marking it playable. / One raw codec cannot serve every device or network.; Transcode asynchronously / Generate a pinned set of renditions and publish their manifests after verification. / Partial outputs and duplicate workers can create invalid playback states.; Deliver adaptively / Use a private origin and CDN; clients select segment renditions based on buffer and bandwidth. / A CDN improves delivery, not transcoding capacity or access control.
Step 1: Store and serve video
Upload an original object and create metadata without marking it playable. One raw codec cannot serve every device or network.
Step 2: Transcode asynchronously
Generate a pinned set of renditions and publish their manifests after verification. Partial outputs and duplicate workers can create invalid playback states.
Step 3: Deliver adaptively
Use a private origin and CDN; clients select segment renditions based on buffer and bandwidth. A CDN improves delivery, not transcoding capacity or access control.
Responsibility overview
Read the diagram
Viewer to Video API: request playback; Video API to Metadata DB: read playable manifest; Creator to Video API: publish source metadata; Metadata DB to Transcoder: processing intent; Transcoder to Object origin: write immutable renditions; Viewer to Object origin: CDN/origin segment bytes
Worked end-to-end scenario
A creator completes upload v12. Metadata becomes processing, and an outbox schedules transcoding for source version 1. Workers write segments to immutable output keys. Only a verified manifest referencing available segments becomes playable. If a worker crashes after writing the 720p rendition, retry resumes or replaces that attempt without publishing an incomplete manifest. A viewer begins at a modest bitrate; if bandwidth falls, the next segment can use a lower rendition. Removing a video updates visibility immediately at the authorization boundary while physical deletion and cached-byte reclamation follow a stated policy.
Why these access paths matter
Video metadata uses video ID and owner indexes. Renditions are keyed by video version, codec/profile, and segment identity. Processing attempts carry a fencing token; manifest publication checks the current source and attempt. Popular segments benefit from edge caching, while rare originals need not occupy every edge. Track segment errors separately from successful metadata reads.
Build the baseline first
Read the diagram
Uploader → object storage → verified source; Job queue → transcoder → immutable segments; Manifest publication → CDN → player
- Uploader → object storage → verified source.
- Job queue → transcoder → immutable segments.
- Manifest publication → CDN → player.
Evolve the design under load
Read the diagram
Profile queues → bounded GPU/CPU workers; Popular segments → edge cache → origin shield; Playback telemetry → quality aggregates → capacity decisions
- Profile queues → bounded GPU/CPU workers.
- Popular segments → edge cache → origin shield.
- Playback telemetry → quality aggregates → capacity decisions.
Defend the hardest decision
Adaptive bitrate playback requests short segments at a suitable quality based on measured throughput and buffer health. Aligned keyframes make switching renditions practical. Transcoding is asynchronous and independently retryable per profile or chunk. Publish a new manifest atomically only after every referenced required output is available. Keeping immutable segment URLs lets caches serve them safely without invalidation on every metadata change.
Read the diagram
The player chooses quality from buffer and bandwidth; the CDN serves immutable segment bytes.
Failure and recovery analysis
A transcoder crashes after writing some outputs. Retry into an attempt-specific prefix, verify the finished set, then commit the winning manifest generation. Collect orphan attempts later. During an origin outage, cached segments may continue playing, but cache misses fail; this is not full availability. A rights revocation requires an authorization policy consistent with URL and token lifetimes.
Security and privacy boundary
Scan uploads, enforce content ownership and viewing permissions, and limit signed playback token lifetime.
Interview follow-ups with reasoning
Question: How do you reduce startup latency?
Show answer and explanation
Answer: Keep initial segments small and cache manifests and early segments near users.
Question: What changes for live video?
Show answer and explanation
Answer: Add ingest, continuously published segments, and a latency-versus-buffer tradeoff.
Question: How do you manage processing cost?
Show answer and explanation
Answer: Prioritize required renditions and defer rarely watched high-resolution outputs.
Operate and verify the design
Time to first playable rendition, transcode retry age, startup delay and rebuffer ratio.
Kill a transcoder after partial output and verify no published manifest references missing segments.
A second scenario to test transfer
A video has 360p and 720p outputs ready, while 1080p repeatedly fails. If the product permits partial readiness, publish the two working renditions and retry the failing profile independently. The player should not advertise unavailable segments. Track time-to-first-playable separately from time-to-all-renditions so operators see the user impact of processing delays.
What should happen when one rendition fails but lower qualities are valid?
Show answer and explanation
Answer: Keep valid renditions playable if that meets the product contract, omit failed outputs from the manifest, and retry that profile with a bounded budget. Report partial readiness honestly rather than declaring all processing complete.
Compare alternatives
| Choice | Benefit | Cost |
|---|---|---|
| First-playable priority | Earlier viewing | Mixed readiness states |
| Immutable segments | Efficient CDN caching | Versioned cleanup |
| Independent rendition jobs | Targeted retries | More job coordination |
| Origin protection | Survives cold popularity | Admission and cache policies |
A design-changing exercise
All but one required segment exists. Should the manifest be advertised as ready?
Show answer and explanation
Answer: Not under an all-segments-ready contract. Publish only a verified manifest, or explicitly design progressive playback and its missing-segment behavior.
Design workshop: bytes, processing, and playable publication
Upload, process, publish and watch are core. Recommendations and live broadcasting are excluded. Choose ten-minute first-playable processing for an illustrative small upload target, playback startup p95 under two seconds and immutable published segments. Processing deadlines depend on admitted media size and queue backlog; do not promise one bound for arbitrarily large files.
POST /videos/uploads returns both videoId and uploadId, scoped signed part URLs and expiry. Completion verifies part list, content identity and supported checksums. The transaction then marks uploaded and emits a transcode intent. A publish request records visibility intent; the video becomes playable only when the required baseline rendition and manifest are verified. A retried complete returns the original processing identity, not a new transcode generation.
The DAG is probe→validated source→audio/video rendition jobs→segment verification→manifest publication. Pin codec settings, source version and generation. Rendition tasks have unique(video,source_version,profile,generation). Publish via compare-and-swap against the current generation after checking every advertised segment. A stale worker can leave orphan bytes for GC, but cannot replace a newer manifest.
Read the diagram
Complete verified upload u7 for video v7; DAG generation 3; independent 360p/720p/1080p jobs; Write immutable aligned segments for successful profiles; Verify baseline 360p and publish manifest version 3; State playable_partial; 1080p still retrying; Player fetches manifest then authorized segments
A minimal VOD media playlist for a six-second segment is:
#EXTM3U
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:6.0,
segments/g3/360p/0000.ts
#EXTINF:6.0,
segments/g3/360p/0001.ts
#EXT-X-ENDLISTThe variant playlist advertises only verified renditions with bandwidth and resolution. Align switching boundaries and keyframes across renditions; sequence numbers alone do not establish identical media time. The player estimates bandwidth and buffer and requests a lower rendition before underrun. The API handles authorization and metadata; it should not proxy every segment byte.
Read the diagram
Rendition / Calculation / Bytes before audio/overhead; 360p at 0.5 Mb/s / 0.5 × 600 / 8 MB / 37.5 MB; 720p at 2 Mb/s / 2 × 600 / 8 MB / 150 MB; 1080p at 5 Mb/s / 5 × 600 / 8 MB / 375 MB; All three / Sum of distinct renditions / 562.5 MB plus source and audio
One million complete plays at average 2 Mb/s for ten minutes transfer 150 TB, before transport overhead. Delivery bandwidth can dominate storage cost. A private CDN validates signed viewer/video/version grants, caches immutable segments under safe keys, and uses an origin shield to coalesce cold fetches. A viewer without a grant cannot fetch an origin object directly. Public content can use longer TTL; revoking a private grant has an explicit lifetime bound unless the edge checks current policy.
A task failure retries just that profile with bounded exponential backoff, then enters failed_profile rather than retrying the entire video forever. Delete cleanup waits for retention and live manifest references; GC does not delete current rendition bytes because one old task failed. Monitor queue age, source→first-playable time, profile failures, manifest errors, startup latency and rebuffer ratio separately.
Exercise: 1080p segments exist but one segment checksum fails. May the manifest list 1080p because the directory exists?
Show answer and explanation
Answer: No. Existence is not verified completeness. Advertise valid lower profiles if allowed and retry the broken profile. Use a generation-specific verified segment manifest as the publication boundary.
HTTP Live Streaming, RFC 8216 defines playlist/segment semantics; the DAG and readiness policy here are original application choices.
Requirement trace and verification
| Requirement | Implementing design block | Verification link |
|---|---|---|
| R1 — Complete the primary user journey within the stated scope. | P01–P04; P09–P10. | V1 — Exercise the successful journey and the excluded/boundary case stated in the scope. |
| R2 — Preserve the problem's authoritative data invariant under concurrency. | P05–P06; P11–P12; DD1. | V2 — Run the race/replay case below and assert the invariant at the durable authority. |
| R3 — Meet the declared scale and API behavior without unbounded work. | P05–P08; P13–P14; relevant overload deep dives. | V3 — Exercise the API errors/retry identity and recompute the workload assumption that drives partition or capacity. |
| R4 — Recover from the named failure without losing or duplicating the user-visible outcome. | P15–P16; deep dives; Operations contract. | V4 — Fail one transcode, upload a corrupt chunk, and miss CDN cache; never expose a manifest referencing incomplete segments. |
Operational contract
| Area | Decision and signals |
|---|---|
| SLIs | Upload completion; time to first playable rendition; transcode retry age; startup/rebuffer ratio; CDN origin miss rate. |
| Overload limits | Cap multipart concurrency, queued DAG tasks, worker slots, rendition fanout, and origin egress. |
| Recovery | Retry by processing generation; reconcile incomplete objects; publish only manifests whose referenced segments exist. |
| Access controls | Use scoped upload grants and private source access; serve only authorized manifests and immutable segments. |
| Dominant cost | Video storage retention, transcoding compute, and playback egress. |
Senior-level interviewer follow-ups
Question: A transcode finishes after a newer processing attempt has started. Which rendition becomes playable?
Show answer and explanation
Answer: Publish only if the attempt generation and source version still match the active video job. Rendition manifests are immutable, and a final readiness pointer switches atomically.
Question: How do you stop an upload retry from attaching chunks from a different video?
Show answer and explanation
Answer: Bind upload ID, object keys, checksums, owner, and expected manifest to one upload session. Completion validates every part before associating it with the video ID.
A 60-second design answer
I would separate upload, processing, and playback. The client uploads resumable verified chunks to object storage; completion commits an upload manifest. A durable job creates immutable renditions and a manifest, then publishes readiness only for the current generation. Playback serves adaptive segments through a CDN with authorization where needed. I would monitor ingest, transcode backlog, rendition failures, startup latency, and egress cost.
Related concepts to revisit
Handling Large Blobs Scaling Reads
Technical references
Object-store multipart upload.
PostgreSQL transaction isolation and concurrent updates.
Relate bitrate to segments and buffer state
A manifest offers 1,3,6 Mbps renditions. With an estimated sustainable 4 Mbps path, 3 Mbps may leave headroom while 6 Mbps risks draining the buffer. A four-second segment at 3 Mbps contains about 12 Mbit, or 1.5 MB before overhead. If bandwidth drops to 1.5 Mbps, that segment takes about eight seconds and cannot sustain four seconds of playback indefinitely; switch down using buffer/throughput policy.
renditions: 1,3,6 Mbps
path estimate 4 Mbps -> illustrative choice 3
4-second segment at 3 Mbps -> 12 Mbit
path drops to 1.5 Mbps -> about 8 seconds transferRead the diagram
renditions: 1,3,6 Mbps; path estimate 4 Mbps -> illustrative choice 3; 4-second segment at 3 Mbps -> 12 Mbit; path drops to 1.5 Mbps -> about 8 seconds transfer
Processing creates immutable renditions under an input/job generation. Verify the required segment set and publish a manifest only after readiness; a partial object upload is not a playable video. Retry encode under stable identity and reject stale worker publication. A CDN serves eligible segments; private video uses scoped authorization/capabilities and declared revocation behavior. Resumable input uploads are a separate state machine from playback adaptation.
Show answer and explanation
Answer: The player should not simply select the highest listed bitrate. The decision needs throughput, buffer, quality and safety margin, while the manifest describes which verified segments exist.
Decision review: YouTube
YouTube: What it is
A video exercise separates accepted upload, usable rendition publication and authorized playback through a byte-delivery path.
YouTube: Why it is needed
Media transfer and processing can partially succeed, while player bandwidth and buffer deadlines constrain playback independently.
YouTube: When to use it
Use asynchronous encoding and immutable outputs for variable large jobs; specify which rendition set makes a video ready.
YouTube: How to use it
Pin input/encoder generations, verify outputs and conditionally publish a playable manifest. Deliver authorized segments through a bounded origin/CDN path and let the player adapt to measured conditions.
YouTube: Compare an alternative
Initial-rendition publication gives faster readiness if the product allows later quality upgrades. Waiting for every required quality gives a different readiness promise.
YouTube: Worked decision exercise
The following inputs and policies are original exercise assumptions; they are not measurements or undisclosed company behavior.
A four-second segment at 3 Mbps contains about 12 Mbit. At 1.5 Mbps throughput it needs about eight seconds before overhead, so a player with only five seconds buffered cannot maintain that rate indefinitely.
Read the diagram
4-second segment x 3 Mbps = 12 Mbit; At 1.5 Mbps download takes about 8 seconds; Only 5 seconds buffered: adapt or stall; CDN locality does not remove viewer bandwidth limits
Does adding a CDN guarantee the high-bitrate segment reaches this viewer before its deadline?
Show answer and explanation
Answer: No. A CDN can improve locality and origin load but cannot remove the viewer bandwidth limit. Adapt a compatible aligned rendition, budget retry time and measure playable buffer. A delayed old encoder must also be fenced from publishing a newer manifest.
YouTube: Check the design
Track time to playable publication, startup delay, rebuffering, origin amplification and generation conflicts separately. An HTTP success is not evidence that media played.
Extension: Progressive quality and coherent publication recovery
Start with verified upload, task fencing and the playable-manifest baseline. This workshop adds same-source progressive quality, conditional publication/repair lineage, timeline compatibility and reader retention under current policy.
Deep dive: first playable and fully upgraded are different publications
The baseline already verifies resumable input, fences transcoders and publishes playable immutable media. This workshop adds progressive quality upgrades within one source generation, coherent timeline identity and recovery of an already-viewable video. It is an original user-generated-video exercise, not a description of YouTube's private implementation. Keep search, recommendation training and advertising outside this publication contract.
Separate source, processing, artifact and publication identities
An upload has owner, session ID, immutable source key/hash, size and accepted completion receipt. A source generation identifies the creator-selected input; replacing the input advances it. A processing specification pins encoder image/settings, packaging rules and required versus optional renditions. Each task has a logical profile identity and independently fenced attempt. A finished task produces immutable attempt-specific artifacts; only verified accepted outputs enter the artifact registry.
A publication revision is a conditional head change over a compatible set of accepted artifacts. It is not the largest task number, source generation or object directory listing. Keep a non-reused timeline identity for the media presentation. Trimming out an introduction changes the mapping from seconds to content even if the title/video ID stays the same. A codec re-encode that preserves the presentation can remain in a compatible timeline under a validated contract; a temporal edit must not inherit that claim automatically.
video(id PK, owner, current_source_generation, lifecycle, current_policy_version)
source(video, generation, immutable_key, source_hash, timeline_id)
processing_spec(id, encoder_digest, packaging_version, required_profiles, optional_profiles)
artifact(video, source_generation, spec, profile, accepted_attempt, manifest_hash, verified_state)
publication(video, revision, source_generation, timeline_id, spec, predecessor, artifact_set)
head(video PK, publication_revision, owner_epoch)
operation(owner, request_id, payload_hash, saved_result)Create/complete/publish operations keep scoped, payload-bound receipts. A retry of accepted upload completion returns the original processing identity, not a new source or job. Current authorization gates the response. A task's success event names the exact source/spec/profile/attempt/artifact digest; the authority verifies it before eligibility. Do not infer readiness from filenames, an object prefix or a worker's unverified success string.
Work a same-source quality upgrade and a delayed publisher
For source generation 4 and timeline T4, choose 360p and 720p as required for first publication, with 1080p optional. Both required profiles pass verification, so publication revision 10 becomes playable. An optional 1080p failure leaves revision 10 usable and exposes an upgrade failure to the uploader; it does not retract a coherent baseline or claim 1080p ready.
When 1080p is verified, an upgrade command names expected head 10 and the full compatible artifact set. It commits revision 11, preserving source 4/T4. A delayed publisher still based on 10 cannot overwrite 11 with only the old set or lose another accepted update. On conflict, reload the head and deliberately build a compatible new proposal. Never blindly retry with a new expected revision while retaining an incompatible stale artifact selection.
For this exercise an automatic upgrade can only add verified profiles to the same compatible source/spec/timeline. Removing a defective profile is an explicit repair publication: validate a still-playable required baseline, use expected-head arbitration and create revision 12 with repair lineage. Pointing the head numerically backward to 10 would confuse event consumers and conceal the repair. A required-profile defect may require replacement/reprocessing or temporary unavailability rather than pretending optional-profile removal fixes it.
A new input source generation 5 supersedes generation 4 for new publication. A late generation-4 1080p task cannot attach to generation 5 just because resolution and video ID match. A tombstoned video cannot publish either generation. Reader retention of old media does not grant new visibility. Moderation/access policy is independently current and cannot be rolled back by restoring an older media bundle.
Read the diagram
Source 4 publishes baseline revision 10 → Verified 1080p upgrades head to revision 11 → Delayed revision 10 proposal arrives → Expected head rejects obsolete artifact set → Repair or source changes need explicit lineage
Verify the presentation, not only the existence of its bytes
The publication manifest binds source, timeline, codec/initialization, profile, ordered segment identities, durations and verified hashes. For a thirty-second presentation with three ten-second intervals, every advertised required profile must cover compatible intervals [0,10), [10,20) and [20,30) with its matching initialization data. A segment numbered 2 from a different edit is not interchangeable with interval two of T4. Actual segment durations can vary; validate coverage/end conditions and allowed tolerances rather than assume every final segment has a full nominal duration.
Rendition switching requires compatible presentation boundaries and decodable initialization/keyframe conditions for the selected packaging/player. Merely labeling tracks 360p and 720p does not establish those properties. Captions, alternate audio and device/codec support need explicit required or optional status in the publication specification. A metadata row saying Ready is insufficient if referenced initialization, captions or segments are missing, corrupt or inaccessible to the authorized serving path.
Use immutable versioned manifests and segment keys. A playback session pins a compatible publication/timeline; the exercise starts new sessions on the latest eligible head while existing sessions continue the pinned valid version. To offer the new 1080p rendition mid-session, explicitly obtain/validate a compatible same-timeline manifest update at a supported switch boundary. A temporal edit cannot silently replace the current presentation or reinterpret a saved resume position. RFC 8216 describes HLS playlist and initialization/discontinuity mechanisms; the readiness specification and publication arbitration here are application policies.
Retain the version readers use without retaining its permission forever
Keep old published manifests/artifacts through active-reader pins, token lifetimes and declared retention. Publication and reclamation must share a reference authority or an equivalent proven protocol: a collector cannot delete an artifact while a valid publication/session is acquiring a reference. Failed attempts are distinct from accepted artifacts, and an obsolete task's cleanup cannot remove the winning attempt's immutable keys. Limit reader pin duration and renew only under current policy; otherwise abandoned sessions can prevent collection forever.
Visibility deletion or a private-policy change first denies new authorized requests under its stated serving contract. An active reference protects bytes from premature reclamation; it cannot override current access. Signed tokens already issued may retain a bounded lifetime unless every serving boundary performs the stronger current-policy check. Treat manifest, initialization, segment, subtitle, thumbnail and export paths consistently. Reverting to revision 10 cannot restore a newer denied video's access, and physical deletion cannot recall bytes already downloaded.
Recover publication state from durable head/operation/artifact evidence, then replay derived catalog notifications with stable identities. If an optional profile finished but publication did not, retry the original expected-head operation or create a reviewed new proposal after a conflict. If publication committed and its response was lost, resolve its receipt before interpreting the current head. Historical revision 11 success is not proof 11 is still the current public head after a later repair or takedown.
Budget first-playable work separately from optional upgrades
Assume 100,000 uploads/day at 200 MB each: 20 TB/day input. Outputs totaling twice the input add 40 TB/day before retention/replication. A thirty-minute video split into six-second intervals has 300 intervals per profile; three profiles create 900 media segments plus manifests/initialization and any extra tracks. Those are object/control operations as well as bytes.
If each upload requires 60 CPU-seconds for its baseline and another 120 for optional upgrades, the daily workload is 18 million CPU-seconds, averaging about 208.3 continuously busy cores before overhead. At a 70% utilization target that is roughly 298 equivalent cores. Reserve baseline and upgrade shares and bound per-creator outstanding work; an optional-quality burst must not starve first-playable work. Validate the estimate with content duration/codec/resource measurements rather than treating every upload as equal cost.
A 60,000-job upgrade backlog with 250/s safe processing and 100/s new upgrade arrivals needs at least 400 seconds to drain, before resource skew. Track upload acceptance, source-to-first-playable, source-to-all-selected-quality, verified-but-unpublished age and actual playback failures separately. A dashboard that averages them into one processing time can hide a broken required profile or indefinitely starved upgrade. Canary new specifications on compatible cohorts and retain a verified rollback/repair route without weakening current policy.
Upload-platform assessment: prove what revision actually advertises
Question: The optional 1080p job failed after 360p and 720p made revision 10 playable. Must the video become unavailable?
Show answer and explanation
Answer: Not under the stated required/optional policy. Keep coherent revision 10, expose optional failure honestly and retry within a separate bounded budget. Do not advertise unverified 1080p or retract a good baseline merely because an upgrade failed.
Question: Revision 11 includes verified 1080p, but a delayed publisher based on 10 submits only the older set. Can publication order be inferred from task completion time?
Show answer and explanation
Answer: No. Expected-head arbitration rejects the stale proposal. Reload and validate an intentional compatible proposal. Source generation, task attempt and publication revision serve different purposes; a repair is a new revision with lineage, not an unrecorded pointer rewind.
Question: A viewer pins T4 while a trimmed edit becomes T5. Can the player reuse a segment number or resume second 300 from the new edition?
Show answer and explanation
Answer: Not automatically. Segment ordinal and position require the bound timeline/initialization. Continue a retained eligible pinned presentation or explicitly transition with a validated mapping; current policy can still deny access. Reader pins are retention evidence, not permission.
Score one point each for source/spec/attempt/publication/timeline identity; required-versus-optional upgrade and expected-head arbitration; verified compatible presentation coverage; reader/reference recovery with current policy; finite baseline/upgrade/object/compute budgets. Letting an old publisher erase revision 11 or mixing a trimmed timeline by segment number is a critical failure. Repair the publication model, then retest with a lost upgrade reply, a defective required profile and a takedown during an old session.
What should happen when one rendition fails but lower qualities are valid?
Your design draft
Clarify assumptions, explain your approach, and test the difficult cases. Save your draft, then compare it with the study notes.
Self-review checklist
Self-guided practice. Automated AI feedback and code execution are not connected.