FB DS-Analytics New Grad电面过经

周二面的。面试官是国人小姐姐。面完以后感觉肯定挂了,没想到这周二HR邮件通知我过了。题型比较新,发出来分享一下顺便为on site攒一攒人品~

题目是Instagram adding video chat feature.

SQL:

date caller_id receiver_id duration caller_country receiver_country

‘2018-07-01’ 1234 7567 63.4 ‘ES’ ‘ES’

‘2018-07-01’ 1234 3669 50.8 ‘ES’ ‘ES’

‘2018-07-01’ 1234 8998 0.0 ‘ES’ ‘PT’

Q: for people who used the feature for the first time on 2018-05-05, how many people used the feature X days later?

一个典型的算retention的问题。当时立马想到写where subquery,写完之后和面试官一起debug了一下没问题了,没想到竟然要我不用where subquery 再写一种。于是我一开始在select table 里面做filter,改了两次面试官都说不work(语气超级吓人,直接说"no it does not work",“no your table is wrong”,自信心-10000),幸好最后灵机一动想到了inner join,面试官就要我写,我刚写完后面的on还没检查她就说OK。于是move on to product。

Product:

  1. How do you tell the 7th day retention is good or bad?

retention就是SQL里的 # of people used the feature X days later.

  1. We only add this feature in Spain for now, why we do that?

这道题的Spain只是一个代名词,可以是任何一个国家。每说完一个reason都有一个anything else反问,反正就是要你尽可能多说。

3.Imagine the head of Instagram walks in to your office, how do you tell him the effect of adding video chat feature to people’s time spent on instagram?

这道题小姐姐问的非常不清楚,以至于我一开始走错了track,后来经过反复询问才知道她想问我怎么去test the effect (典型的AB Test问题),所以说communication真的很重要,不懂一定要去clarify,走错track就不好了。

4.How do you choose the control group?

这又是一道我一开始理解偏差的问题,我以为在Spain里分control vs test,最后没想到Test group就是Spain整个country(这…),于是赶紧往国家方面扯,比如说必须得是developed country啊,地理位置要和spain挨的近啊,user behaviors要和Spain similar啊,demographic distribution也要相似啊。anything else连击again。 总之十分push。

5.Suppose the result of the AB testing shows only 1% difference between control and test group, and we expect more, what is the reason?(这道题又是死亡what else连击)

我先说了一个break down the population,see the performance of each age group,sex,etc.

然后anything else之下又说了一个 seasonality,是不是conduct的test的时间是大家都不怎么上ins的时间段,比如开学。

然后小姐姐又anything else?

这个时候我已经想不出来了,纠结了一分多钟来了一句,are we assuming our pick of control group is correct?她好像很满意我的问题于是说no,然后我就说那可能是选组出现问题了可以investigate一下control group。

刚答完最后一个问题结果时间到了,并且好像下一个时间段的面试官已经过来敲门了(他们都是在一个小房间面试,可能每个time slot是一个电面),于是小姐姐马上end interview说nice to talk to you,我当时想的竟然是幸好时间到了不然最后一个问题你再问一个anything else我就答不出来了。匆匆结束面试。

整体下来感觉就是压力面试,并且feedback几乎没有,也没有什么hint。我都是根据面试官打字的节奏判断我答的对不对(只要答的不是她想要的她就会停止打字)外加等待时间出奇的长,一般都是两三天出结果我等了一周,觉得肯定凉凉了,给个加面就算万幸。结果没想到竟然过了。等待期间stalk了一下HR的ins,发现她去参加别人婚礼了,fine。

楼主的sql 题目 怎么定义 first time user. 是 first time caller / first time or both caller and receiver.

不管是caller还是receiver只要用了这个video chat就算做first time。有的user可能first time是caller身份,有些是receiver身份

楼主啥时候毕业的?
请问像我这种明年5月毕业的一年项目应该申请2020的实习或full time吗

我是今年12月毕业。你的话应该只能full time吧

还想请问一下,我8月入学,现在是term2,除了自己自学的,machine learning的东西还没有开始系统学。现在sql刚开始刷题,这种情况现在您建议申请吗?
如果申请为什么只能是full time呢?
谢谢!不好意思哈小白问题有点多

因为现在招的intern基本都是summer的,然后intern的要求大部分都是必须实习完返回学校上学,而不是毕业之后去实习。其他的不好说啊…这也不是申请学校不用那么多顾虑啦,想投就投吧

请问sql题里的x days later这个x是具体数字楼主省略了呢还是是要像distribution把1天2天3天的都列出来呢就比如output table应该是:
|#days_after_20180505| amount |
| 1 | 1000 |
| 2 | 800 |

另外一个用户如果在x=5天之后打过第二次视频,他算不算在x=1的数据里呢
谢谢

1.要像distribution把1天2天3天的都列出来。
2.没太懂你的意思,第一次使用一定是在2018-05-05,在这些用户中算后面的count

LZ的SQL参考答案:

select datediff(date,"2018-05-05") as Days,count(distinct user) as num_user
from
(
select caller_id as user, date
from vc_users
union all
select receiver_id as user,date
from vc_users
) as tb1
inner join
(select user,min(date)
from
(
select caller_id as user, date
from vc_users
union all
select receiver_id as user,date
from vc_users
) as temp
group by user
having min(date) = "2018-05-05") as tb2
on tb1.user=tb2.user
group by Days
order by Days

关于7th day retention的问题,楼主当时的思路是 1.分析trend,看第一天到第七天的变化,理论上来说如果达到一个stable的值而不是一直在下降就是好的。 2. 对比相同类型产品的retention:比如iMessage的视频聊天功能

楼主 我下个星期也要面fb的这个position 可以加个微信请教你几个问题吗?谢谢