Amazon | Phone Screen - September 2021 | SDE (Reject)
Anonymous User
3122

Phone screen after OA, before final Onsite.
Location: Austin

Leaderships:
1/ Tell me about a time when you don't have much time and have to make a quick decision.
2/ Tell me about a time when you go beyond your regular responsibility and the result.

Coding:
Just 1 sentence: Given a list of people, and a list of connections, find the number of families.
After some clarifications, I got

List of people: A , B, C, E, F, D, G (can be in any order).
Connections:
A - B
B - C
C - D
E - F
G
So from A to D is counted as 1 family.
E - F is another family here
G stands alone can also be a family

Output: 3
I came up with all kind of solutions here like DFS with recursion, sort the input arrays to process them more easily, but couldn't write out the codes. I think the list of connections is supposed to be a hashmap but the interviewer didn't mention that until the very end, and I thought it was some sort of linked list or array at first. If anyone got a solution please share.

Got a reject a few hours later. Good luck on your interview!

Comments (11)