Design a Distributed Matrix Transpose Service
Design an offline service that transposes one very large matrix across separate worker machines and publishes one exact immutable result.
Problem statement
For this exercise, assume a client submits an immutable square matrix stored as a versioned object and asks a pool of separate worker machines to transpose it.
The input may be too large for one machine, so workers must read bounded regions and materialize an output matrix whose value at row j, column i exactly equals the input value at row i, column j. A submitted job binds to one input version, dimension, cell format, and idempotency key.
Workers and coordinators may fail or retry, but no partial output may appear complete and one logical output region must not be committed twice with conflicting bytes. Operators can inspect progress and retrieve one immutable output manifest after success.
For this exercise, fixed-width cells, offline batch completion, and object-storage range access are in scope; sparse matrices, in-place mutation, arbitrary matrix operations, and interactive element updates are out of scope.
What to build
- Clients can idempotently submit a transpose job for one immutable matrix version and receive a stable job identifier.
- Separate worker machines can process bounded matrix regions and produce every transposed cell exactly once in its correct output position.
- Clients can inspect queued, running, succeeded, or failed job state plus bounded-lag progress and actionable failure details.
- Clients can retrieve one immutable output manifest only after every required region has been validated and committed.
At scale
- For this exercise, assume a matrix may have 100,000 rows and columns of fixed-width eight-byte cells, so the full input and output cannot fit on one worker.
- For this exercise, assume a job may use up to 100 worker machines, each with bounded memory and independent object-storage range access.
- For this exercise, target completion within 30 minutes for a maximum-size matrix under normal capacity while keeping job-status reads below 500 milliseconds at p95.
- For this exercise, worker and coordinator retries are expected; the visible output must be complete, checksum-validated, and byte-equivalent to a correct single-machine transpose.