← Stripe Interview Insights

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

SeniorPrefer not to say
May 2026Remote

Summary

Stripe system design round for a software engineer role. One big meaty graph problem that took the whole session. Left feeling like I covered maybe 70% of what they wanted to hear.

Questions Asked (1)

Q1

Design a bicycle route planning system over a weighted city graph where edges have distance, bike-lane availability, elevation gain, and traffic risk. Compute a composite-cost optimal route, support top-K alternatives, handle dynamic road closures, and produce turn-by-turn directions. Walk through data structures, algorithm choices, heuristics, complexity, correctness validation, and edge cases like disconnected components.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

This was basically a full 45-minute question.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by formalizing the graph model and composite cost function, then choose a shortest-path algorithm (e.g., Dijkstra with a binary heap) that supports dynamic edge weights and top-K alternatives. Discuss extensions like A* with admissible heuristics, dynamic updates via incremental algorithms, and turn-by-turn generation from the path. Validate correctness with invariants and test edge cases like disconnected components.

Pro tip: Emphasize that the composite cost must be a linear combination of normalized factors to avoid unit mismatches, and that top-K alternatives require a k-shortest paths algorithm (e.g., Yen's) rather than simple Dijkstra. Also, mention that dynamic closures can be handled with lazy deletion or by recomputing affected shortest paths.

1. Model the graph and cost function

Define vertices as intersections and edges with attributes (distance, bike-lane, elevation, traffic). Propose a composite cost as a weighted sum of normalized attributes, ensuring non-negative weights.

2. Choose core algorithm and data structures

Use Dijkstra with a priority queue (binary heap or Fibonacci heap) for single-source shortest path. For top-K, use Yen's algorithm or Eppstein's algorithm. For dynamic updates, consider dynamic shortest path algorithms or recomputation with caching.

3. Optimize with heuristics and handle dynamics

Apply A* with an admissible heuristic (e.g., Euclidean distance scaled by minimum cost per unit) to speed up queries. For road closures, mark edges as infinite weight and update affected paths lazily or via incremental recomputation.

4. Generate turn-by-turn directions

After computing the path, traverse edges and compute turn angles using coordinates of consecutive vertices. Map angles to instructions (left, right, straight) and include distance and street names.

5. Validate correctness and discuss complexity

Prove Dijkstra's correctness with non-negative weights, and analyze time complexity (O(E log V) for Dijkstra, O(K V (E log V)) for Yen's). Test edge cases: disconnected components, zero-weight edges, and dynamic updates.

Key Points to Mention

  • Composite cost function: weighted sum of normalized attributes (distance, bike-lane availability, elevation gain, traffic risk) with non-negative weights.
  • Dijkstra's algorithm with a priority queue for optimal route; A* with admissible heuristic for faster queries.
  • Top-K alternatives: Yen's algorithm or Eppstein's algorithm for k-shortest loopless paths.
  • Dynamic road closures: lazy deletion, incremental shortest path algorithms, or recomputation with caching.
  • Turn-by-turn directions: compute turn angles from vertex coordinates and map to instructions.
  • Edge cases: disconnected components (return no path), zero-weight edges (ensure non-negative), and dynamic updates (handle stale data).

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