← Back
00:00

[CodeSignal] Round-Robin Package Dispatcher

Capital One interview questions · Hard · OA round · 6 tests

Packages arriving at a logistics hub are handed out to processing stations one after another in a rotating (round-robin) fashion.

Interface

simulatePackageDispatcher(
  stationCapacity: number[],
  dailyLog: string[],
): number[]

Input meaning

  • stationCapacity[i] gives how many packages station i can take before it counts as full.
  • Every string in dailyLog is one of two commands:
    • 'PACKAGE' - a single package needs a station;
    • 'CLOSE i' - station i shuts down for good.

Rules

Idle