← 返回 instacart 的题目列表MLE Screen: Coding + ML Concepts
类型:qbank
MLE candidates often get two pre-VO rounds: a coding screen with short LeetCode-medium/easy problems and a separate ML concept screen. Recent topics include sorted squares, binary-search range boundaries, linear/logistic regression, bias-variance, and GD vs SGD convergence under MSE.
Requirements
Coding examples:
Squares of a sorted array: given a sorted integer array that may include negatives, return sorted squares.
Find first and last position: in a sorted list with duplicates, return the left and right boundary for a target.
Interviewer may ask for detailed edge cases and complexity even when the coding task is short.
ML concept examples:
Explain linear regression and logistic regression.
Bias-variance trade-off.
For MSE loss, do vanilla/full-batch gradient descent and SGD converge to the same point?
How do convexity, learning rate, stochastic gradient noise, and outliers change the answer?
Notes
Sorted squares is a two-pointer problem: compare absolute values at both ends and fill output from right to left. Complexity O(n) time, O(n) output space.
Boundary search should be two binary searches: lower bound for first >= target, upper bound for first > target, then derive [left, right].
For GD vs SGD under convex MSE: full-batch GD follows the exact empirical-risk gradient; SGD follows noisy unbiased estimates. With suitable learning-rate schedules and convex objective, SGD can converge in expectation / almost surely to an optimum, but finite-time trajectories and exact final points are not identical. With constant learning rate, SGD may hover around the optimum. Outliers affect both, but mini-batch sampling can make SGD's updates noisier and sometimes appear more robust depending on batching/clipping, not by default.
State assumptions before answering. The interviewer may be testing whether you distinguish ideal convex optimization from practical training dynamics.
Preparation
Drill lower_bound / upper_bound until you can write both without off-by-one errors.
Prepare a concise explanation of MSE convexity for linear regression.
Memorize the difference between convergence to the same optimum, same path, same finite-time iterate, and same stochastic distribution.
Have one example where SGD noise helps escape shallow non-convex regions, and one example where it hurts stability.