推特 2019 OA python 避坑帖

三道题,都是地里有的, 但是发现很多帖子说有些题目用python不能过,所以专门开一个帖子帮助下用python的朋友

  1. 利口耳领, 用dictionary做,很简单, 无坑

  2. Who’'s the closest, 这题首先要用一个dict记住每个char出现的位置 dict1,但是很多人超时,主要因为后面用index function太慢了,所以要用第二个dictionary
    第二个dict叫dict2,key is the index (e.g 2)of the char(e.g a) in the original string, value is the index of dict1[a].index(2), 我们在preprocess的时候存了,找的时候就不用用index function了

  3. text query,这题有帖子说python过不去,楼主是用python的,最后也过了,主要是要注意题目说一个单词不会出现超过10个句子中,所以用多一个dict去存每个单词出现在什么句子,那根据单词搜句子这个section就变成constant了

如果有什么问题可以回帖讨论,如果帮助到大家请给下米,给的米是不扣大家的米的
楼主加拿大读书,很难拿到美国实习的面试,如果大家有什么建议也留言帮助下

补充内容 (2018-11-7 05:19):
已经收到面试通知,第一轮是non-tech的,是Periscope Services team

厉害了。。好多人(包括我)都是做完oa就没下文的