FastPrepRemoval Pool
Problems/Removal Pool

Removal Pool

Citadel logoCitadel● MediumNEW GRADONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Citadel new grad onsite interview. The report mentions a coding question about deletion but does not keep its selection rule or its full task. We chose the starting pool, the indexes you are given, the swap-with-last order, the outputs, the limits, and the examples. Our version is about 45% the same as the reported question.

Start with a pool containing values in their given order. Each element is a separate item, so duplicate values are allowed. Process the integer indices in order.

  • If the pool is empty, append -1. Its index is zero and the pool stays empty.
  • Otherwise, the index is a valid zero-based index in the current pool. Append the value at that index, replace that slot with the final pool item, and remove the final slot.

Return the removed values and empty-pool results in index order. The swap-with-last rule defines the pool order after each removal. Do not modify the caller arrays.

Indices are supplied explicitly so the exercise has deterministic outputs. The task is removal only; it has no insertion operation. As an optional practice extension, explain why choosing each valid index uniformly removes each current item with equal probability.

Function

removePoolItems(values: int[], indices: int[]) → int[]

Examples

Example 1

values = [10,20,30,40]indices = [1,1,0,0,0]return = [20,40,10,30,-1]

Index 1 removes 20 and moves 40 into its slot, leaving [10,40,30]. The next index 1 removes 40, leaving [10,30]. The next two zero indices remove 10 and 30. The final empty-pool removal returns -1.

Example 2

values = [5,5,9]indices = [0,1,0]return = [5,5,9]

The first index removes one copy of 5 and leaves [9,5]. Index 1 then removes the other copy of 5. The last index removes 9.

Constraints

  • 0 <= values.length <= 100000.
  • 0 <= indices.length <= 100000.
  • 0 <= values[i] <= 10^9.
  • 0 <= indices[i] <= 100000.
  • Every index is less than the current pool size, or is zero when the pool is empty.

More Citadel Onsite Interview questions

  • Maximize Workday EarningsOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Minimum Changes for Palindromic BlocksOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Centered K-by-K Submatrix SumsONSITE INTERVIEW · Seen Aug 2026
  • Search Suggestions with a Prefix TreeONSITE INTERVIEW · Seen Aug 2026
  • Traverse Interior Matrix Cells in Row-Major OrderONSITE INTERVIEW · Seen Aug 2026
  • Time-Based Key-Value StorePHONE SCREEN · ONSITE INTERVIEW · Seen Feb 2026
  • 2048 Simulation and Board CodecONSITE INTERVIEW · Seen Jan 2026
  • Cancellable Priority Task QueueONSITE INTERVIEW · Seen Jan 2026
  • Dynamic Weighted SamplingONSITE INTERVIEW · Seen Jan 2026
  • Exchange Connection AlertsONSITE INTERVIEW · Seen Jan 2026

Similar questions at other companies

  • Customer Bootstrap APIDoorDash · PHONE SCREEN · ONSITE INTERVIEWDoorDash interview questions
  • Path Leaf Character IteratorGoogle · ONSITE INTERVIEWGoogle interview questions
  • Escape Room LeaderboardPinterest · PHONE SCREEN · ONSITE INTERVIEWPinterest interview questions
  • Implement MallocNVIDIA · ONSITE INTERVIEWNVIDIA interview questions
  • Circuit Breaker State MachineWise · ONSITE INTERVIEW
  • Durable Data WriterDatabricks · ONSITE INTERVIEWDatabricks interview questions
  • Memory AllocatorMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Ring Buffer OperationsAmazon · ONSITE INTERVIEW
  • Apply Overridden Integer TransformsOptimus Information · ONSITE INTERVIEWOptimus Information interview questions
  • Randomized Collection with Duplicate ValuesOkta · ONSITE INTERVIEWOkta interview questions

Interview reports that mention this question

  • Citadel SWE Intern Later Rounds and Superday: 13 Experiences

Citadel interview experiences

  • Citadel Securities Quant Researcher Intern Loop: 1 Experience
  • Citadel Securities Research Engineer Interview: 1 Experience
  • Citadel Securities SWE Intern First Round: 2 Experiences
  • Citadel Securities Experienced SWE Interviews: 1 Experience
  • Citadel SWE Intern First-Round Questions: 20 Experiences
All Citadel interview questionsSee Citadel hiring insights
Saved
class Solution {
    public int[] removePoolItems(int[] values, int[] indices) {
        // Write your code here.
    }
}
Checking account…