FastPrepOrdered Payload Release
Problems/Ordered Payload Release

Ordered Payload Release

Arcesium logoArcesium● MediumFULLTIMEONSITE INTERVIEW
QuestionFunctionExamples

Problem statement

Source note: This problem is backed by a real Arcesium virtual interview report. The report directly specified the ordered-release behavior, out-of-order buffering, one-time release rule, and the complete arrival sequence shown below. It did not provide a batch function signature, input limits, or behavior for a repeated sequence number before its first release. The core task match is about 95%.

Payloads arrive one at a time. The ith arrival has positive sequence number sequenceNumbers[i] and string payload payloads[i]. Payloads must be released in increasing sequence-number order, beginning with sequence number 1.

Process the arrivals in their given order:

  • If the arrival is ahead of the next expected sequence number, buffer it.
  • After each arrival, immediately release every contiguous buffered payload beginning with the next expected sequence number.
  • Release those payloads in increasing sequence-number order.
  • If a sequence number has already been released, ignore a later arrival with that sequence number.

Return one row for every arrival. Row i contains exactly the payloads released immediately after arrival i.

Function

releasePayloadsInOrder(sequenceNumbers: int[], payloads: String[]) → String[][]

Examples

Example 1

sequenceNumbers = [2,1,4,3,2,5]payloads = ["B","A","D","C","B","E"]return = [[],["A","B"],[],["C","D"],[],["E"]]

Sequence 2 is buffered until sequence 1 arrives, so the second arrival releases A and B. The same pattern releases C and D when sequence 3 arrives. The later duplicate of sequence 2 is ignored because it was already released.

More Arcesium problems

  • Decode Numeric StringONSITE INTERVIEW · Seen Jun 2026
  • Tree Ancestor QueriesONSITE INTERVIEW · Seen Jun 2026
  • City Infection NumberOA · Seen Jul 2025
All Arcesium interview questionsSee Arcesium hiring insights
Saved
public String[][] releasePayloadsInOrder(int[] sequenceNumbers, String[] payloads) {
  // write your code here
}
Checking account…