← Uber Interview Insights

Uber·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
May 2026

Summary

Uber system design round for a software engineering role. The problem was a referral tracking system with subtree aggregation, which sounds manageable until you actually have to talk through the scaling part under pressure.

Questions Asked (1)

Q1

Design a system to track customers and their referral chains, where each customer has their own revenue and an optional referrer. Support inserting new customers and querying the k customers whose total subtree revenue meets a minimum threshold, sorted ascending.

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

The tree structure part clicked pretty fast for me, parent pointers, store subtree sums, update ancestors on insert.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then propose a data model that supports efficient subtree revenue aggregation and threshold-based queries. Discuss trade-offs between different data structures and algorithms, and outline a scalable system design with appropriate storage and query processing.

Pro tip: Demonstrate awareness of real-world constraints by discussing how to handle updates and queries at scale, and mention potential optimizations like caching or materialized views.

1. Clarify Requirements and Scale

Ask questions to understand data volume, query frequency, latency requirements, and whether the referral graph is a tree or can have cycles. Confirm the exact query semantics: k customers with total subtree revenue >= threshold, sorted ascending by revenue.

2. Design Data Model and Storage

Propose a schema to store customers, their revenue, and referrer relationships. Consider using a graph or tree representation, and decide on a database (e.g., relational, graph, or custom) that supports efficient subtree aggregation.

3. Choose Algorithms for Insertion and Query

For insertion, update the new customer and propagate revenue changes up the referral chain. For query, compute subtree revenues and filter by threshold, then select top k. Discuss algorithms like DFS, segment trees, or Fenwick trees for efficient range queries.

4. Address Scalability and Trade-offs

Discuss how to scale with increasing data: sharding, caching, materialized views, or incremental updates. Compare trade-offs between real-time computation and precomputation, and between different data structures.

5. Summarize and Conclude

Recap the proposed design, highlighting how it meets the requirements and handles scale. Mention potential bottlenecks and future improvements.

Key Points to Mention

  • Tree traversal algorithms (DFS/BFS) for subtree revenue computation
  • Data structures for efficient aggregation (e.g., segment trees, Fenwick trees, or prefix sums)
  • Trade-offs between real-time computation and precomputation (e.g., materialized views, caching)
  • Handling updates: propagating revenue changes up the referral chain
  • Scalability considerations: sharding, partitioning, and distributed processing
  • Query optimization: indexing, sorting, and limiting results (top k)

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