← Back
00:00

Parallel Segment Sort

xAI interview questions · Easy · Coding round · 6 tests

A distributed sorting pipeline partitions work across k workers. Implement the coordinator: split the array into exactly k contiguous segments, sort each segment independently, then merge the segments into one globally sorted result.

Function signature

function parallelSegmentSort(data: number[], k: number): number[]

Rules

Idle