Implement 1D convex minimization in Python
Company: Uber
Role: Machine Learning Engineer
Category: Machine Learning
Difficulty: medium
Interview Round: Technical Screen
Implement in Python an algorithm to minimize a 1D black-box convex function F(x) over a closed interval [a, b]. Assume F is convex on [a, b], gradients are unavailable, and only function evaluations are allowed. Describe your approach (e.g., golden-section search), specify stopping criteria and numerical tolerances, analyze the number of function evaluations and time/space complexity, and explain how you would handle noisy evaluations or flat regions. Provide working code and a brief explanation.
Quick Answer: This question evaluates skill in gradient-free 1D convex minimization, black-box numerical optimization, and algorithmic analysis—covering selection of a search strategy, stopping criteria and tolerances, handling noisy or flat evaluations, and estimation of function-evaluation and time/space complexity.