← Uber Interview Insights

Uber·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Uber Data Scientist coding screen, one problem the whole time: implement square root rounded to one decimal without using any built-in. Felt manageable but the edge cases and optimization discussion caught me a bit flat-footed.

Questions Asked (1)

Q1

Without using a built-in square root function, implement a function that returns the square root of a non-negative real number rounded to one decimal place.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I went straight to binary search on the integer part and then iterated tenths, which worked but I fumbled when they asked about convergence and whether I could do better.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem constraints (e.g., precision, input range) and then propose an iterative method like Newton's method or binary search. Explain the algorithm step-by-step, analyze its convergence and complexity, and discuss potential edge cases and trade-offs.

Pro tip: Mention that you would validate the result by squaring and rounding, and discuss how to handle very large or very small numbers to avoid overflow or underflow.

1. Clarify requirements

Ask about input range, required precision, and whether the function should handle edge cases like zero or very large numbers.

2. Choose an algorithm

Select an iterative method such as Newton's method or binary search, and justify your choice based on convergence speed and simplicity.

3. Outline the algorithm

Describe the steps of the chosen method, including initialization, iteration formula, and stopping criterion.

4. Analyze complexity and trade-offs

Discuss time and space complexity, convergence rate, and compare alternatives (e.g., Newton vs. binary search) in terms of accuracy and efficiency.

5. Handle edge cases and rounding

Explain how to round to one decimal place, handle zero, and avoid numerical issues like division by zero or overflow.

Key Points to Mention

  • Newton's method (Newton-Raphson) for square root
  • Binary search approach for monotonic convergence
  • Convergence criteria and precision handling
  • Time and space complexity analysis
  • Edge cases: zero, very small/large numbers, negative inputs
  • Rounding to one decimal place and validation by squaring

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