PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Machine Learning/Databricks

Implement Linear Regression Gradient Descent

Last updated: Apr 16, 2026

Quick Overview

This question evaluates understanding of simple linear regression, batch gradient descent, loss function formulation, gradient derivation for model parameters, and training diagnostics such as learning rate, initialization, stopping criteria, feature scaling, and convergence evaluation.

  • medium
  • Databricks
  • Machine Learning
  • Machine Learning Engineer

Implement Linear Regression Gradient Descent

Company: Databricks

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Onsite

Implement simple linear regression from scratch using batch gradient descent. Given training data with one input feature `x` and target `y`, fit a model of the form `y = w * x + b`. Define the loss function, derive the gradients with respect to `w` and `b`, show the update rules, and explain practical choices such as learning rate, initialization, stopping criteria, feature scaling, and how you would evaluate whether training has converged.

Quick Answer: This question evaluates understanding of simple linear regression, batch gradient descent, loss function formulation, gradient derivation for model parameters, and training diagnostics such as learning rate, initialization, stopping criteria, feature scaling, and convergence evaluation.

Related Interview Questions

  • Implement Gradient Descent Regression - Databricks (medium)
  • Explain ROC-AUC vs PR-AUC tradeoffs - Databricks (hard)
  • Explain Linear Regression Feature Transformation Equivalence - Databricks (medium)
Databricks logo
Databricks
Jan 6, 2026, 12:00 AM
Machine Learning Engineer
Onsite
Machine Learning
2
0
Loading...

Implement simple linear regression from scratch using batch gradient descent.

Given training data with one input feature x and target y, fit a model of the form y = w * x + b. Define the loss function, derive the gradients with respect to w and b, show the update rules, and explain practical choices such as learning rate, initialization, stopping criteria, feature scaling, and how you would evaluate whether training has converged.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

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