← Uber Interview Insights

Uber·Machine Learning Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
Jun 2026

Summary

Uber ML engineer interview with a pretty deep numerical methods question. Not what I expected from a typical coding screen, felt more like a technical phone screen with a strong algorithms slant.

Questions Asked (1)

Q1

Implement a Python algorithm to minimize a 1D convex black-box function over a closed interval, without access to gradients. Cover method choice, stopping criteria, complexity, edge cases, and provide working code with a testing plan.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This one hit me sideways.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem constraints (convexity, black-box, no gradients) and then propose a derivative-free method like golden-section search or ternary search. Explain the algorithm's steps, stopping criteria, complexity, and edge cases, then provide clean Python code with tests. Emphasize why this method is suitable for convex functions and how it balances efficiency and simplicity.

Pro tip: Mention that for convex functions, golden-section search achieves linear convergence with a rate of ~0.618 per iteration, and that ternary search can be simpler but less efficient. Also, highlight the importance of handling floating-point precision and interval boundaries.

1. Clarify requirements and constraints

Confirm that the function is convex, evaluations are expensive, and no gradients are available. Discuss the need for a robust, derivative-free optimization method.

2. Choose the algorithm

Select golden-section search (or ternary search) due to its guaranteed convergence for unimodal functions. Explain the trade-offs: golden-section is more efficient than ternary search.

3. Define stopping criteria and complexity

Use interval width or function value change below a tolerance. State that each iteration reduces the interval by a constant factor, leading to O(log(1/ε)) evaluations.

4. Implement and handle edge cases

Write Python code for golden-section search. Handle cases where the minimum is at boundaries, function is flat, or tolerance is too small. Include input validation.

5. Test and validate

Test on simple convex functions (e.g., quadratic) and compare with known minima. Check convergence, boundary conditions, and performance with different tolerances.

Key Points to Mention

  • Golden-section search vs. ternary search: efficiency and convergence rate
  • Stopping criteria: absolute/relative interval width or function value tolerance
  • Complexity: O(log(1/ε)) function evaluations, independent of dimension
  • Edge cases: minimum at boundary, flat regions, numerical precision
  • Assumption of convexity/unimodality and its implications
  • Code structure: iterative loop, maintaining interval, and returning midpoint

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.