amazon
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2025-01-10Added By Anonymous
Source: Link
Company: Amazon
Role: SDE I / SDE II
Interview Stage: Phone Screen
Location: unknown
Year: unknown
Original Post Content:
I had an Amazon phone interview, and these were my questions. They were similar to LeetCode's "Number of Connected Components in an Undirected Graph".
Example: int[][] edges = {{0, 1}, {0, 2}, {1, 2}, {1, 3}, {3, 4},{5,6},{6,7},{8,5},{10,null}};
Output should be: n1={0,1,2,3,4}n2={5,6,7,8}n3={10}