楼主: 李浩泉
跳转到指定楼层
上一主题 下一主题
收起左侧

[找工就业] 2020年 微软 亚麻 脸书 Capital ONE DE类编程题

🔗
 楼主| 李浩泉 2020-7-19 12:22:57 | 只看该作者
全局:
[1,2,3,4,5], [2,3,4,5,6] compare mean and variance ..

Mean = (1+2+3+4+5)/5 = 3
Variance = ((1-3)^2 + (2-3)^2 + (3-3)^2 + (4-3)^2 + (5-3)^2) / 5 = ( 4 + 1 + 0 + 1 + 4 )/5 = 2

Mean = (2+3+4+5+6)/5 = 4-baidu 1point3acres
Variance = ((2-4)^2 + (3-4)^2 + (4-4)^2 + (5-4)^2 + (6-4)^2) / 5 = ( 4 + 1 + 0 + 1 + 4 )/5 = 2
回复

使用道具 举报

🔗
 楼主| 李浩泉 2020-7-19 13:38:22 | 只看该作者
本帖为密码帖 ,请输入密码 
回复

使用道具 举报

🔗
 楼主| 李浩泉 2020-7-19 14:09:06 | 只看该作者
全局:
. 1point 3acres
  1. SELECT
  2.     product_id,
  3.     CASE WHEN total_qty < 2 THEN 'low' ELSE 'not low' END AS CATEGORY
  4. FROM product p1
  5. INNER JOIN (
  6.    Select product_id, sum(qty) as total_qty
  7.    From product p. Waral dи,
  8.    INNER JOIN order_detail od ON p.product_id=od.product_id
  9.    WHERE od.order_id NOT IN
  10.     (
  11.     select order_id from orders
  12.     where order_datetime >= datediff(year, -1, getdate())
  13.     )
  14.     GROUP BY product_id ) T ON p1.prodcut_id = T.product_id
复制代码


回复

使用道具 举报

🔗
美国运通 2020-7-19 14:40:42 | 只看该作者
本楼:
全局:
感谢分享!
回复

使用道具 举报

🔗
 楼主| 李浩泉 2020-7-21 06:45:58 | 只看该作者
全局:
李浩泉 发表于 2020-7-19 03:07
Create Make Business Metrics: [total cost], [total access page per customer]
. 1point 3 acres
[total access page per customer] 我之前的代码有问题,现在更新一下:. 1point3acres

  1. SELECT . .и
  2. first_name + ' ' + last_name AS customer,
  3. SUM(ISNULL(access_page,0)) AS [total access page per customer]
  4. FROM customer.1point3acres
  5. LEFT JOIN browse_history ON customer.id = browse_history.customer_id
  6. GROUP BY first_name + ' ' + last_name
  7. ORDER BY 2 DESC
复制代码

. check 1point3acres for more.
回复

使用道具 举报

🔗
 楼主| 李浩泉 2020-7-21 06:57:44 | 只看该作者
全局:
为空为零也要输出,疏忽大意了,还好及时发现:. ----

.
  1. WITH CTE AS
  2. ( SELECT
  3.    country_code, . check 1point3acres for more.
  4.    device_type,
  5.    DENSE_RANK() OVER(PARTITION BY country_code ORDER BY COUNT(customer_id) DESC) AS RK
  6.   FROM browse_history
  7.   WHERE country_code IN ('CN','US','JP','CA')
  8.   GROUP BY country_code,device_type )

  9. SELECT
  10. T.[Country],. check 1point3acres for more.
  11. T.[total access page],. check 1point3acres for more.
  12. CTE.device_type. 1point 3acres
  13. FROM (
  14.        SELECT
  15.        name AS [Country],
  16.        country.country_code,
  17.        SUM(ISNULL(access_page,0)) AS [total access page],
  18.        FROM country . 1point3acres
  19.        LEFT JOIN browse_history ON country.country_code = browse_history.country_code
  20.        WHERE country.country_code IN ('CN','US','JP','CA'). Waral dи,
  21.        GROUP BY country.country_code,name ) T
  22. LEFT JOIN CTE ON T.country_code = CTE.country_code AND CTE.RK = 1
复制代码


回复

使用道具 举报

🔗
 楼主| 李浩泉 2020-7-23 01:25:12 | 只看该作者
本帖为密码帖 ,请输入密码 
回复

使用道具 举报

🔗
 楼主| 李浩泉 2020-7-23 01:26:25 | 只看该作者
本帖为密码帖 ,请输入密码 
回复

使用道具 举报

🔗
xiaoyuetu 2020-7-24 08:57:19 | 只看该作者
全局:
renee1 发表于 2020-7-17 15:47. 1point3acres.com
谢谢楼主分享, 能说一下fb 的题吗?

也是要面fb的de岗么
回复

使用道具 举报

🔗
renee1 2020-7-26 06:48:28 | 只看该作者
全局:
xiaoyuetu 发表于 2020-7-24 08:57
也是要面fb的de岗么

是的,在约面试
回复

使用道具 举报

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

本版积分规则

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