← Uber Interview Insights

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

Senior
May 2026

Summary

Uber system design round for a software engineer role. The question was about building a follow/unfollow system with bidirectional lookups, which sounds straightforward until you actually have to justify every design decision out loud.

Questions Asked (1)

Q1

Design a class that manages user follow relationships and supports querying in both directions: who a user follows, who follows them, and whether a follow relationship exists between two users.

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

My first instinct was a single map from follower to a set of followees, and the interviewer immediately asked how I'd get all followers of a given user efficiently.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then propose a graph-based data model with adjacency lists for both directions. Discuss trade-offs between in-memory and distributed storage, and outline core operations with their time/space complexities.

Pro tip: Demonstrate awareness of real-world constraints at Uber's scale by discussing sharding strategies and hot-key mitigation for celebrity users, showing you think beyond basic data structures.

1. Clarify Requirements

Ask about expected scale (users, follows), read/write patterns, latency requirements, and consistency needs. Confirm if the system needs to be distributed or can be a single-node service.

2. Design Data Model

Propose a graph model with two adjacency lists: one for following and one for followers. Discuss using hash maps or sets for O(1) average-time operations.

3. Define Core Operations

Outline methods: follow(userA, userB), unfollow(userA, userB), getFollowing(user), getFollowers(user), and isFollowing(userA, userB). Specify return types and error handling.

4. Analyze Trade-offs

Compare in-memory vs. persistent storage, and discuss sharding, replication, and caching for scalability. Mention time/space complexity for each operation.

5. Address Scalability

Explain how to partition data (e.g., by user ID) and handle hot spots (e.g., celebrity users) using techniques like consistent hashing or read replicas.

Key Points to Mention

  • Use of adjacency lists (hash maps/sets) for bidirectional queries with O(1) average-time complexity.
  • Trade-offs between memory usage and query speed, and between consistency and availability.
  • Sharding strategies (e.g., by user ID) and handling of hot keys for scalability.
  • Idempotency of follow/unfollow operations and handling of duplicate requests.
  • Potential use of databases (SQL vs. NoSQL) and caching layers for persistence and performance.
  • Edge cases: self-follow, non-existent users, and concurrent updates.

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