Verified interview challenge
Sort integers with bounded worker threads
Distribute sorting work across threads and combine the pieces into one correctly ordered result.
Unlock with Full AccessThe challenge
Sort a large integer list using a bounded number of worker threads, preserving duplicates and leaving the input unchanged. Each worker can sort a portion, but the final result must be ordered across all portions.
Implement the division of work and the combination of its results, then explain the practical limits of the approach. The exercise distinguishes correct concurrent execution from an assumption that adding threads always makes a workload faster.
What you'll practise
Bounded concurrency
Partition work while respecting the worker limit and small-input behaviour.
Result merging
Combine independently sorted chunks without losing values or changing the input.
# Your implementation goes here
# Run examples and inspect results
# Full starter code includedRun your code to see results.