← Uber Interview Insights

Uber·Machine Learning Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
May 2026

Summary

Uber MLE interview with a system design question that had a versioning twist I wasn't fully expecting. The core idea is a social graph but the snapshot requirement is what makes it interesting and where most candidates probably trip up.

Questions Asked (1)

Q1

Design a social network that supports follow and unfollow operations, plus the ability to create snapshots of the relationship graph at any point in time. Historical snapshots must remain queryable even after subsequent unfollows. Implement Follow, Unfollow, CreateSnapshot, and IsFollowing with snapshot version support.

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

The follow/unfollow part is trivial, a set per user and you're done.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: scale, snapshot frequency, and query patterns. Then propose a design that combines a persistent graph store with versioned snapshots, using techniques like copy-on-write or append-only logs. Discuss trade-offs between storage, latency, and consistency, and outline how to implement the four operations efficiently.

Pro tip: Emphasize that snapshots can be implemented as immutable views over a versioned edge list, avoiding full copies. Also, mention that for ML applications at Uber, such historical graphs enable temporal link prediction and feature engineering.

1. Clarify Requirements and Scale

Ask about expected number of users, follow operations per second, snapshot frequency, and query patterns (e.g., point-in-time queries, range queries). This informs storage and indexing choices.

2. Design Core Data Model

Propose a versioned edge list where each follow/unfollow is an event with a timestamp or version. Use an append-only log or a graph database with temporal support. Consider partitioning by user or time for scalability.

3. Implement Snapshot Mechanism

Snapshots can be created by recording the current version number or by materializing a view. Use copy-on-write or persistent data structures to avoid full copies. Ensure snapshots are immutable and queryable.

4. Define Operations and Query Logic

For Follow/Unfollow, append events. For IsFollowing, check the latest event before the snapshot version. For CreateSnapshot, record the current version. Discuss indexing for fast lookups.

5. Discuss Trade-offs and Optimizations

Compare approaches: full snapshot vs. delta, in-memory vs. disk-based, consistency vs. latency. Mention caching, compression, and garbage collection of old versions if needed.

Key Points to Mention

  • Versioning with timestamps or monotonically increasing version numbers
  • Append-only log or event sourcing for follow/unfollow operations
  • Copy-on-write or persistent data structures for efficient snapshots
  • Indexing strategies (e.g., composite key on (user, followee, version))
  • Trade-offs between storage cost and query performance
  • Use cases for ML: temporal graph analysis, feature engineering

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