← Uber Interview Insights

Uber·Software Engineer·Onsite - Multi Round·Senior

Senior
Jul 2026

Summary

Uber SWE interview covering a pretty solid mix of coding and design. The questions ranged from thread-safe systems to scheduling problems with some interesting follow-ups that pushed beyond the obvious answers.

Questions Asked (4)

Q1

Design and implement a thread-safe Rate Limiter, then extend it to handle multi-threading, and also a version where the current time is not passed in as a parameter.

System DesignAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

The basic rate limiter wasn't bad but the follow-ups stacked up fast.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (e.g., rate limit algorithm, time source, thread-safety needs) and then design a simple, correct solution using a token bucket or sliding window. Implement it with proper synchronization, then extend to multi-threading and abstract the time source to allow injection for testability. Discuss trade-offs and potential optimizations.

Pro tip: Emphasize the importance of testability and separation of concerns: by abstracting the time source, you make the rate limiter deterministic and easy to test. Also, mention that using a monotonic clock avoids issues with system time changes.

1. Clarify Requirements

Ask questions to understand the expected rate limit (e.g., requests per second), the algorithm (token bucket, leaky bucket, fixed window, sliding window), and whether the limiter should be distributed or single-node. Confirm the need for thread-safety and the ability to inject time.

2. Design Single-Threaded Rate Limiter

Choose an algorithm (e.g., token bucket) and outline the data structures and logic. Explain how the limiter would work if only one thread accessed it, and how time is used to refill tokens or reset windows.

3. Make It Thread-Safe

Introduce synchronization mechanisms (e.g., mutex, atomic operations) to protect shared state. Discuss potential contention and how to minimize it (e.g., using lock striping or per-key locks if multiple keys are supported).

4. Abstract Time Source

Replace direct calls to system time with an injectable clock interface. This allows for deterministic testing and flexibility (e.g., using a monotonic clock). Show how the rate limiter can be constructed with a clock instance.

5. Discuss Trade-offs and Extensions

Compare algorithms (e.g., token bucket vs. sliding window) in terms of accuracy, memory, and complexity. Mention distributed rate limiting considerations (e.g., using Redis) and how the design would change.

Key Points to Mention

  • Choice of rate limiting algorithm (token bucket, leaky bucket, fixed/sliding window) and its implications.
  • Thread-safety mechanisms: mutex, atomic operations, lock-free approaches, and their performance characteristics.
  • Time abstraction: injecting a clock interface for testability and using monotonic time to avoid clock skew.
  • Handling multiple keys (e.g., per user or IP) and strategies to reduce lock contention (e.g., sharding).
  • Trade-offs between accuracy, memory usage, and complexity for different algorithms.
  • Distributed rate limiting: using a centralized store (e.g., Redis) and consistency challenges.

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

Q2

Implement binary search from scratch without using any standard library functions.

Algorithms & Data Structures
Author's notes

Classic.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem: confirm the input array is sorted, discuss handling duplicates, and define the return value. Then implement iterative binary search with careful mid calculation to avoid overflow, and test with edge cases like empty array, single element, and target not present.

Pro tip: Mention that you use `mid = left + (right - left) // 2` to prevent integer overflow, and discuss how binary search can be adapted for problems like finding the first/last occurrence or insertion point.

1. Clarify requirements and edge cases

Ask if the array is sorted, if duplicates exist, and what to return if the target is not found. Consider empty array, single element, and target at boundaries.

2. Choose iterative vs recursive

Decide on an iterative approach for O(1) space and better performance, or recursive for simplicity. Explain your choice.

3. Implement the algorithm

Write the code with correct loop condition (left <= right), mid calculation avoiding overflow, and proper updates to left and right.

4. Test with examples

Walk through test cases: target present, absent, empty array, duplicates, and large arrays to verify correctness and efficiency.

5. Analyze complexity and discuss variations

State time O(log n) and space O(1). Mention variations like finding first/last occurrence or using binary search on answer.

