楼主: 好奇宝宝
跳转到指定楼层
上一主题 下一主题
收起左侧

[脸书数据科学面经] Facebook Data Scientist面试经验

🔗
cimynfine 2019-10-17 01:38:29 | 只看该作者
全局:
好奇lz说的etl思想是啥呀
回复

使用道具 举报

🔗
 楼主| 好奇宝宝 2019-10-17 10:08:39 | 只看该作者
全局:
cimynfine 发表于 2019-10-17 01:38
好奇lz说的etl思想是啥呀

就是pipeline思路。你可以跑一天的数据。然后,每天都在前一天的基础上update用户status.
回复

使用道具 举报

🔗
xiayu64 2019-11-17 14:13:13 | 只看该作者
全局:
本帖最后由 xiayu64 于 2019-11-17 14:15 编辑
.--.google  и
楼主,请问这个题目这样写思路对吗?
select case when a.userid is null then b.userid else a.userid end as userid,  
case when a.userid is null and b.userid is not null then ‘churn’
when a.userid is not null and b.userid is null then ‘new’
when a.userid is not null and b.userid is not null then ‘retained’
when c.userid is not null and b.userid is null then ‘resurrect’ end as state, ..
case when a.ds is not null then a.ds else when b.ds is not null then b.ds+1 end as ds
from dau a full join dau b on a.userid = b.userid and a.ds = b.ds+1. check 1point3acres for more.
join dau c on a.userid = c.userid and a.ds > c.ds+2;

谢谢. .и
回复

使用道具 举报

🔗
jimmy322 2020-10-30 01:28:45 | 只看该作者
全局:
with initial_status as (.
select userid, date, "new" as status from T where date in (select min(date) from T)
),
recursive cte as (
select userid, date, status from initial_status
union all. ----
select IFNULL(a.userid, b.userid) as user_id,
ifnull(b.date, dateadd(day, 1, a.date) as date,
case when a.status in ('new', 'retained', 'resurrect') and b.user_id is not null then 'retained'-baidu 1point3acres
when a.status in ('new', 'retained', 'resurrect')  and b.user_id is null then 'churn'. From 1point 3acres bbs
when a.status = 'churn' and b.user_id is not null then 'resurrect'. Waral dи,
when a.status = 'churn' and b.user_id is null then 'churn'
when a.userid is null and b.user_id is not null then 'new'
end as status
from initial_status a full outer join T b on DATEDIFF(b.date, a.date) = 1
)
select * from cte;

不知道对不对,请指教
. Waral dи,
补充内容 (2020-10-30 10:27):
from initial_status a full outer join T b on DATEDIFF(b.date, a.date) = 1
这一行应该是from cte a full outer join T b on DATEDIFF(b.date, a.date) = 1
回复

使用道具 举报

🔗
fufulaijiayou 2020-10-30 05:39:01 | 只看该作者
全局:
跪求楼主背景。。这个星期内推google ds/pa直接被简历拒了。。
回复

使用道具 举报

🔗
一颗小浮萍 2021-10-23 02:43:12 | 只看该作者
全局:
好奇宝宝 发表于 2019-10-11 19:09-baidu 1point3acres
回复一下给我大米同学的最优解法套路:我觉得应该是用今天的DAU的去update昨天的growth_accounting table.  ...

楼主,考古到这里,很好奇如何用ETL的思路,无奈加不了大米,看不到你的最优解。有什么方式可以和你请教下吗?
回复

使用道具 举报

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

本版积分规则

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