FastPrepQueued Seats
Problems/Queued Seats

Queued Seats

IMC Trading logoIMC Trading● MediumNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an IMC Trading new grad online assessment. Our version is about 99% the same as the original screenshots.

There are infinitely many seats numbered from 1. The people in arr initially stand in input order; person i wants seat arr[i].

  • Process the person at the front of the queue.
  • If their desired seat is unoccupied, assign it and remove that person from the queue.
  • Otherwise, increase their desired seat by 1 and move them to the end of the queue.

Return each person's final seat number in original input order.

Function

getSeatsAllocation(arr: int[]) → int[]

Examples

Example 1

arr = [1,2,3,2,4]return = [1,2,3,5,4]

Assignments are returned by original person index; occupied choices increase by one before requeueing.

Example 2

arr = [1,3,3,2,2]return = [1,3,4,2,5]

Assignments are returned by original person index; occupied choices increase by one before requeueing.

Example 3

arr = [2,2,1]return = [2,3,1]

Assignments are returned by original person index; occupied choices increase by one before requeueing.

Constraints

  • 1 <= arr.length <= 10^5
  • 1 <= arr[i] <= arr.length

More IMC Trading Online Assessment questions

  • Earliest Meeting Start on a 24-Hour ClockOA · Seen Nov 2026
  • Grid Paths with Override PassesOA · Seen Oct 2026
  • Weighted LFU CacheOA · Seen Sep 2026
  • Rock JumpingOA · Seen Aug 2026
  • Stack Batch RemovalOA · Seen Aug 2026
  • Chain of CommandOA · Seen Aug 2026
  • Choose ContainersOA · Seen Aug 2026
  • Sub-matrix SumsOA · Seen Jul 2026
  • Sub-matrix SumsOA · Seen Jul 2026
  • Can Every Package Fit in a BoxOA · Seen Jul 2026

Similar questions at other companies

  • Compress Editor Actions into Operational Transform OperationsReplit · OA · PHONE SCREEN · ONSITE INTERVIEW
  • Sum of Subarray MinimumsNVIDIA · OANVIDIA interview questions
  • Realized PnL with Oldest Inventory FirstBelvedere Trading · OA
  • Shopkeeper Final Price SummaryMicrosoft · OAMicrosoft interview questions
  • Nested Recipe Blocks (Game Adaptation)Roblox · OARoblox interview questions
  • Buffet Day GainsUpstart · OAUpstart interview questions
  • Minimum of Fixed-Window MaximaJuspay · OA
  • Maximum of Subarray MinimumsJP Morgan Chase · OAJP Morgan Chase interview questions
  • Profit AnalysisVirtu Financial · OAVirtu Financial interview questions
  • Maximum Capped Histogram Area After One RemovalMyntra · OAMyntra interview questions

Interview reports that mention this question

  • IMC Trading OA: What It Tests (2026)
  • IMC SWE New Grad OA and Interviews: 58 Experiences (Part 1 of 3)

IMC Trading interview experiences

  • IMC Trading SWE OA and Video: 18 Experiences (Part 3 of 3)
  • IMC Trading SWE OA Questions: 22 Experiences (Part 2 of 3)
All IMC Trading interview questionsSee IMC Trading hiring insights
Saved
class Solution {
    public int[] getSeatsAllocation(int[] arr) {
        // Write your solution here.
    }
}
Checking account…