FastPrepImpute Missing Values and Normalize Columns
Problems/Impute Missing Values and Normalize Columns

Impute Missing Values and Normalize Columns

Luma AI logoLuma AI● MediumFULLTIMEOA

Updated Sep 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A first-hand Luma AI assessment provides the full imputation and population-normalization contract, constraints, example, and tolerance. The practice task matches the report at about 99%.

In each column of dataset, treat zero as missing and replace it with the mean of that column's nonzero values. Then z-score normalize the imputed column using its population mean and population standard deviation.

Function

imputeAndNormalize(dataset: double[][]) → double[][]

Examples

Example 1

dataset = [[1,2,0],[0,1,1],[5,6,5]]return = [[-1.224744871391589,-0.4629100498862757,0.0],[0.0,-0.9258200997725514,-1.224744871391589],[1.224744871391589,1.3887301496588271,1.224744871391589]]

Zeros become the nonzero column means before population z-score normalization.

Constraints

  • 2 <= dataset.length <= 50.
  • 1 <= dataset[i].length <= 50 and all rows have equal length.
  • Every column has at least two different nonzero values.
  • Results use absolute tolerance 1e-5.

More Luma AI Online Assessment questions

  • Build a Gaussian Blur KernelOA · Seen Jun 2026
  • Center Crop a Grayscale ImageOA · Seen Jun 2026
  • Minimum Euclidean Distance Between PointsOA · Seen Jun 2026
  • Numerically Stable SoftmaxOA · Seen Jun 2026
  • Rotate a Rectangular Image ClockwiseOA · Seen Jun 2026
  • Triangle Flags from Adjacent ElementsOA · Seen Jun 2026

Similar questions at other companies

  • Rotate a Square Matrix 90 Degrees ClockwiseZipRecruiter · OAZipRecruiter interview questions
  • Survey Table: Group Given an AnswerSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Optimal Central WarehouseGoogle · ONSITE INTERVIEWGoogle interview questions
  • Linear Layer Forward and Backward PassesMeta · ONSITE INTERVIEWMeta interview questions
  • Implement Cross-Entropy LossOpenAI · PHONE SCREENOpenAI interview questions
  • Rotate a Square Grid ClockwiseC3.ai · ONSITE INTERVIEWC3.ai interview questions
  • Linear, Sigmoid and L2 Forward and Backward PassesNVIDIA · PHONE SCREENNVIDIA interview questions
  • Rotate ImageTokopedia · PHONE SCREENTokopedia interview questions
  • Rotate ImageSambaNova Systems · PHONE SCREENSambaNova Systems interview questions
  • Matrix MultiplicationeBay · ONSITE INTERVIEWeBay interview questions
All Luma AI interview questionsSee Luma AI hiring insights
Saved
class Solution {
    public double[][] imputeAndNormalize(double[][] dataset) {
        // Impute zero entries, then z-score every column.
    }
}
Checking account…