Here are my coding interview questions with Snap:
Question 1
Your are assigned to support the following feature:
Given two sentences and one group of synonyms, decide if the two sentence share the same meaning.
For example
sent1 = "the photo is pretty"
sent2 = "the image is beautiful"
sent3 = "that photo is pretty"
groups_of_syns = [["photo", "image"], ["pretty", "amazing", "nice"], ["nice", "good-looking"], ["good-looking", "beautiful"]]
Should return True for sent1 and sent2, Should return False for sent1 and sent3
Question 2
Consider an undirected tree with n vertices (1 to n). We start from vertex 1, and start walking on the tree via steps. The rules for each step:
What is the probability that we are at vertex k after s steps?
Input: edges: List[List[int, int]], k int, s int
Output: prob float