PracHub
QuestionsCoachesLearningGuidesInterview Prep

Quick Overview

Practice a SoFi coding interview problem focused on return all nodes reachable from a starting vertex. The prompt emphasizes edge cases, clean implementation, and verifiable test behavior without revealing the solution.

  • easy
  • SoFi
  • Coding & Algorithms
  • Software Engineer

Return All Nodes Reachable from a Starting Vertex

Company: SoFi

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Technical Screen

Given directed edges and a starting vertex, return all vertices reachable from the start, including the start. The graph may contain cycles. Implement: ```python def reachable_nodes(edges: list[tuple[str, str]], start: str) -> list[str]: pass ``` Return vertices sorted lexicographically.

Quick Answer: Practice a SoFi coding interview problem focused on return all nodes reachable from a starting vertex. The prompt emphasizes edge cases, clean implementation, and verifiable test behavior without revealing the solution.

Return all nodes reachable from a start node in a directed graph with cycles.

Examples

Input: {"edges":[["A","B"],["B","C"],["B","D"],["D","E"],["E","B"]],"start":"A"}

Expected Output: ["A","B","C","D","E"]

Explanation: Cycle handled.

Input: {"edges":[],"start":"A"}

Expected Output: ["A"]

Explanation: Start only.

Last updated: Jul 4, 2026

Loading coding console...

PracHub

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

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding 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.

Related Coding Questions

  • Find Smallest Common Row Value - SoFi (easy)
  • Format words into wrapped/justified lines - SoFi (medium)
  • Implement a multithreaded task executor with semaphores - SoFi (medium)
  • Find the second most frequent tag - SoFi (medium)
  • Implement chance of a personal best - SoFi (hard)