Uber | SSE | Phone
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2024-06-27Added By Anonymous
Source: Link
Company: Uber
Role: Senior Software Engineer, Staff Software Engineer
Interview Stage: Phone Screen
Original Post Content:
Recently had a phone interview with Uber. I was able to do the first question but wasn't able to do the follow up. Help me solve it please.
Question 1 : Given an N-ary tree, return the total number of nodes in it.
Question 2 : Now imagine, each node in the N-ry tree is a node in a distributed system. Each node will have to implement two functions, send(id, message) and receive(id, message). Once all nodes run these functions, every node will be able to know how many nodes are present in the system. We need to implement those two functions by making some assumptions.