← Ramp Interview Insights

Ramp·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Ramp software engineer interview with a practical systems/networking problem that's less about clever algorithms and more about whether you can actually wire things together without breaking everything. The problem sounds deceptively simple until you start thinking about retries, cycles, and concurrency.

Questions Asked (1)

Q1

Given a starting URL, recursively follow URLs returned in each HTTP response until you find a response containing the string 'congrats'. Return that URL. How do you implement this, handle errors like 503s, avoid cycles, and test it without a live server?

API & IntegrationsSystem DesignTechnical Trade-offs
Author's notes

The core traversal isn't the hard part.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then outline a BFS-based crawler that tracks visited URLs, handles HTTP errors with retries and backoff, and uses dependency injection for testability. Emphasize cycle prevention, error handling, and a testing strategy with mocked HTTP responses.

Pro tip: Mention that you'd use a queue for BFS to find the shortest path and set a maximum depth or visited set size to prevent infinite loops. Also, highlight the importance of idempotency and rate limiting to avoid overwhelming servers.

1. Clarify Requirements and Constraints

Ask about expected scale, allowed concurrency, timeout limits, and whether the target string can appear in any part of the response body. Confirm if only URLs from a specific field (e.g., JSON) should be followed.

2. Design the Crawling Algorithm

Use BFS with a queue to explore URLs level by level, ensuring the shortest path. Maintain a visited set to avoid cycles and a max depth to prevent infinite loops.

3. Handle HTTP Errors and Retries

Implement retry logic with exponential backoff for transient errors like 503s. Distinguish between retryable (5xx, timeouts) and non-retryable (4xx) errors, and consider circuit breakers for repeated failures.

4. Ensure Testability Without a Live Server

Abstract HTTP calls behind an interface and inject a mock client in tests. Use a local test server or mock responses to simulate various scenarios: success, errors, cycles, and the target string.

5. Discuss Trade-offs and Optimizations

Mention trade-offs between BFS and DFS, concurrency vs. simplicity, and memory usage of visited set. Suggest optimizations like caching, rate limiting, and using a bloom filter for large-scale visited tracking.

Key Points to Mention

  • BFS vs DFS: BFS finds shortest path but uses more memory; DFS may go deep and miss shorter paths.
  • Cycle detection: Use a visited set of URLs (normalized) to avoid infinite loops.
  • Error handling: Retry with exponential backoff for 503s, respect Retry-After header, and set a max retry limit.
  • Testability: Dependency injection for HTTP client, mock responses, and unit tests for edge cases.
  • Concurrency: Consider parallel requests with a thread pool or async I/O, but manage rate limits and shared visited set.
  • Termination conditions: Stop when target found, max depth reached, or queue empty; handle timeouts.

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