Airbnb | Phone | Smallest Common Region & 10 Wizards

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2020-12-23Added By Anonymous
Source: Link

I recently interviewed at airbnb and failed at second phone interview round.

Role Senior Software Engineer

Location: SF


Question 1:

https://leetcode.com/problems/smallest-common-region/


Question 2:

There are 10 wizards, 0-9, you are given a list that each entry is a list of wizards known by wizard. Define the cost between wizards and wizard as square of different of i and j. To find the min cost between 0 and 9.


For example:

wizard[0] list: 1, 4, 5

wizard[4] list: 9

wizard 0 to 9 min distance is (0-4)^2+(4-9)^2=41 (wizard[0]->wizard[4]->wizard[9])

https://github.com/allaboutjst/airbnb/blob/master/src/main/java/ten_wizards/TenWizards.java

Comments