Yelp数据科学面试真题

职位分类
全部
数据科学
数据分析
计算机科学
人工智能
产品经理
BQ
面试题
全部(3)
A/B testing(0)
Statistics(0)
Product Case(0)
Coding(2)
Modeling(0)
高频题(0)
全部(3)
A/B testing(0)
Statistics(0)
Product Case(0)
Coding(2)
Modeling(0)
高频题(0)
1.Ratio of acceptor
2.The most success and failure customers
3.LeetCode 1813
1. Ratio of acceptor
 | 两个input table,分别是blood donor和acceptor,算每个城市donor:acceptor
 的ratio,output出ratio最高和最低的。
2. The most success and failure customers
 | 三个input table,第一个table是customer id 和name,第二个table是campaign
 id, customer id和campaign name,第三个table是campaign id 和 success / failure,要求output success 最多和failure最多的customer。
3. LeetCode 1813
A sentence is a list of words that are separated by a single space with no leading or trailing spaces. For example, "Hello World", "HELLO", "hello world hello world" are all sentences. Words consist of only uppercase and lowercase English letters.

Two sentences sentence1 and sentence2 are similar if it is possible to insert an arbitrary sentence (possibly empty) inside one of these sentences such that the two sentences become equal. For example, sentence1 = "Hello my name is Jane" and sentence2 = "Hello Jane" can be made equal by inserting "my name is" between "Hello" and "Jane" in sentence2.

Given two sentences sentence1 and sentence2, return true if sentence1 and sentence2 are similar. Otherwise, return false.

 

Example 1:

Input: sentence1 = "My name is Haley", sentence2 = "My Haley"
Output: true
Explanation: sentence2 can be turned to sentence1 by inserting "name is" between "My" and "Haley".

Example 2:

Input: sentence1 = "of", sentence2 = "A lot of words"
Output: false
Explanation: No single sentence can be inserted inside one of the sentences to make it equal to the other.

Example 3:

Input: sentence1 = "Eating right now", sentence2 = "Eating"
Output: true
Explanation: sentence2 can be turned to sentence1 by inserting "right now" at the end of the sentence.

 

Constraints:

  • 1 <= sentence1.length, sentence2.length <= 100
  • sentence1 and sentence2 consist of lowercase and uppercase English letters and spaces.
  • The words in sentence1 and sentence2 are separated by a single space.