PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Machine Learning/Roblox

Fit logistic regression and return top features

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of binary logistic regression, coefficient-based feature importance, and practical model-fitting considerations such as intercept inclusion and input shape handling.

  • hard
  • Roblox
  • Machine Learning
  • Data Scientist

Fit logistic regression and return top features

Company: Roblox

Role: Data Scientist

Category: Machine Learning

Difficulty: hard

Interview Round: Take-home Project

You are given: - `X`: a 2D numeric array where **each row is a feature** and each column is an observation (shape: `n_features x n_samples`). - `feature_names`: a list of length `n_features`. - `y`: a binary outcome array of length `n_samples` with values in {0, 1}. Task: 1) Fit a (binary) **logistic regression** model to predict `y` from `X`. - Include an intercept. - No regularization unless explicitly stated. 2) Rank features by the absolute value of their fitted coefficients (exclude the intercept). 3) Return the **top 3 feature names** by `|coef|` (break ties by lexicographic order of `feature_names`). Output: - A list of 3 strings (feature names).

Quick Answer: This question evaluates understanding of binary logistic regression, coefficient-based feature importance, and practical model-fitting considerations such as intercept inclusion and input shape handling.

Related Interview Questions

  • Normalize features and rank logistic coefficients - Roblox (hard)
  • Explain an ML project end-to-end with tradeoffs - Roblox (Medium)
  • Design leakage-free predictive maintenance pipeline - Roblox (hard)
  • Design real-time payments fraud model under constraints - Roblox (hard)
  • Rank features using logistic regression coefficients - Roblox (easy)
Roblox logo
Roblox
Nov 23, 2025, 12:00 AM
Data Scientist
Take-home Project
Machine Learning
2
0

You are given:

  • X : a 2D numeric array where each row is a feature and each column is an observation (shape: n_features x n_samples ).
  • feature_names : a list of length n_features .
  • y : a binary outcome array of length n_samples with values in {0, 1}.

Task:

  1. Fit a (binary) logistic regression model to predict y from X .
    • Include an intercept.
    • No regularization unless explicitly stated.
  2. Rank features by the absolute value of their fitted coefficients (exclude the intercept).
  3. Return the top 3 feature names by |coef| (break ties by lexicographic order of feature_names ).

Output:

  • A list of 3 strings (feature names).

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Machine Learning•More Roblox•More Data Scientist•Roblox Data Scientist•Roblox Machine Learning•Data Scientist Machine Learning
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.