REPOSITORY CODING · HARD
An interrupted broadcast skips partial material and replays old receipts
Follow receipt selection and completion reporting. Arrival order must not override a newer checkpoint, and partial playback must not be reported as complete.
Repository ImplementationBroadcast playout rehearsal
Work through a real codebase.
Choose an environment, investigate the existing implementation and use the tests to check your change. Sign in to open a workspace; execution and Ono usage follow your plan’s allowances.
Task requirements and environments
Go · 90 minute session
- This service rehearses a rundown after a playout interruption. It does not send media to a transmitter. Segments stay in the supplied order. Each segment uses source-frame offsets [in, out), inside its asset frame count.
- FPS is an integer from 1 to 120. Convert cumulative remaining frame boundaries to milliseconds with floor(frames * 1000 / fps). Do not round each segment independently. The time budget is a nonnegative millisecond count; retain over-budget cues and mark fits false.
- Receipts contain absolute frames already played within the trimmed segment. Select the greatest sequence per segment, independent of arrival order. Identical redelivery is allowed; conflicting values for the same sequence are an error. A later correction may reduce the played count.
- Build each remaining cue with sourceIn = in + played, unchanged sourceOut, contiguous start/end times and fits = end <= budget. Completely played segments have no cue and appear in complete, in rundown order. A partially played segment is not complete.
- Duration is the final remaining cue end, or zero. Overrun is max(0, duration - budget). IDs must be unique; reject unknown receipts, out-of-range progress, invalid trims, FPS and budgets. Arrays remain arrays when empty.