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

Stripe 3/25  电面新题??

 
全局:

2022(1-3月) 码农类General 本科 全职@Strip - 猎头 - 技术电面  | 😐 Neutral 😐 Average | Fail | 在职跳槽

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

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

x
今天Stripe电面,即使准备了mutualrank, valid credit card, wishl
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
。。。。菜是原罪。。长见识了。。。祝各位好运
  1. /*
  2. Consider a system of User and Feature objects, where a Feature describes the availability of
  3. an ongoing project or change in functionality. Features may be generally available, limited to
  4. certain regions, and/or intended for an A/B test. We need to write a deterministic system for
  5. identifying which Features are active for a given User. We also want to write tests to ensure
  6. that our system is working as intended each time we run it, given the example User and Feature
  7. data below.  

  8. Users:

  9. [
  10.     { "id": 0, "name": "eva",    "location": "US" },
  11.     { "id": 1, "name": "tess",   "location": "US" },
  12.     { "id": 2, "name": "rahool", "location": "CA" },
  13.     { "id": 3, "name": "amanda", "location": "CA" }
  14. ]

  15. Features:

  16. [
  17.     {
  18.         "id": "annual_sale",
  19.         "locations": ["US"],
  20.         "abTest": true,
  21.     },
  22.     {
  23.         "id": "enhanced_comments",
  24.         "abTest": true,
  25.     },
  26.     {
  27.         "id": "canada_promotion",
  28.         "locations": ["CA"],
  29.     }
  30. ]

  31. ## Part 1

  32. Write a function, `get_user_features(user, features)` which takes a single User object and a list
  33. of Feature objects and returns a set of the Feature IDs that apply to the given User.

  34. A User has three properties: an integer `id`, a string `name`, and a 2-letter country code
  35. string `location`.

  36. A Feature has three properties: a unique string `id`, an optional array of 2-letter country code
  37. strings, `locations`, which limits the feature to users with a matching location, and an optional
  38. boolean, `abTest`, which when set to true will only apply the feature to users with an even user ID.

  39. If `abTest` or `locations` are absent for a Feature, they have no effect.

  40. Given the features and users, the following results are expected:

  41. | User   | Features                            |
  42. | ------ | ----------------------------------- |
  43. | eva    | annual_sale, enhanced_comments      |
  44. | tess   | N/A                                 |
  45. | rahool | enhanced_comments, canada_promotion |
  46. | amanda | canada_promotion                    |
  47. */
复制代码

评分

参与人数 8大米 +31 收起 理由
sonnywsd + 1 给你点个赞!
Ramily + 1 给你点个赞!
rarala999 + 1 很有用的信息!
于泥鳅 + 1 给你点个赞!
红A + 15 给你点个赞!

查看全部评分


上一篇:灭他电面
下一篇:Mark43 sde intern面经
推荐
Renollll 2024-3-29 10:11:15 | 只看该作者
全局:
请问lz面试的时候允许上网搜索吗?我看到instruction里面有写可以但总觉得挺离谱的...
回复

使用道具 举报

地里匿名用户
推荐
匿名用户-9CT4Y  2022-4-8 12:03:10 来自APP
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
回复

使用道具 举报

地里匿名用户
推荐
匿名用户-9D6C7  2022-4-8 11:43:54
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-9CT4Y  2022-4-7 03:22:31
楼主我刚刚面完,也是这道题。。。之前没看到面筋,现场做的,也是只够做完一题,理解题目理解半天😭  但我的面试官很nice 愿意跟我一直讨论 还是自己太菜了。
请问楼主过了吗?

补充内容 (2022-04-09 04:19 +8:00):
刚收到邮件,挂了~
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-9D6C7  2022-4-8 07:12:51 来自APP
今天刚面完,同是这道题。完全没有准备到这题,也是只做出来了第一问。有一说一,他那个第二个test case真的很绕,跟题目描述的要理解半天。
Move on move on
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-4D9SL  2022-4-8 07:47:46
我也刚面完,同样也是这道题!!
楼上的请问自己写test case了吗?我根本没有时间写test case, 只把他给的test跑了一遍就结束了。。。
真是题目太长
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-FIIHN  2022-4-8 12:50:07
请问为什么tess是N/A? tess不是跟eva一样的吗?谢谢
回复

使用道具 举报

🔗
 楼主| LickyTerran 2022-4-9 01:52:33 来自APP | 只看该作者
全局:
匿名用户 发表于 2022-04-07 21:03:10
感觉是考阅读理解 真的一紧张 又这么绕的case 真的理解起来很费劲… 写class也是好麻烦 我在codepair 写完问面试官能不能换成ide…然后又copy过去继续…最后只run了他给的case
move on!
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-OYOXT  2022-4-10 15:11:17
弱问 valid credit card 和 shop penalty 是什么题目啊
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-OYOXT  2022-4-11 11:13:36
谢谢大兄弟
回复

使用道具 举报

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

本版积分规则

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