Preparing your design workspace

Loading the problem and your latest saved attempt…

Design Memory-Bounded Ordinary Least Squares

Design an out-of-core regression pipeline for a 25 GB CSV with 3,000 features, preserving numerical reliability and bounded memory.

Problem statement

You are given a 25 GB CSV containing over one million rows. Each row contains 3,000 floating-point features and one label, and the dataset does not fit in memory. How would you perform ordinary least squares under this memory constraint?

For this exercise, assume one authorized analyst submits an immutable local or object-storage snapshot to a batch service. A fitting worker has a hard 2 GiB resident-memory limit and 100 GiB of temporary disk.

Fit a linear model with an intercept, return coefficients and a residual summary, and report malformed data or detected numerical rank deficiency clearly rather than silently returning an unreliable model.

Multiple sequential passes and temporary on-disk artifacts are allowed; runtime is a trade-off to explain, not a fixed completion SLA. A cancelled or failed job must not expose a successful result. Feature selection, imputation, regularization, online training, and serving predictions are outside scope.

Assume finite numeric inputs with one fixed schema; bitwise equality across numerical libraries is not required.

What to build

  1. Submit and validate one immutable dataset snapshot and regression configuration without loading the CSV into memory.
  2. Compute an ordinary-least-squares fit with an intercept using bounded memory and produce numerical diagnostics.
  3. Expose durable job progress and cancellation, recover completed intermediate work safely, and publish only a complete verified result.

At scale

  • The source dataset is 25 GB, contains over one million rows, and has 3,000 floating-point features plus one label per row.
  • For this exercise, assume each fitting worker has 2 GiB of RAM and at most 100 GiB of temporary disk; admit only one fitting job per worker.
  • For this exercise, allow multiple sequential passes over an immutable input and prioritize memory safety and numerical reliability over a fixed runtime target.