← Questions

Linear regression with hand-written gradient descent

0
DatabricksAmazonUberCodingLast asked Sep 2026

A coding interview question asked in Databricks's algorithms (two rounds) round and at Uber and Amazon, last asked Sep 2026. It tests machine learning, optimization and numpy.

Fit simple linear regression, y_hat = w x + b, with gradient descent that you write yourself. Given inputs x (one feature per example) and targets y, learn w and b and return them.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

machine learning · optimization · numpy

Your code and the AI tutor open when you unlock this question.