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

[面试经验] FB Analytics Data Scientist 面经

全局:

2018(7-9月) 统计类 硕士 全职@meta - 内推 - 技术电面  | | Fail | 应届毕业生

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

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

x
刚刚电话面试结束。把SQL题目分享一下。我还是有点紧张(其实是实力不够),面的不太好。1. what is the session/user in the last 30 days?
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
/div>
column: date | sessionid | time( in seconds) |userid
. Χ



评分

参与人数 2大米 +33 收起 理由
匿名用户-ELVYY + 30 很有用的信息!
贪吃的喵 + 3 给你点个赞!

查看全部评分


上一篇:Visa 的 OA 题 swe test
下一篇:脸家 DS 电面面经
推荐
surah 2018-10-4 06:14:21 | 只看该作者
全局:
写了一下,觉得需要clarify一些东西,求指点
1
--Do we want all sessions/#users, or all distinct sessions/#users
--Assume that we might need dedup
Select ifnull(count(distinct sessionid) *1.00/count(distinct userid),0) as session_user
From session.google  и
Where date between curdate()-’1’ day and curdate()-’30’day;

2.
--Time (minutes), #users
--We need to justify whether all time>0 for all sessionid? If yes,. ----
Select date,. 1point 3 acres
Time_spend,
count(userid) as users
From
(
Select date,
userid,. 1point3acres
sum(ifnull(time,0)/60) as time_spend
From time
. 1point 3 acresGroup by 1,2
)t
Group by 1,2;

--There might be cases where not all session time are recorded in time table, or some sessions’s time is 0

Select date,
Time_spend,
count(userid) as no_users. 1point 3 acres
From
(
Select a.date,.google  и
A.userid,
sum(ifnull(b.time,0)/50) as time_spend
From session a. .и
Left join time b
On a.date=b.date
And a.userid=b.userid
And a.sessionid=b.sessionid
Group by 1,2.1point3acres
)t
Group by 1,2;

回复

使用道具 举报

全局:
好好学习吧你 发表于 2019-1-17 04:00
能帮我看看第1题能不能这样写吗 谢谢
Select count(distinct sessionid) from session
Group by userid ...

如果每天的sessionid会重复 (比如今天第一个是1,明天第一个还是1) 那要怎么写第一题呢?是不是先group by userid, date算出count(distinct) 再group by userid 算个sum把30天都加起来?
slecet sum(ses) from
  (select userid, date, count(distinct sessionid) as ses
   from table1
   group by userid, date) temp.google  и
group by userid
回复

使用道具 举报

🔗
ybu2222 2018-10-2 02:42:29 | 只看该作者
全局:
感谢分享!方便讲一下产品题吗?
回复

使用道具 举报

🔗
oliveq 2018-10-2 08:04:19 | 只看该作者
全局:
感謝分享!同好奇產品提問了啥,祝樓主好運拿onsite!
回复

使用道具 举报

🔗
serena2005 2018-10-3 03:28:06 | 只看该作者
全局:
感谢分享, 能把第二个sql具体讲一下吗?谢谢
回复

使用道具 举报

🔗
Vinilala 2018-10-4 06:51:38 | 只看该作者
全局:
感谢分享!祝好运!
回复

使用道具 举报

🔗
冬瓜 2018-10-4 07:55:55 | 只看该作者
全局:
surah 发表于 2018-10-4 06:14
写了一下,觉得需要clarify一些东西,求指点
1
--Do we want all sessions/#users, or all distinct sess ...

第二题和你的第一种写的一样。
第一题有个问题:一般来说session id当天针对一个user来说不会重复吧,但如果是这三十天内,如果只算distinct(session_id)是不是会漏算掉那些虽然是不同天,但是session_id恰好相同的情况呢?
回复

使用道具 举报

🔗
surah 2018-10-4 12:06:56 | 只看该作者
全局:
冬瓜 发表于 2018-10-4 07:55
第二题和你的第一种写的一样。
第一题有个问题:一般来说session id当天针对一个user来说不会重复吧,但 ...

多谢指点,我觉得你说的有道理
. From 1point 3acres bbs这个可能得问面试官,session last有多长,我的理解是很多情况下24小时就expire
回复

使用道具 举报

🔗
冬瓜 2018-10-4 22:54:17 | 只看该作者
全局:
surah 发表于 2018-10-4 12:06
多谢指点,我觉得你说的有道理
这个可能得问面试官,session last有多长,我的理解是很多情况下24小时就 ...

.google  и客气了,嗯,我觉得和面试官沟通一下应该就能搞清楚。
回复

使用道具 举报

🔗
shellysun 2018-10-9 07:37:24 | 只看该作者
全局:
楼主。。原谅我的理解力,麻烦能不能解释一下第一题是什么意思吗?我没明白。。。。是每天每个user 有不同的session,然后要求percentage of total session by all users?
回复

使用道具 举报

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

本版积分规则

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