Key Points to Mention

  • Time complexity O(log n) and space complexity O(1) for iterative approach
  • Mid calculation: mid = left + (right - left) // 2 to avoid integer overflow
  • Loop condition: while left <= right, and updating left = mid + 1 or right = mid - 1
  • Handling duplicates: may need to find first or last occurrence
  • Edge cases: empty array, single element, target not found, target at boundaries
  • Return value: index of target or -1 if not found

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

Q3

Design a data structure with a getTopK method that returns the top K elements, using a doubly linked list as part of the approach.

Algorithms & Data StructuresData Modeling
Author's notes

Interesting constraint specifying the doubly linked list.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify requirements first (e.g., real-time updates, K size, data types). Then propose a hybrid structure: a hash map for O(1) access to nodes, a doubly linked list to maintain order for quick updates, and a min-heap or sorted list for top K retrieval. Explain how operations like insert, update, and getTopK work together, and discuss trade-offs.

Pro tip: At Uber, real-time data and scalability matter—mention how your design handles high-throughput updates and whether getTopK is called frequently. If so, consider maintaining the top K incrementally rather than recomputing.

1. Clarify Requirements

Ask about data size, update frequency, K value, and whether getTopK needs to be real-time. This shapes the design and trade-offs.

2. Propose Core Structure

Combine a hash map for O(1) access, a doubly linked list for order maintenance, and a min-heap or sorted list for top K. Explain how they interact.

3. Detail Operations

Describe insert, update, delete, and getTopK. For getTopK, if using a heap, extract K elements; if maintaining a sorted list, return the first K.

4. Analyze Complexity

State time and space complexity for each operation. For example, insert O(log n) with heap, getTopK O(K log n) or O(K) if pre-sorted.

5. Discuss Trade-offs and Optimizations

Compare approaches (e.g., heap vs. sorted list) and suggest optimizations like lazy deletion or incremental top K maintenance for frequent calls.

Key Points to Mention

  • Use of hash map for O(1) access to nodes in the doubly linked list.
  • Doubly linked list enables O(1) removal and insertion when combined with hash map.
  • Min-heap of size K for efficient top K retrieval, or maintain a sorted list for O(1) getTopK.
  • Handling updates: if an element's value changes, update its position in the heap/list and linked list.
  • Time complexity: insert O(log n) with heap, getTopK O(K log n) or O(K) if pre-sorted.
  • Scalability: consider concurrency, sharding, or approximate algorithms for very large data.

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

Q4

Design a Meeting Scheduler that finds open time slots across multiple calendars. Follow-ups included applying MapReduce to the scheduling problem and ranking rooms using priority factors like usage count and meeting duration.

System DesignAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

This one was the most fun and also the most chaotic.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then design a scalable system that merges multiple calendars to find common free slots. For follow-ups, explain how MapReduce can parallelize the computation and how to rank rooms using a weighted scoring model. Emphasize trade-offs between consistency, latency, and scalability.

Pro tip: Demonstrate awareness of real-world constraints like time zones, privacy, and partial availability, and proactively discuss how to handle them. Show that you can iterate from a simple solution to a distributed one, highlighting the evolution of your design.

1. Clarify Requirements

Ask about scale (number of users, calendars), latency requirements, and whether the system is for internal (e.g., meeting rooms) or external use. Confirm assumptions about time zones, privacy, and recurrence.

2. High-Level Design

Outline components: calendar service, scheduler service, database, and API. Describe how to fetch busy times from multiple calendars and compute free slots using interval merging.

3. Scalability with MapReduce

Explain how to parallelize free slot computation: map each calendar to busy intervals, shuffle by time slot, and reduce to find slots free for all. Discuss partitioning and fault tolerance.

4. Room Ranking

Define a scoring function for rooms based on factors like usage count and meeting duration. Describe how to compute and update scores, possibly using a priority queue or batch processing.

5. Trade-offs and Optimizations

Discuss trade-offs: consistency vs. availability, precomputation vs. on-demand, and caching strategies. Mention potential bottlenecks and how to mitigate them.

Key Points to Mention

  • Interval merging algorithm to find common free slots
  • MapReduce paradigm for distributed free slot computation
  • Weighted scoring model for room ranking (usage count, duration, etc.)
  • Handling time zones and daylight saving time
  • Privacy and access control for calendar data
  • Caching and precomputation for low-latency responses

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