# Yelp OA

Modified version of Group Anagrams (available on Leetcode)

• I have n Meals where a meal is comprised of a bunch of ingredients and has a name.
• I needed to identify how many unique meals are on the menu where two meals are unique if they don’t have the exact same ingredients.
• Return value was the number of unique meal.

Coding Assignment:
Find the distance from root Business to other businesses in an acyclic graph

• I have been given a root Business which contains the name of the business and a hashmap<Business, Integer> where integer contains the distance from the parent.
• I have been given a target distance.
• If the business is within or equal to the target distance add it to the resulting list.
• return the list.

OA时间比较紧，一道大题25分钟。建议第一次写的时候就尽量写的清楚一点，思路整理好了再写，争取不要出错，要不然最后只剩下几分钟在那debug真的很恐慌也很没效率的。

input:
event_type, occurance, biz_id

exp:
“reviews”, 7, 1
“reviews”, 3, 3
“page_views”, 3, 1
“page_views”, 12, 2

output:
list of biz_ids that are active businesses.
An active business is the one who has more than (or equal to) 2 event_types with more than average occurances amoung all biz_ids

for example:
average for “review”, “ads”, “page_views” are 7+3/2 = 5, 11+7+6=8, 3+12/2=7.5
biz_id 1 has 7 “review” events > 5, 11"ads" events > 8, so biz_id 1 is an active business.