Fit OLS with a two-way interaction term and return the interaction coefficient
Role: Data Scientist
Category: Machine Learning
Difficulty: easy
Interview Round: Other
Overview: Fit an ordinary least squares model with two main effects and their product term, then return the interaction coefficient as a float. It tests building a design matrix by hand, keeping the intercept and main effects, and reading the right coefficient from NumPy, statsmodels or scikit-learn.