PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCareers
|Home/Coding & Algorithms/Ramp

Find an Exit in a URL Maze

Last updated: May 6, 2026

Quick Overview

This question evaluates graph traversal and state-management skills, emphasizing handling cycles, HTTP error conditions, retry logic, and propagation of authorization tokens in a networked client.

  • medium
  • Ramp
  • Coding & Algorithms
  • Software Engineer

Find an Exit in a URL Maze

Company: Ramp

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

You are given a starting URL for a web-based maze. Each URL represents one room in the maze. Your task is to write a program that discovers whether there is a path from the starting room to an exit room. Assume you have a helper function or HTTP client that can request a room URL. A successful response has status code `200` and returns JSON in this shape: ```json { "is_exit": false, "neighbors": ["https://maze.example/room/2", "https://maze.example/room/7"] } ``` A room is an exit if `is_exit` is `true`. The maze may contain cycles, so your solution must not revisit the same URL indefinitely. Implement: ```python def find_exit(start_url: str) -> str | None: pass ``` Return the URL of any exit room reachable from `start_url`, or `None` if no exit is reachable. Follow-up: The maze service is unreliable and protected by per-room access keys. Additional behavior: 1. A request may return `503 Service Unavailable`. In that case, retry the same URL a limited number of times before treating it as temporarily unreachable. 2. A request may return `401 Unauthorized`. Some successful room responses may include a key, for example: ```json { "is_exit": false, "neighbors": ["https://maze.example/room/9"], "key": "abc123" } ``` When a key is returned, capture it and include it in future requests using a header such as: ```text Authorization: Bearer abc123 ``` Update your implementation so it can still find an exit while handling cycles, retries, `503` responses, `401` responses, and authorization keys.

Quick Answer: This question evaluates graph traversal and state-management skills, emphasizing handling cycles, HTTP error conditions, retry logic, and propagation of authorization tokens in a networked client.

Related Interview Questions

  • Implement a multi-level digital recipe manager - Ramp (medium)
  • Build a Wordle-style game in React - Ramp (medium)
  • Find final URL by crawling until “congrats” - Ramp (hard)
  • Implement multi-level task manager APIs - Ramp (medium)
  • Implement wildcard querySelector to extract URL - Ramp (medium)
Ramp logo
Ramp
Apr 21, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
5
0

You are given a starting URL for a web-based maze. Each URL represents one room in the maze. Your task is to write a program that discovers whether there is a path from the starting room to an exit room.

Assume you have a helper function or HTTP client that can request a room URL. A successful response has status code 200 and returns JSON in this shape:

{
  "is_exit": false,
  "neighbors": ["https://maze.example/room/2", "https://maze.example/room/7"]
}

A room is an exit if is_exit is true. The maze may contain cycles, so your solution must not revisit the same URL indefinitely.

Implement:

def find_exit(start_url: str) -> str | None:
    pass

Return the URL of any exit room reachable from start_url, or None if no exit is reachable.

Follow-up: The maze service is unreliable and protected by per-room access keys.

Additional behavior:

  1. A request may return 503 Service Unavailable . In that case, retry the same URL a limited number of times before treating it as temporarily unreachable.
  2. A request may return 401 Unauthorized . Some successful room responses may include a key, for example:
{
  "is_exit": false,
  "neighbors": ["https://maze.example/room/9"],
  "key": "abc123"
}

When a key is returned, capture it and include it in future requests using a header such as:

Authorization: Bearer abc123

Update your implementation so it can still find an exit while handling cycles, retries, 503 responses, 401 responses, and authorization keys.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Ramp•More Software Engineer•Ramp Software Engineer•Ramp Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • Careers
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.