PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Machine Learning/Uber

Implement 1D convex minimization in Python

Last updated: Mar 29, 2026

Quick Overview

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.

  • medium
  • Uber
  • Machine Learning
  • Machine Learning Engineer

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.

Related Interview Questions

  • Evaluate Promotions for Uber Eats Users - Uber (medium)
  • Implement Streaming Clustering for Numbers - Uber
  • Build cold-start restaurant ratings - Uber (medium)
  • Implement CLIP Contrastive Loss - Uber (medium)
  • Predict driver acceptance - Uber (medium)
Uber logo
Uber
Sep 6, 2025, 12:00 AM
Machine Learning Engineer
Technical Screen
Machine Learning
12
0

1D Black-Box Convex Minimization (Gradient-Free)

Task

Implement in Python an algorithm to minimize a 1D convex function F(x) over a closed interval [a, b] when gradients are unavailable and only function evaluations are allowed.

Requirements

  • Describe the approach (e.g., golden-section search) and why it works for 1D convex functions.
  • Specify stopping criteria and numerical tolerances.
  • Analyze the number of function evaluations and time/space complexity.
  • Explain how to handle noisy evaluations or flat regions.
  • Provide working code and a brief explanation.

Assumptions

  • F is convex and unimodal on [a, b].
  • Function evaluations may be expensive; gradients are unavailable.
  • Optional: evaluations may be noisy (random noise with zero mean).

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Machine Learning•More Uber•More Machine Learning Engineer•Uber Machine Learning Engineer•Uber Machine Learning•Machine Learning Engineer Machine Learning
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.