PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Machine Learning/Meta

Derive Linear Regression Solution

Last updated: Apr 16, 2026

Quick Overview

This question evaluates understanding of one-dimensional linear regression estimation, the statistical derivation of the mean squared error objective and closed-form parameter estimation, as well as recognition of degenerate data cases and comparisons between analytical and iterative optimization methods.

  • medium
  • Meta
  • Machine Learning
  • Machine Learning Engineer

Derive Linear Regression Solution

Company: Meta

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Technical Screen

Given training pairs `(x_i, y_i)` for a one-dimensional linear regression model without bias, `y_hat = w * x`, derive the mean squared error objective, solve for the optimal closed-form value of `w`, and implement a function that estimates `w` from data. Also explain what happens in the degenerate case where all `x_i` values are zero, and compare the closed-form solution with gradient descent.

Quick Answer: This question evaluates understanding of one-dimensional linear regression estimation, the statistical derivation of the mean squared error objective and closed-form parameter estimation, as well as recognition of degenerate data cases and comparisons between analytical and iterative optimization methods.

Related Interview Questions

  • Implement 1NN Embeddings and Forward Pass - Meta (hard)
  • Design and evaluate an ads ranking algorithm - Meta (easy)
  • How would you design a Shop Ads ranking algorithm? - Meta (easy)
  • Explain key ML metrics and techniques - Meta (medium)
  • Design an ad recommendation ranking approach - Meta (easy)
Meta logo
Meta
Feb 8, 2026, 12:00 AM
Machine Learning Engineer
Technical Screen
Machine Learning
3
0
Loading...

Given training pairs (x_i, y_i) for a one-dimensional linear regression model without bias, y_hat = w * x, derive the mean squared error objective, solve for the optimal closed-form value of w, and implement a function that estimates w from data.

Also explain what happens in the degenerate case where all x_i values are zero, and compare the closed-form solution with gradient descent.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Machine Learning•More Meta•More Machine Learning Engineer•Meta Machine Learning Engineer•Meta Machine Learning•Machine Learning Engineer 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.