← Ramp Interview Insights

Ramp·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Ramp SWE interview with a graph traversal problem that had a lot of moving parts. The problem itself was interesting but I kept second-guessing the design decisions mid-explanation.

Questions Asked (1)

Q1

You're given a root URL that returns a JSON node in a directed graph. Each node can have outgoing URLs, optional passkeys, and optionally a terminal message. Traverse the graph to find the terminal node while handling 503/504 retries with exponential backoff, skipping 404s as dead ends, collecting passkeys and attaching them as headers on future requests, and avoiding cycles. Return the full path and the terminal payload.

System DesignAPI & IntegrationsAlgorithms & Data Structures
Author's notes

This one had layers and I didn't pace myself well unpacking them.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and edge cases, then outline a BFS/DFS traversal with a visited set to avoid cycles, a retry mechanism with exponential backoff for 503/504, and a passkey store that accumulates keys and attaches them as headers. Discuss how to handle 404s as dead ends and how to reconstruct the path to the terminal node, emphasizing correctness and efficiency.

Pro tip: Mention that you'd use a queue for BFS to find the shortest path and that you'd implement exponential backoff with jitter to avoid thundering herd problems. Also, highlight the importance of logging and monitoring retries and failures for observability.

1. Clarify Requirements and Constraints

Ask about expected graph size, rate limits, authentication details, and whether the graph is a DAG or can have cycles. Confirm the exact retry policy and backoff parameters.

2. Design Traversal Strategy

Choose BFS or DFS, maintaining a visited set to avoid cycles and a queue/stack for traversal. Track the path from the root to each node for reconstruction.

3. Implement Retry and Error Handling

For each request, implement exponential backoff with jitter for 503/504 errors, with a maximum retry limit. Treat 404 responses as dead ends and skip them.

4. Manage Passkeys and Headers

Collect passkeys from each node and attach them as headers to all subsequent requests. Ensure passkeys are accumulated and not lost during traversal.

5. Return Path and Terminal Payload

Once a terminal node is found, reconstruct the full path from root to terminal and return it along with the terminal message. If no terminal is found, return an appropriate error.

Key Points to Mention

  • Cycle detection using a visited set (e.g., hash set of URLs).
  • Exponential backoff with jitter for retries on 503/504, and a cap on retries.
  • Handling 404 as dead ends and not retrying them.
  • Accumulating passkeys and attaching them as headers on future requests.
  • Path reconstruction using parent pointers or a path stack.
  • Concurrency considerations: whether to parallelize requests or keep it sequential for simplicity and to respect rate limits.

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