Skip to content
Tech Interview Prep
Technical interview guide

Regression Analysis

Modeling a relationship between variables: linear regression's assumptions, and what R² does and doesn't tell you.

Read
46 min
Practice MCQs
25
Interview Q&A
25
Edition
v6
Editorial status
Reviewed

Scope: Standards and library references current as of 2026-09: NIST/SEMATECH e-Handbook, statsmodels, scikit-learn, and SciPy.

Curated: · Written: · Reviewed:

25 questions

MCQ-1A calibration run records five points: (0, 1), (1, 3), (2, 5), (3, 7), (4, 9). A sensor glitch then changes the last reading to 29, and the team refits a straight line to all five points by ordinary least squares. What slope does the refit report?
MCQ-10An engineer evaluates an ordinary least squares regression model and considers adding additional explanatory variables. Which statement accurately describes the behavior of the coefficient of determination (R-squared) and adjusted R-squared?
MCQ-14A team regresses `delivery_minutes` on an intercept and `plan` (levels: free, pro, enterprise). Fitting with all three levels one-hot encoded plus the intercept returns a singular design matrix, so they refit with `free` dropped as the reference level. The new coefficients are intercept 30, `plan_pro` 12, `plan_enterprise` 25. What does the model predict for a customer on the enterprise plan?
MCQ-18A model predicts 30-day readmission; the training base rate is 40%. The logistic regression coefficient for "discharged on a Friday" is 0.70. A teammate's slide says: "Friday discharge raises readmission risk by 101%." Which statement is correct?
MCQ-13An engineer audits an ordinary least squares regression model to isolate observations whose removal would drastically alter the model's global predictions. Which diagnostic metric quantifies the overall displacement across all fitted values when observation i is omitted from the dataset?
MCQ-8An engineering team fits a linear regression of service response time on request payload size, omitting background CPU utilization. Assuming higher CPU utilization both increases response time and is positively correlated with request payload size, how does this omission alter the estimated coefficient for payload size?
MCQ-15A model fitted to 400 production runs is yield = 5 + 2·temp + 3·pressure − 0.02·temp·pressure, where temp is in °C (runs span 20–80 °C) and pressure is in kPa (runs span 100–300 kPa). The team's draft reports "each extra degree of temperature adds 2 units of yield." At the plant's typical operating pressure of 250 kPa, what should the report say instead?
MCQ-12A calibration model y = β0 + β1·x is fit by OLS to 1,000 sensor readings with x ∈ [0, 100]. The underlying physics guarantees the response is exactly linear over the full operating range, and the residuals pass every in-sample diagnostic. A reading at x = 300 is scored. Which factor primarily widens its prediction interval?
MCQ-11A regression of response time on payload is fit to n = 8 requests (one predictor, 6 residual df, s = 9.25 ms, x̄ = 40 ms). At x = 40 ms the 95% confidence interval for the mean response is [112, 128] ms and the 95% prediction interval for a single new request is [96, 144] ms. Which accounts for the prediction interval being wider?
MCQ-3A team models p99 latency y (ms) against request rate r (thousand req/s) using n = 500 measurements taken at 500 distinct rates. The straight-line fit y = b0 + b1*r leaves a U-shaped residual pattern, so an engineer proposes y = b0 + b1*r + b2*r^2 and fits it with a general-purpose nonlinear least-squares routine started from random values. Every re-run returns coefficients that differ in the third decimal place, and one run reports reaching a local minimum. What should the review conclude?
MCQ-4A team fits monthly cloud spend (in $k) on request volume (in millions of requests) across 200 accounts and gets spend = 2.1 + 0.42 * requests, with R^2 = 0.91. Bucketing accounts by fitted value gives these residual summaries: fitted 5-15 $k, mean +0.3, sd 2.4, n = 70; fitted 25-45 $k, mean -0.5, sd 8.2, n = 70; fitted 60-90 $k, mean +0.6, sd 18.5, n = 60. Residuals plotted against requests show the same smooth spread, with no bend in the mean. Which conclusion and next step does this residual pattern support?
MCQ-5You regress log sale price on floor area for 500 homes. The residual spread widens as fitted values grow. OLS returns a slope of 0.120 with the default standard error 0.018; refitting with cov_type="HC3" leaves the slope at 0.120 but gives a standard error of 0.070. What should you report?
MCQ-6A team regresses daily revenue on daily ad spend over 400 days. OLS returns a slope of 0.42 with a conventional standard error of 0.10, so t = 4.2. The residuals have lag-1 autocorrelation ρ = 0.8 (Durbin–Watson 0.4). For this regressor the slope's variance inflation factor is approximately (1+ρ)/(1−ρ) = 9. What should the team conclude?
MCQ-20A team models failed deploys per service per quarter across 400 services. The sample mean is 3.2 and the variance is 14.8. They fit a Poisson GLM with a log(exposure) offset; the coefficient on 'has an on-call rotation' is −0.18 with a Poisson standard error of 0.06. A quasi-Poisson refit of the same model returns the same coefficient with a standard error of 0.13. Which conclusion does the evidence support?
MCQ-19A team fits an unpenalised logistic regression (statsmodels `Logit`, default settings) to 5,000 labelled accounts to predict chargeback. One feature, `chargeback_count_30d`, is 0 for all 4,960 non-chargeback accounts and ≥1 for all 40 chargeback accounts. The fit reports a coefficient of 24.7 for that feature with a standard error of 12,400, stops at the iteration limit, and shows 100% training accuracy. Which conclusion and next step is correct?
MCQ-2A team fits `salary ~ years_experience + years_at_company` on 2,000 employees. The two predictors correlate at 0.90 and have similar spread. The fit gives $4,000 per year of experience and $1,000 per year of tenure. Regressing salary on experience alone had given $4,900. A reviewer asks what the $4,000 means. Which reading is correct?
MCQ-7A team fits OLS on 1,200 home sales to predict price from 12 features, two of which are square footage and room count, correlated at r = 0.96. Held-out R² is 0.87; a model using square footage alone also scores 0.87. Across 200 bootstrap resamples the room-count coefficient ranges from +41k to −38k, and both features have VIF 12.8. Which conclusion does this evidence support?
MCQ-17A team fits `LassoCV(cv=5)` on 40 raw features. Two of them record the same physical measurement: `length_m` (values 0.4–2.5) and `length_mm` (400–2500, the same values in millimetres with rounding noise). Both correlate with the target at r ≈ 0.6. The fitted model gives `length_mm` a nonzero coefficient and sets `length_m` to exactly 0. What is the correct diagnosis and fix?
MCQ-16A team predicts 30-day readmission from 400 lab and vitals features on 120 patients. OLS fits the training set at AUC 0.96 but scores 0.58 in 5-fold CV. Ridge, with alpha chosen by the same 5-fold CV, reaches CV AUC 0.79 and keeps all 400 coefficients non-zero. Lasso at its CV-optimal alpha reaches CV AUC 0.74 with 12 non-zero coefficients. The 400 features fall into correlation blocks with pairwise |r| ≈ 0.85 inside a block. The clinical lead asks which model to ship and what the 12 lasso features mean. What is the right answer?
MCQ-21A pricing team regresses log(claim cost in dollars) on policy features with least squares, so every prediction is a log-scale mean. For one segment the fitted value is 3.0, and the residuals on the log scale are close to Normal with standard deviation 0.5. Underwriting sets reserves as 40,000 claims times the expected cost per claim for that segment. Which per-claim figure and reserve total follow?
MCQ-22A readmission model is trained on 50,000 discharges with `bmi` as a feature. `bmi` is missing for 12% of discharges. Discharges with missing `bmi` are readmitted at 22%, versus 11% for the rest. The team drops the 12% and trains on the remainder. What follows?
MCQ-9A platform team has 1,000 repos. Across all of them, linter adoption and review thoroughness are independent: 50% adopt the linter, 50% have thorough reviews, and the two are uncorrelated. A repo passes the quarterly security audit if it has the linter OR thorough reviews. The team restricts analysis to the 750 audit-passing repos and finds linter adoption and review thoroughness negatively correlated (r = -0.5). They conclude the linter makes reviewers lazy. What is the correct reading?
MCQ-25A team randomizes 12,000 users to a new onboarding flow or the old one and measures 90-day retention. The analyst fits retention_90d ~ assigned_flow + days_active_week1 + support_tickets and reports the assigned_flow coefficient as +3.1 pp (95% CI 2.4–3.8). Which conclusion about this estimate is correct?
MCQ-24A team has 400 samples, 12,000 gene-expression features and a continuous outcome. They run `SelectKBest(f_regression, k=100)` on all 400 samples, then 5-fold cross-validate a Ridge model on the 100 selected columns and report CV R² = 0.88. Asked to re-run with selection inside the pipeline, the same folds give CV R² = 0.31. Which conclusion is correct?
MCQ-23An API gateway team measures p99 latency for 500 endpoints. Week-1 p99 values are approximately Normal with mean 300 ms and standard deviation 100 ms. Week-2 values are an independent draw from the same distribution: no code, config or traffic changed between the two weeks. The team selects the 50 endpoints with the highest week-1 p99; their week-1 mean is 480 ms. What is the expected mean week-2 p99 of those same 50 endpoints?