回复: 6
跳转到指定楼层
上一主题 下一主题
收起左侧

脸家Data Infrastructure Data Scientist电面

🔗
匿名用户-FZAUQ  2021-3-19 07:37:58 |倒序浏览

2021(1-3月) 分析|数据科学类 博士 全职@meta - 网上海投 - 技术电面  | | Fail | 在职跳槽

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
大家好,发一个脸家Data Infra的数据科学家电面,大家给我加米哈。问题之后是我给的答案,答案不一定对哈(否则也不会挂了555),如果我答错的地方还请大家指出,我也可以学习提高。我这贴几乎是列了完整的原题为了造福地里的小伙伴,还请脸家的小伙伴看到后不要举报我哈。
第一部分:Data manipulation:
给两张表
table user_age
userid, age, country
1, 27, 'India'
2, 35, 'China'
5, 23, 'US'
44, 47, 'Italy'
...

table user_names . 1point3acres
userid, name. 1point3acres.com
1,'peter' . .и
2,'brian'.google  и
5,'mark'
3,'david'-baidu 1point3acres
55,'sheryl'
...

1. 列出所有平均年龄超过45岁的国家.
. 1point 3acres
  1. select country from user_age
  2. group by country
  3. having avg(age)>45
复制代码


2. 列出所有不重名(names are unique)的userids.

  1. select userid from user_names
  2. where name in
  3. (select name from user_names
  4. group by name
  5. having count(name)=1)
复制代码


3. 找出所有distinct的名字相同的userid pair, 输出格式为 userid_1, userid_2, name. 有可能有超过2人以上具有相同的名字,需要列出所有可能的组合
(1,4,mark) (2,3,mark)(2,6,mark)....

  1. select u1.userid,u2.userid,u1.name from user_names as u1, user_names as u2
  2. where u1.name = u2.name and u1.userid<u2.userid
复制代码


第二部分:Coding
根据以下的输入,
给定列表作为输入,编写一个函数来处理它们,并为任何结束的好友关系(friendship)返回其的开始和结束日期。 . 1point 3acres
Assumption: . 1point3acres
*对于输入而言,确保每一个将被删除的好友关系在删除之前已经建立。
*每个用户都是独一无二的。例如,一个人不能要求与自己成为朋友。

输入格式(actor_id, receiver_id, timestamp)  输入的vector不保证是按时间戳排序的。

accepts = [(1, 2, '2000-02-11'), (3, 4, '2004-12-21'), (1, 2, '2009-09-21')]
removes = [(2, 1, '2009-03-19'), (1, 2, '2010-03-30')]

输出格式: (friend_id1, friend_id2, start_date, end_date) . From 1point 3acres bbs
-baidu 1point3acres
[(1, 2, '2000-02-11', '2009-03-19'), (1, 2, '2009-09-21', '2010-03-30')]


  1. import heapq

  2. def friendship(accepts,removes):.
  3.     # corner [] [].1point3acres
  4.     res = []
  5.     if len(accepts)==0 or len(removes)==0:
  6.         return res
  7.     friends = {}
  8.     for x,y,date in accepts:
  9.         if x>y:
  10.             x,y = y,x
  11.         if (x,y) not in friends:
  12.             friends[(x,y)]=heapq.heapify([])
  13.         heapq.heappush(friends[(x,y)],date)
  14.     removes.sort(lambda x:x[2])
  15.     for x,y,date in removes:
  16.         if x>y:
  17.             x,y = y,x
    . 1point3acres.com
  18.         if (x,y) in friends:
  19.             accept_date = heapq.heappop(friends[(x,y)])
  20.             res.append((x,y,accept_date,date)). ----
  21.             if len(friends[(x,y)]) ==0:
  22.                 del friends[(x,y)]
    -baidu 1point3acres
  23.     return res
复制代码


第三部分 Case Study 和统计. check 1point3acres for more.
给如下数据表.google  и
userid | timestamp           | description   |  amount | balance | distance_from_home | fraudulent                     
-----------------------------------------------
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
coefficients and standard errors)?  
a vector of random variables is heteroscedastic if the variability of the random disturbance is different across elements of the vector.
Linear regression assume the input data is homoskedasticity. If not, the estimated model will be compromised.
Heteroscedasticity may not cause major bias in the coefficient estimates, it does make the coefficients less precise, which makes the coefficient estimates further from the correct value.
Heteroscedasticity tends to produce p-values that are smaller than they should be. This effect occurs because heteroscedasticity increases the variance of the coefficient estimates but the OLS procedure does not detect this increase. Therefore, it can lead a test score statistically significant when it is actually not significant.
To mitigate this issue, we can use some non-linear function to transform the data. Such non-linear function can be log function.



. check 1point3acres for more.

评分

参与人数 10大米 +11 收起 理由
JNS + 1 给你点个赞!
zjspm + 1 很有用的信息!感谢分享
vera19900506 + 1 很有用的信息!
小兔兔 + 1 给你点个赞!
tandent + 1 给你点个赞!

查看全部评分


上一篇:Next Insurance 2021新题
下一篇:Data Analyst (Monetization Integrity)- Singapore
🔗
缪糕 2021-4-23 03:30:19 | 只看该作者
全局:
为啥电面能问这么多题 太害怕了我
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-QHS7O  2021-9-25 01:01:09
超级感谢楼主分享!!! 前几天刚面过,很多题都是一样的
回复

使用道具 举报

🔗
zjspm 2021-10-6 06:53:02 | 只看该作者
全局:
请问这个职位不是 DS analytics track是偏modeling的吗?题目就是title吗 谢谢 已加米
回复

使用道具 举报

🔗
zjspm 2021-12-9 14:05:45 | 只看该作者
全局:
楼主 请问你加面的时候只考了那一道case吗?不再考sql和coding了吗?谢谢!!
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-N9HNX  2022-3-10 13:19:52
多谢分享
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-0R5DL  2022-3-28 12:31:58
感谢!准备也要店面了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表