← Uber Interview Insights

Uber·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Phone screen for a software engineer role at Uber. One coding problem, solved it reasonably fast, then spent a chunk of time on design tradeoffs which felt like the real test.

Questions Asked (2)

Q1

Given a binary tree, collect all leaf nodes, remove them, and repeat the process level by level until the tree is empty. Return the groups of leaves in order.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Got through it in about 25 minutes which felt okay.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem and edge cases, then propose a DFS-based solution that computes the height of each node (where leaf height = 0) and groups nodes by their height. Explain that this approach runs in O(n) time and O(n) space, and discuss trade-offs with alternative methods like iterative removal.

Pro tip: Mention that the height of a node corresponds to the round in which it becomes a leaf, so grouping by height directly yields the answer. This insight simplifies the solution and demonstrates deep understanding.

1. Clarify the problem

Confirm that leaves are nodes with no children, and that after removing leaves, new leaves are those whose children were removed. Ask about input size, tree balance, and output format.

2. Outline the approach

Propose a DFS that computes the height of each node, where leaf height is 0. Group nodes by height to form the result.

3. Detail the algorithm

For each node, recursively compute the height of left and right subtrees. The node's height is 1 + max(leftHeight, rightHeight). Add the node's value to the list for its height.

4. Analyze complexity

State that the algorithm visits each node once, so time complexity is O(n). Space complexity is O(n) for the recursion stack and output storage.

5. Discuss trade-offs

Compare with an iterative approach that repeatedly removes leaves, which could be O(n^2) in skewed trees. Highlight the efficiency of the height-based method.

Key Points to Mention

  • Definition of leaf nodes and how removal creates new leaves
  • Height of a node as the round it becomes a leaf
  • DFS post-order traversal to compute heights
  • Time and space complexity analysis
  • Handling edge cases: empty tree, single node, skewed tree
  • Comparison with iterative removal approach

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

Q2

How do you decide when stale data is acceptable, and how would you handle background thread timing and queue clearing in a real system?

System DesignTechnical Trade-offs
Author's notes

This came out of the coding question debrief and went on for 10+ minutes.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the decision around business impact and user experience, then walk through a concrete example of how you'd set staleness thresholds and design background processing with idempotency and backpressure. Emphasize trade-offs between freshness, cost, and complexity, and how you'd validate your choices with metrics and testing.

Pro tip: Tie staleness tolerance to specific SLAs and user-facing features (e.g., 'ride ETA can be 30s stale, but pricing must be real-time'), and mention that you'd make the staleness window configurable per data type to avoid one-size-fits-all failures.

1. Clarify requirements and constraints

Ask about the specific data, its consumers, and the cost of stale vs. fresh data. Identify SLAs, consistency needs, and system constraints like throughput and latency.

2. Define staleness tolerance

Propose a staleness budget per data type based on business impact (e.g., real-time for pricing, minutes for analytics). Explain how you'd measure and monitor staleness.

3. Design background processing

Describe how you'd schedule and coordinate background threads, including idempotent operations, retries with backoff, and avoiding thundering herds. Mention using queues with visibility timeouts and dead-letter queues.

4. Handle queue clearing and backpressure

Explain strategies for queue management: prioritization, rate limiting, and graceful degradation. Discuss when to drop stale messages vs. process them, and how to signal backpressure to producers.

5. Validate and iterate

Outline how you'd test the system (e.g., chaos engineering, load tests) and use metrics (queue depth, processing latency, staleness) to tune parameters over time.

Key Points to Mention

  • Business impact and user experience drive staleness decisions
  • Idempotency and exactly-once processing in background threads
  • Backpressure and queue management techniques (e.g., rate limiting, prioritization)
  • Monitoring and alerting on staleness and queue depth
  • Trade-offs between consistency, availability, and cost
  • Concrete examples from past projects or Uber-like scenarios

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