Crawling the URL Maze Over HTTP
- Crawl a maze of HTTP endpoints with BFS and a visited set
- Retry flaky 503s with a bound and exponential backoff
- Survive junk bodies, mixed formats and different URL forms
- Open 401 doors with keys found later in the crawl
- Return the shortest route and crawl concurrently under a rate limit
Ramp's live phone screen keeps coming back to one problem. You get a starting URL. A GET on it returns JSON that points at more paths, and you keep exploring until some page says something like "congrats". It's the Ramp coding problem candidates report most, all through 2026 and as recently as September. Most meet it in the hour-long phone screen. It has also turned up in onsite coding rounds, and an AI engineer met it in a July 2026 final round.
You already know the algorithm. It's a breadth-first search with a visited set. A September 2026 candidate said most of the time goes to the HTTP client and JSON parsing. Pages answer 503 and then work on the next try, bodies arrive as junk, and a door answers 401 until you carry a key you picked up three rooms back. A March 2026 candidate who got an offer put it this way: "You have to interact with real systems that are not part of an isolated code window."
Below, the base crawl and five follow-ups run as Python problems against a fake server, so the tests can throw 503s and junk at you the way the live service does. They stack in the order the parts tend to arrive. Work them on a timer and carry your code forward.
What the Ramp phone screen asks
The prompt is short. You're handed an entrance, usually a base URL and a start path. A GET returns a JSON body. Some bodies list the next paths under a key like next_stops, some list ids you append to the base URL, and one says something like {"message": "congrats"}, which means you return the URL that produced it. Paths loop back on each other, and plenty lead nowhere.
The details drift between interviewers. One February 2026 candidate was told to return only the final URL and skip the route. In September 2026 the pages fed step ids instead of paths. A July 2025 version had a single chain, where a revisit meant a loop and the answer followed an END marker. Learn the shape and expect the key names to change.
New grads and interns get the same family. A January 2026 new grad screen was a BFS-style traversal across nested APIs, and an August 2025 intern called theirs an "API interaction hashmap and DFS question." On LeetCode the closest relatives are Web Crawler (1236) and Web Crawler Multithreaded (1242). They share the BFS and the visited set and stop there. Retries, junk bodies and locked doors are missing, and candidates lose the Ramp round on those.
Ask before you write code
Interviewers differ a lot here. A September 2026 candidate got no clarifying hints at all, and a June 2026 candidate had to discover new response types, body formats and URL schemes as the exercise went on. Other 2026 candidates describe friendly interviewers who were happy to talk it through. Documentation rules vary too. A September 2026 intern was allowed to look up Python docs, a June 2026 candidate was discouraged from it, and Ramp's intern FAQ calls its interviews open book. Settle it in the first two minutes.
- Can I look up the HTTP library docs, or should I work from memory?
- Does a GET return paths, full URLs or ids, and what is the base URL?
- What marks the exit, and do you want the URL, the message or the route?
- Which status codes should I expect, and which are worth retrying?
- Can the maze loop back on itself?
Then print the raw response before you parse anything. Two February 2026 candidates gave the same advice, since a 503 body can be malformed and a blind .json() call throws on it. The printout also shows you the next surprise before your code trips on it.
Keep fetching apart from crawling. One small get(path) function owns the HTTP call, the retries, the auth and the parsing, and the BFS loop only ever sees a status and a body. Most follow-ups below then change one of the two halves and leave the other alone.
Testing without the live service
A February 2026 candidate was asked for tests and follow-up code, and a September 2026 screen added testing without the live service as a follow-up. Keeping fetching apart from crawling answers it. Pass the fetch function in, and a test hands the crawler a dict instead of the network.
import requestsdef http_get(url): response = requests.get(url, timeout=5) try: return response.status_code, response.json() except ValueError: return response.status_code, None # junk body: the crawler decidesdef fake_get(pages): def get(url): if url not in pages: return 404, None return 200, pages[url] return get# live: crawl(http_get, "https://maze.example.com/start")# test: crawl(fake_get({"/": {"next_stops": ["/a"]}, "/a": {"message": "congrats"}}), "/")Each practice problem below works exactly that way. You get the fake server as a dict, which lets a test script a page that fails twice and then answers.
Asked at Ramp
Six problems, each one a part you might be handed next. Solve each before you read the one after it.
The base crawl
Nearly every version, from March 2025 to September 2026, starts with this crawl. GET the start, follow the next paths, return the page that says congrats. A September 2025 senior candidate finished it in 20 minutes and then got a bonus part with more HTTP calls and edge cases. Plan on that pace.
Escape the URL Maze
Problem
escape_maze(server, start). The maze is a fake HTTP server. server maps each path to the JSON body a GET on it returns, already decoded. A path missing from server answers 404 and is a dead end.A body is either
{"next_stops": [paths]}, listing the paths you can visit next, or an object with a message field. The exit is the page whose message is "congrats". Any other message is a dead end, and so is an empty next_stops list.Start at
start and explore with BFS, following next_stops in the order listed. Paths can loop back to pages you've seen. Return the exit's path, or "" if no page you can reach is the exit. At most one page is the exit./ leads to /a and /b. /b is a dead end, and /a leads to /c, which says congrats.
BFS with a deque and a visited set. Mark a path as seen when you queue it, and treat anything other than a 200 as a dead end.
Escape the URL Maze
Click "Run" to execute your code
Flaky 503s
Retries are the part 2026 candidates name most. February, April and September 2026 candidates all describe pages that answer 503 and then work on a retry. A September 2026 candidate who skipped every 503 never found the exit. The July 2026 onsite version adds backoff, deadlines and retry budgets.
Retry Flaky 503s With Backoff
Problem
escape_with_retries(server, start, max_retries, base_wait). Now server maps each path to a list of replies, each one [status, body]. The first GET to a path gets the first reply and the second GET the second. Once the list runs out, the last reply repeats. A path missing from server answers 404.A 503 is temporary, so retry it up to
max_retries times after the first try. Before retry k, counting from 0, wait base_wait * 2 ** k milliseconds. Any status other than 200 or 503 is a dead end with no retry. A failed reply's body can be junk, so read the body only on a 200.Crawl with BFS as before and return a log with one line per event. Write
"GET " for each request and "WAIT " for each backoff, then end with "EXIT " or "NO EXIT". There is no wait after the last failed try./a answers 503 twice. The waits double from 100 to 200, and the third try returns the link to /exit.
Put the retry loop inside get, so the BFS only ever sees the final status. Loop over max_retries + 1 tries and double the wait each time.
Retry Flaky 503s With Backoff
Click "Run" to execute your code
Junk bodies and mixed formats
In February 2026 two candidates hit malformed content and 503 bodies that weren't valid JSON. One of them got bodies that were the bare string congrats or a list of new URLs. In June 2026 a candidate watched new body formats and URL schemes appear as the exercise went on. This part bundles those cases.
Parse Whatever the Maze Sends Back
Problem
escape_any_format(server, host, start). Now server maps each path to the raw text a GET returns, and every known path answers 200. A path missing from server is a dead end.A page is the exit when it says congrats as raw text, as a JSON string, or as the
message of a JSON object. Compare after trimming spaces and ignoring case. Otherwise the links come from a JSON list, or from the next_stops list of a JSON object. Skip any link that isn't a string.Everything else is a dead end. That covers text that doesn't parse, other JSON values, and a
next_stops that isn't a list.Links take three forms.
/c is a path, c is the same path without its slash, and https://maze.test/c or http://maze.test/c is a full URL on the maze host, given as host. A bare https://maze.test means /. Skip full URLs on any other host. Explore with BFS in link order and return the exit's path, or ""."b" becomes /b, the HTML page is a dead end, and the full URL on maze.test becomes /c.
Write one read(text) function that returns (is_exit, links) and never raises, plus a to_path(link) that returns None for other hosts. The BFS is unchanged.
Parse Whatever the Maze Sends Back
Click "Run" to execute your code
next_steps ids that you append to the base URL, so 17 means base_url/17. That's one more branch in read and nothing else, shown below.Locked doors and keys
April and July 2026 candidates describe auth. In April the interviewer swapped in a new URL that threw 503s and 401s, and in part three some URLs returned a key you had to send in a header on later requests. That candidate passed part one and ran out of time debugging part three. The July 2026 AI engineer final round had a similar second level, with auth headers collected as you crawl.
Collect Keys to Open 401 Doors
Problem
escape_with_keys(server, locks, start). server maps paths to decoded bodies as in part one, and a body may also carry a key field that names a key. locks maps some paths to the key they need.A GET to a locked path answers 401 unless you already hold its key. Once you've read a body with a key, you hold it for every later request. A 401 doesn't say which key it wants, and a key can turn up after you've met its door.
Crawl with BFS and return the exit's path, or
"" if you can't reach it. A body whose message is "congrats" is the exit, and the exit itself can be locked./door answers 401 at first. /hall hands over the blue key, so /door goes back on the queue and opens.
A 401 is a door to come back to. Park those paths in a list, and each time you pick up a key you did not have, push them all back onto the queue.
Collect Keys to Open 401 Doors
Click "Run" to execute your code
Authorization: Bearer , so keep a headers dict beside get and merge each new token in. The July 2026 version also raised token safety, so keep tokens out of the lines you print while debugging.The shortest route
September 2026 screens added the shortest route as a follow-up, once as the shortest sequence of step ids, and a May 2026 onsite made it the main ask. In February 2026 a candidate was told the opposite for part one, to return just the final URL. Ask which one they want before you build the route.
Shortest Route Out of the Maze
Problem
shortest_route(server, start), with server as in part one. Return the list of paths from start to the exit, both included, using as few hops as possible. Return [] when there's no exit.If two routes tie, return the one BFS finds first when it follows
next_stops in listed order. A path missing from server is a dead end. The start can be the exit, in which case the route is just [start]./b reaches the exit in two hops. The route through /a and /c takes three.
BFS already reaches every page by a fewest-hop route. Record each page's parent the first time you queue it, then walk parents back from the exit.
Shortest Route Out of the Maze
Click "Run" to execute your code
Concurrency under a rate limit
September 2026 screens ended with scale: a million steps with ten requests in flight, a concurrent crawler whose visited set stays correct, and retries adjusted under rate limiting. Live, you'd talk this through or reach for a thread pool. Here it runs on a simulated clock so the tests can check it.
Crawl Concurrently Under a Rate Limit
Problem
crawl_ticks(server, start, workers, limit, window), with server as in part one. Time moves in ticks numbered from 1. In each tick you send requests for paths taken from the front of the BFS queue, all at once, and every reply arrives by the end of that tick.Two caps decide how many you send. At most
workers requests can be in flight in one tick. The server allows at most limit requests in any window consecutive ticks, so count what you sent in the previous window - 1 ticks. If the caps leave no room, the tick passes with nothing sent.At the end of a tick, handle the replies in the order you sent them and queue unseen next paths as before. Return the tick in which the exit's reply arrived, or
-1 if the queue runs dry first. workers, limit and window are all at least 1.One worker sends one request per tick, so the exit arrives in tick 8, its place in BFS order.
Keep a list of how many requests went out in each tick. The room this tick is limit minus the sum of the last window - 1 entries, capped by workers and by the queue length.
Crawl Concurrently Under a Rate Limit
Click "Run" to execute your code
How the round is scored
The score is how many parts you finish, and how cleanly. How Ramp decides covers the bar. A February 2026 candidate was told style matters less than getting the core logic working fast.
Common questions
What is the Ramp URL maze question?
It's the most reported Ramp phone screen problem in 2026. You start from a URL, GET it, and follow the paths in its JSON body until a page returns something like a congrats message. Later parts add 503s that work on retry, junk bodies, 401s that need a key found earlier, the shortest route and concurrency.
Is the Ramp technical interview LeetCode style?
Mostly not. The live screen is usually a practical build in parts, like the maze, and LeetCode's Web Crawler problems are only its closest relatives. A couple of April 2026 candidates did get a plain data-structures problem on their screen, so keep BFS, hashing and sorting warm as well.
Which language should I use for the Ramp phone screen?
Any language whose HTTP client you know cold. Python is the common choice, and one September 2026 screen ran in CoderPad. Know how to send a GET with headers, read the status code, and catch a failed JSON decode without looking anything up, since docs may not be allowed.
How do I practice the Ramp coding interview maze?
Write the crawler from a blank file, then point it at a small local server you script to throw 503s, junk bodies and a locked door. Python's http.server takes a few lines for that. Time yourself. Part one in about 20 minutes leaves the rest of the hour for the follow-ups.
Key Takeaways
- ✓Ramp's 2026 phone screen is most often a maze of HTTP endpoints. BFS with a visited set solves part one.
- ✓Retry 503s with a bound and backoff, read bodies only on a 200, and treat junk as a dead end.
- ✓Park paths that answer 401 and queue them again each time you pick up a new key.
- ✓Keep fetching apart from crawling, so each follow-up and each test changes one small function.
Ramp interview guideKnow what Ramp asks before you walk in.
29 coding · 3 system design · 18 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.