Return All Nodes Reachable from a Starting Vertex
Company: SoFi
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: easy
Interview Round: Technical Screen
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.
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.