FastPrepDubbing Review Status Propagation

Dubbing Review Status Propagation

ElevenLabs logoElevenLabs● MediumFULLTIMEONSITE INTERVIEW
Learn

Problem statement

A dubbing project contains script lines grouped into media files. Every line starts PENDING. Process commands:

  • APPROVE lineId sets the line to APPROVED.
  • REQUEST_CHANGES lineId sets it to CHANGES_REQUESTED.
  • RERECORD lineId sets it to NEEDS_REVIEW, even if it was previously approved.
  • FILE fileId reports the file roll-up.

Each mutation contributes its resulting line status. A FILE command contributes CHANGES_REQUESTED if any line has that status, otherwise NEEDS_REVIEW if any line does, otherwise PENDING if any line does, and otherwise APPROVED.

Function

processDubbingReviews(lineIds: String[], fileIds: String[], operations: String[]) → String[]

Examples

Example 1

lineIds = ["L1","L2"]fileIds = ["F","F"]operations = ["FILE F","APPROVE L1","APPROVE L2","FILE F","RERECORD L1","FILE F"]return = ["PENDING","APPROVED","APPROVED","APPROVED","NEEDS_REVIEW","NEEDS_REVIEW"]

A re-recorded approved line makes the file need review again.

Example 2

lineIds = ["A","B","C"]fileIds = ["X","X","Y"]operations = ["APPROVE A","REQUEST_CHANGES B","FILE X","FILE Y"]return = ["APPROVED","CHANGES_REQUESTED","CHANGES_REQUESTED","PENDING"]

Changes requested take precedence in X, while Y remains pending.

Constraints

  • 1 <= lineIds.length = fileIds.length <= 100000
  • Line IDs are unique and every command references a known line or file.
  • 1 <= operations.length <= 100000

More ElevenLabs problems

See ElevenLabs hiring insights
public String[] processDubbingReviews(String[] lineIds, String[] fileIds, String[] operations) {
  // Write your code here.
}
lineIds["L1","L2"]
fileIds["F","F"]
operations["FILE F","APPROVE L1","APPROVE L2","FILE F","RERECORD L1","FILE F"]
expected["PENDING", "APPROVED", "APPROVED", "APPROVED", "NEEDS_REVIEW", "NEEDS_REVIEW"]
Checking account…