Facebook数据科学面试真题

职位分类
全部
数据科学
数据分析
计算机科学
人工智能
产品经理
BQ
面试题
全部(16)
A/B testing(0)
Statistics(2)
Product Case(7)
Coding(6)
Modeling(0)
高频题(2)
全部(16)
A/B testing(0)
Statistics(2)
Product Case(7)
Coding(6)
Modeling(0)
高频题(2)
1.随机抽一个city nam
2.Order, message and buyer
3.UI design metrics drop
4.Notification quality
5.Restaurant you may like
6.Dating
7.Bad actor
8.LeetCode 680
9.LeetCode1216
10.LeetCode 735
11.Avg waiting time for receiving new feature for each customer
12.Array
13.Predict fraudulent
14.how to improve Instagram Shopping
15.Investigate quality of notification
16.Launch or not
1. 随机抽一个city nam
写一个function可以随机抽一个city name,那个 city name要Proportional with city population. 
2. Order, message and buyer
message [date | … | order_id | is_buyer | timestamp]
Q1: the number of orders that has at least a message from buyer in Jan 01 2020.
Q2: the number of orders that have at least a message from buyer and a message from seller.
Q3: the number of orders whose last message is from the buyer.
3. UI design metrics drop
product,ui design 下降25%, why?
4. Notification quality
有时用户会收到notification, 我们有没有办法measure notification quality. 怎么建模
5. Restaurant you may like
How to design "restaurant you may like"
6. Dating
如果增加一个dating的功能,有两个通道一个可以选择你感兴趣的人,一个可以选择已经对你感兴趣的人,如果两个互相感兴趣就可以开始chat,dating的profile和fb的profile是分开的。 如果开通这个功能,FB的优势是什么,这个功能符合FB的mission吗,怎么向用户推荐这个功能,如何选取可能会使用这个功能的用户
7. Bad actor
FB bad actor rate 1%,false negative 和 false positive都是5%。 如果算法detect出一个user是bad actor,那么它是真的bad actor的概率是多少?
8. LeetCode 680
Given a string s, return true if the s can be palindrome after deleting at most one character from it.
 
 Example 1:
 
 Input: s = "aba"
 Output: true
 Example 2:
 
 Input: s = "abca"
 Output: true
 Explanation: You could delete the character 'c'.
 Example 3:
 
 Input: s = "abc"
 Output: false
  
 
 Constraints:
 
 1 <= s.length <= 105
 s consists of lowercase English letters.
9. LeetCode1216
Given a string s and an integer k, return true if s is a k-palindrome.
 
 A string is k-palindrome if it can be transformed into a palindrome by removing at most k characters from it.
 
  
 
 Example 1:
 
 Input: s = "abcdeca", k = 2 
Output: true 
Explanation: Remove 'b' and 'e' characters. 
 
 Example 2:
 
 Input: s = "abbababa", k = 1 
Output: true 
 
  
  Constraints:
 
 1 <= s.length <= 1000
 
 s consists of only lowercase English letters.
 
 1 <= k <= s.length
 

10. LeetCode 735
We are given an array asteroids of integers representing asteroids in a row.

For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning left). Each asteroid moves at the same speed.

Find out the state of the asteroids after all collisions. If two asteroids meet, the smaller one will explode. If both are the same size, both will explode. Two asteroids moving in the same direction will never meet.

 

Example 1:

Input: asteroids = [5,10,-5]
Output: [5,10]
Explanation: The 10 and -5 collide resulting in 10. The 5 and 10 never collide.

Example 2:

Input: asteroids = [8,-8]
Output: []
Explanation: The 8 and -8 collide exploding each other.

Example 3:

Input: asteroids = [10,2,-5]
Output: [10]
Explanation: The 2 and -5 collide resulting in -5. The 10 and -5 collide resulting in 10.

 

Constraints:

  • 2 <= asteroids.length <= 104
  • -1000 <= asteroids[i] <= 1000
  • asteroids[i] != 0
11. Avg waiting time for receiving new feature for each customer
有1000个用户,Feature进行阶段性Roll Out,每天Rollto10个人。这样100天Rol完。问一个用户平均预期要等多少天收到这个Feature?
12. Array
一个array里有一排海景房的高度,最右边的房子靠海,给出所有可以看到海的房子的index
13. Predict fraudulent
一个user table,有amount和distance feature,还有fraudulent label信息:
userid | amount | distance_from_home | fraudulent
112 |$20.14 | 3.52 |'no'
112 |$35.12 | 3.54 |'no'
问用什么模型来predict fraudulent,不同model的优缺点,怎么计算recall,precision
14. how to improve Instagram Shopping
how to improve Instagram Shopping
15. Investigate quality of notification
如何判断notification的quality
怎么选择metrics
怎么分析metrics
16. Launch or not
是不是要launch一个new feature'friends you may know'