← Roblox Interview Insights

Roblox·Data Scientist·Online Assessment (OA)·Intermediate

Intermediate
May 2026

Summary

Roblox data science interview with a coding problem that looked like a clean ML task but had a few gotchas hiding in the setup. The data was transposed from the usual sklearn convention and the tie-breaking rule was easy to miss.

Questions Asked (1)

Q1

Given a 2D array where rows are features and columns are observations, fit a logistic regression model with an intercept and no regularization, then return the top 3 feature names ranked by absolute coefficient value, breaking ties alphabetically.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The transposed layout tripped me up for longer than I'd like to admit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the data orientation and confirm that the model should include an intercept with no regularization. Then outline the steps: transpose the data if necessary, fit logistic regression, extract coefficients, and rank features by absolute value with alphabetical tie-breaking. Discuss potential pitfalls such as feature scaling and convergence issues.

Pro tip: Mention that scikit-learn's LogisticRegression uses L2 regularization by default, so you must set penalty='none' to disable it. Also, note that feature scaling is not required for logistic regression but can affect convergence and coefficient interpretation.

1. Clarify data orientation and requirements

Confirm that the input is a 2D array with rows as features and columns as observations. Ensure the model includes an intercept and no regularization.

2. Preprocess and fit the model

Transpose the data if needed to have observations as rows and features as columns. Fit logistic regression with fit_intercept=True and penalty='none' (or equivalent).

3. Extract and rank coefficients

Retrieve the model coefficients, compute their absolute values, and sort features by descending absolute coefficient. For ties, sort alphabetically by feature name.

4. Return top 3 feature names

Select the top 3 features from the sorted list and return their names.

Key Points to Mention

  • Data orientation: rows are features, columns are observations; may need to transpose for scikit-learn.
  • Logistic regression with intercept: set fit_intercept=True.
  • No regularization: set penalty='none' in scikit-learn (or C very large).
  • Coefficient extraction: use model.coef_ (and model.intercept_ for intercept).
  • Ranking: sort by absolute coefficient value, break ties alphabetically.
  • Potential issues: convergence warnings, feature scaling, and handling of categorical features.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.