Batch Object Pool

Asked at Akuna Capital · Coding Questions · Difficulty: Easy · Last asked Oct 5, 2025

Implement an object pool that creates its nodes in fixed-size batches and keeps the unused ones on a free list. A pool avoids creating objects one at a time: when it runs out, it creates a whole batch at once. Your job is to make the pool hand out nodes correctly and report how many nodes are currently allocated.

Loading the problem…