← Uber Interview Insights

Uber·Software Engineer·Technical Phone Screen·Senior

Senior
Jun 2026

Summary

Uber SWE interview that leaned heavily on graph theory and systems thinking. The coding problem was straightforward on the surface but the follow-up about production failure handling is where things got real.

Questions Asked (2)

Q1

Given N services and a list of dependency pairs where (A, B) means B must deploy before A, find a valid deployment order for all services. If a cycle exists, detect it and return something meaningful. Walk through your approach, implement it, and analyze the complexity.

Algorithms & Data StructuresSystem Design
Author's notes

I went with Kahn's algorithm because BFS feels more intuitive to explain out loud than recursive DFS.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the services as a directed graph and use topological sorting (Kahn's algorithm or DFS) to produce a valid deployment order. If a cycle is detected, return an error indicating the cycle and the involved services. Analyze time and space complexity, typically O(N + E).

Pro tip: Mention that in real-world systems, you might want to return the actual cycle path for debugging, and discuss how to handle dynamic dependency changes or partial deployments.

1. Understand the problem

Clarify that we need a linear ordering of services such that for every dependency (A, B), B comes before A. If no such order exists, detect and report a cycle.

2. Choose an algorithm

Select topological sort using either Kahn's algorithm (BFS with in-degree) or DFS with recursion stack. Both are efficient and standard.

3. Implement the solution

Build the graph and in-degree array. For Kahn's: repeatedly enqueue nodes with in-degree 0, decrement neighbors, and build order. For DFS: perform DFS and detect back edges.

4. Handle cycles

If the topological order doesn't include all nodes (Kahn's) or a back edge is found (DFS), return an error with the cycle details.

5. Analyze complexity

Time complexity is O(N + E) where N is number of services and E is number of dependencies. Space complexity is O(N + E) for storing the graph and auxiliary data.

Key Points to Mention

  • Topological sorting is the standard approach for dependency ordering.
  • Kahn's algorithm uses in-degree and a queue; DFS uses recursion stack for cycle detection.
  • Cycle detection: if the topological order size < N, a cycle exists.
  • Time and space complexity: O(N + E).
  • Edge cases: empty graph, disconnected components, self-dependencies.
  • Real-world considerations: returning the cycle path, handling dynamic updates, and parallel deployments.

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

Q2

How would you handle partial deployments, retries, and failure recovery in a real production environment for this kind of service dependency system?

System DesignTechnical Trade-offs
Author's notes

This is where the interview got interesting and also where I felt less prepared.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem around idempotency, state management, and observability, then walk through a concrete example of a partial deployment and how you'd detect and recover from it. Emphasize trade-offs between consistency, availability, and latency, and tie your answer to Uber's scale and reliability requirements.

Pro tip: Mention that you'd design for failure from the start—using idempotent operations, circuit breakers, and canary deployments—and that you'd measure success with SLOs like error budgets and recovery time objectives (RTO).

1. Clarify requirements and constraints

Ask about the service dependency system's expected scale, consistency needs, and latency SLAs to tailor your approach. Confirm whether the system is stateful or stateless and what failure modes are most critical.

2. Design for idempotency and retries

Ensure all operations are idempotent using unique request IDs and deduplication, and implement retries with exponential backoff and jitter. Discuss how to avoid retry storms and handle non-idempotent operations via compensation or sagas.

3. Implement partial deployment strategies

Use canary deployments and feature flags to roll out changes gradually, with automated rollback on error thresholds. Monitor key metrics (error rates, latency) and define clear rollback criteria.

4. Build failure recovery mechanisms

Incorporate circuit breakers, bulkheads, and timeouts to isolate failures, and use dead-letter queues for poison messages. Design for graceful degradation and automatic recovery with health checks and self-healing.

5. Ensure observability and continuous improvement

Instrument distributed tracing, logging, and metrics to detect partial failures quickly. Conduct post-mortems and use chaos engineering to validate recovery strategies.

Key Points to Mention

  • Idempotency keys and deduplication to safely retry operations
  • Exponential backoff with jitter and retry budgets to prevent cascading failures
  • Canary deployments and feature flags for safe partial rollouts
  • Circuit breakers, timeouts, and bulkheads for failure isolation
  • Dead-letter queues and compensation transactions (sagas) for recovery
  • Observability: distributed tracing, metrics, and SLOs for detection and validation

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