← Uber Interview Insights

Uber·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Went through a technical phone screen for a software engineer role at Uber. Two coding questions, one pretty standard and one that tripped me up more than I expected.

Questions Asked (2)

Q1

Given a set of intervals, merge all overlapping ones and return the result.

Algorithms & Data Structures
Author's notes

Classic problem, I'd seen it before so I wasn't too worried.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem: intervals are likely given as an array of [start, end] pairs, and the result should be a new array of merged intervals. The optimal approach is to sort intervals by start time, then iterate through them, merging overlapping intervals into a result list. This yields O(n log n) time due to sorting and O(n) space for the output.

Pro tip: Mention edge cases upfront, such as empty input, single interval, and intervals that are adjacent but not overlapping (e.g., [1,2] and [2,3]—clarify if they should merge). Also, discuss whether the input can be modified and if the output needs to be sorted.

1. Clarify the problem

Ask about input format, whether intervals are inclusive, if adjacent intervals should merge, and if the input is sorted. Confirm expected output format.

2. Sort intervals

Sort the intervals by their start times. This ensures that any overlapping intervals will be adjacent in the sorted list.

3. Iterate and merge

Initialize an empty result list. For each interval, if the result list is empty or the current interval does not overlap with the last interval in the result, append it. Otherwise, merge by updating the end of the last interval to the maximum of both ends.

4. Return result

After processing all intervals, return the result list containing the merged intervals.

5. Analyze complexity and edge cases

State time complexity O(n log n) due to sorting, space O(n) for output. Discuss edge cases like empty input, single interval, and all intervals overlapping.

Key Points to Mention

  • Sorting by start time is crucial for the linear scan approach.
  • Overlap condition: current.start <= last.end (or < if strict).
  • Merging by updating the end to max(last.end, current.end).
  • Time complexity: O(n log n) due to sorting; space O(n) for output.
  • Edge cases: empty input, single interval, adjacent intervals, unsorted input.
  • In-place vs. new array: clarify if input can be modified.

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

Q2

Design a system that finds the top K most frequent elements from a data stream in real time.

Algorithms & Data StructuresSystem Design
Author's notes

This one hurt a little.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem constraints: data stream characteristics (volume, velocity, distribution), definition of 'real-time', and whether exact or approximate results are acceptable. Then propose a solution using a hash map for frequency counts and a min-heap of size K for top-K tracking, discussing trade-offs and potential optimizations for high-throughput scenarios.

Pro tip: Demonstrate awareness of real-world constraints at Uber by discussing how to handle out-of-order events, late data, and skewed distributions, and mention approximate algorithms like Count-Min Sketch or Space-Saving for memory efficiency.

1. Clarify Requirements

Ask about data stream volume, velocity, memory limits, latency requirements, and whether exact or approximate top-K is needed. Also confirm if the stream is infinite and if elements can be evicted.

2. Propose Basic Solution

Outline a solution using a hash map to maintain frequency counts and a min-heap of size K to track the top K elements. Explain how each incoming element updates the counts and heap in O(log K) time.

3. Optimize for Scale

Discuss limitations of the basic approach (memory, heap operations) and introduce optimizations: approximate algorithms (Count-Min Sketch, Space-Saving), sliding windows, or distributed processing with sharding and merging.

4. Address Real-World Challenges

Cover handling of out-of-order events, late data, skewed distributions, and fault tolerance. Mention techniques like watermarking, time windows, and consistent hashing for distributed counting.

5. Summarize and Evaluate

Summarize the chosen approach, discuss trade-offs (accuracy vs. memory vs. latency), and suggest metrics for evaluation (throughput, latency, memory usage, accuracy).

Key Points to Mention

  • Hash map for frequency counting
  • Min-heap of size K for top-K tracking
  • Time complexity: O(log K) per element for heap updates
  • Approximate algorithms (Count-Min Sketch, Space-Saving) for memory efficiency
  • Sliding window or time-based decay for recency
  • Distributed processing with sharding and merging for scalability

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