Reported May 2025
ElevenLabshash table

Dubbing Review Status Propagation

Reported by candidates from ElevenLabs's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live ElevenLabs OA. Under 2s to a working solution.
Founder's read

Both lineIds and operations can hit 100000, so rescanning a file's lines on every FILE command is the trap in this ElevenLabs OA, reported in May 2025. Rescan a big file 100000 times and you're at 10^10 operations. The task is a state-tracking problem: lines flip between four statuses, and each file needs a roll-up with strict precedence. The fix is per-file counters, not per-query scans. If you blank on the bookkeeping during the live assessment, StealthCoder runs invisibly as a safety net and hands you the structure while you keep typing.

The problem

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

Reported by candidates. Source: FastPrep

Pattern and pitfall

Keep a map from lineId to its current status and its fileId. For each file, keep a count of lines in each of the four statuses. On a mutation, decrement the old status count for that line's file, increment the new one, update the line, and append the new status to the output. On FILE, check counts in precedence order: CHANGES_REQUESTED, then NEEDS_REVIEW, then PENDING, else APPROVED. Every operation is O(1), so total work is O(n + m). The common pitfall is the rescan, which times out. Another is forgetting that RERECORD overrides APPROVED, so you must decrement the old status correctly. Initialize every file's PENDING count to the number of its lines. Also remember a mutation outputs the line's status, not the file's. StealthCoder is the hedge if you freeze on the counter design during the live OA.

Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.

If this hits your live OA

You can drill Dubbing Review Status Propagation cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass ElevenLabs's OA.

ElevenLabs reuses patterns across OAs. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Dubbing Review Status Propagation FAQ

What's the trick in the Dubbing Review Status Propagation problem?+

Maintain per-file counts of lines in each status instead of rescanning. Every command then runs in O(1). A FILE query just checks counts in precedence order: CHANGES_REQUESTED, NEEDS_REVIEW, PENDING, APPROVED.

How hard is this ElevenLabs OA question really?+

Easy to medium. There's no fancy algorithm. The difficulty is spotting that 100000 lines and 100000 operations rule out per-query scans, then keeping the counters consistent on every status change.

What's the most common bug?+

Updating the new status count but forgetting to decrement the old one. It shows up with RERECORD on an approved line, where APPROVED must drop and NEEDS_REVIEW must rise. Also, applying the same status twice shouldn't double count.

What does a mutation command output versus a FILE command?+

A mutation outputs the line's new status, like APPROVED or NEEDS_REVIEW. A FILE command outputs the file roll-up using precedence. Example 1 shows this: APPROVE L1 returns APPROVED even though the file is still PENDING.

How do I prepare for this in 48 hours?+

Practice problems where you maintain aggregate counters under updates, using hash maps keyed by id. Write the solution once with a map of line to status and a map of file to a four-slot count array. Then test both examples by hand.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with ElevenLabs.

OA at ElevenLabs?
Invisible during screen share
Get it