FastPrepOrdered Payload Release
Problems/Ordered Payload Release

Ordered Payload Release

Arcesium logoArcesium● MediumFULLTIMEONSITE INTERVIEW

Updated Sep 2026

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 interview questions

  • Decode Numeric StringONSITE INTERVIEW · Seen Jun 2026
  • Tree Ancestor QueriesONSITE INTERVIEW · Seen Jun 2026
  • City Infection NumberOA · Seen Jul 2025
  • Minimum Tunnel Crossing TimeOA · Seen Jul 2025
  • Product of Subset MaximaOA · Seen Jul 2025
  • Reconstruct the Root StreamOA · Seen Jul 2025
  • Add DigitsOA · Seen Aug 2023
  • Binary Tree Maximum Path SumOA · Seen Aug 2023
  • Detect a Cycle in Directed Hate RelationshipsOA · Seen Aug 2023
  • Reverse First K Characters in Every 2K BlockOA · Seen Aug 2023

Similar questions at other companies

  • Rectangle Point Coverage CountsOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
  • Transactional Key-Value StoreGrammarly · ONSITE INTERVIEW
  • Invoice / Payment ReconciliationStripe · PHONE SCREEN · ONSITE INTERVIEWStripe interview questions
  • LRU CacheApple · PHONE SCREEN · ONSITE INTERVIEWApple interview questions
  • LRU Cache for Query ResultsAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Sustained Overspeed AlertsFleetx · ONSITE INTERVIEW
  • Route Pattern MatcherGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Collatz Conjecture with Shared MemoizationBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Query Log MatchDatadog · PHONE SCREEN · ONSITE INTERVIEWDatadog interview questions
  • Random Dasher Set OperationsDoorDash · ONSITE INTERVIEWDoorDash interview questions
All Arcesium interview questionsSee Arcesium hiring insights
Saved
class Solution {
    public String[][] releasePayloadsInOrder(int[] sequenceNumbers, String[] payloads) {
      // write your code here
    }
}
Checking account…