12
返回列表 发新帖
楼主: steven_X
跳转到指定楼层
上一主题 下一主题
收起左侧

FD DS 面经

🔗
ds_app2018 2018-2-19 09:08:33 | 只看该作者
全局:
select distinct contact_a, count(distinct contact_b) from (
select sender_id as contact_a, receiver_id as contact_b from (select distinct sender_id, receiver_id from #message)a
union all
select receiver_id as contact_a, sender_id as contact_b from (select distinct sender_id, receiver_id from #message)a )c
group by contact_a
回复

使用道具 举报

🔗
n0thing233 2018-2-27 10:14:55 | 只看该作者
全局:
select  total, count(id) from. Waral dи,
(select  id ,sum(total) from ((select  a.sender_id 'id',count(*) 'total' from message as a group by a.sender_id)
union
(select b.receiver_id 'id',count(*) 'total' from message as b group by
b.sender_id )). .и
group by id)
group by total
回复

使用道具 举报

🔗
entropy2017 2018-3-25 09:11:02 | 只看该作者
全局:
raichi 发表于 2017-11-29 11:11
我觉得这么写不对,题目问的是“某一天收到或者发过的信息的unique user 数目”
如果有一个用户收到信息 ...
. Χ
感觉union all可能是最好的答案?
回复

使用道具 举报

🔗
entropy2017 2018-3-25 09:11:12 | 只看该作者
全局:
entropy2017 发表于 2018-3-25 09:11
感觉union all可能是最好的答案?

select d.total, count(d.id)
from (select c.id, count(c.id) as total
         from (select sender_id as id
       from (select distinct sender_id, receiver_id from message) a .鍦帮紝鐙
       union all
       select receiver_id as id
                  from (select distinct sender_id, receiver_id from message) b) c. 1point 3 acres
          group by c.id) d
group by d.total

评分

参与人数 1大米 +2 收起 理由
fancytony + 2 很有用的信息!

查看全部评分

回复

使用道具 举报

全局:
thanks for sharing!
回复

使用道具 举报

🔗
kirakira1992 2018-5-21 03:08:04 | 只看该作者
全局:
楼主觉得新算法是好是坏呢?我自己稍微想一下觉得还是好的,因为acceptance rate虽然没变但是count应该增加了,所以算法没有太大问题?
回复

使用道具 举报

🔗
Feiyan 2018-5-21 06:02:15 | 只看该作者
全局:
看了几个FB DS面经下来,貌似FB也是拿DS当DA来面。弱问一句lz,是PhD还是小M?
回复

使用道具 举报

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

本版积分规则

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