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

Sigma Computing VO

全局:

2022(4-6月) 码农类General 硕士 全职@sigmacomputing - 猎头 - Onsite  | 🙁 Negative 😫 Hardest | Fail | 在职跳槽

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

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

x
本帖最后由 小山1213 于 2022-3-1 21:38 编辑

贡献一个被惨虐的VO吧,两轮coding都是从他们工作中实际出发的问题,对这类问题确实准备很不充分,需要大量的沟通,明确需求。
1. 给一个dataset,实现一个function能以x,y,sum的形式aggregate出结果。

复制代码
2. 实现类JSON parser的function,我没完全实现,基本就是需要自己定义需要的类,参数,然后完成token parse。把题目要求放在这里。
  1. /*
  2. Your previous Plain Text content is preserved below:

  3. We'd like to parse a JSON string into a data structure that we can inspect and modify. Well known examples of this include Javascript's JSON.parse, Python's json module, or Java's Jackson library.

  4. Traditionally there are two modules in this process: lexing and parsing. The lexer transforms the input string into a list of tokens, and the parser consumes the tokens to produce a data structure (ie class, object, AST) representing the input string.

  5. For this problem, we'll implement the parser component for JSON. That is, given a list of tokens that represent a valid JSON object, we'd like to produce an in-memory representation that we can inspect and modify.

  6. Here's a basic JSON object, followed by the list of tokens representing it.

  7. {
  8.     "a": 10,
  9.     "b": "foo",
  10. }

  11. example_json_tokens = [
  12.   { 'type': 'start-object' },
  13.   { 'type': 'field-name', 'val': 'a' },
  14.   { 'type': 'number', 'val': 10 },
  15.   { 'type': 'field-name', 'val': 'b' },
  16.   { 'type': 'string', 'val': 'foo' },
  17.   { 'type': 'end-object' },
  18. ]

  19. {
  20.   "a": 10,
  21.   "b": "foo",
  22.   "c": [null, true],
  23.   "d": { "e": { "f": "nested" }}
  24. }

  25. - { type: 'start-object' }
  26. - { type: 'field-name', val: 'a' }
  27. - { type: 'number', val: 10 }
  28. - { type: 'field-name', val: 'b' }
  29. - { type: 'string', val: 'foo" }
  30. - { type: 'field-name', val: 'c' }
  31. - { type: 'start-array' }
  32. - { type: 'null' }
  33. - { type: 'boolean', val: true}
  34. ...

  35. type Token =
  36.   { type: 'start-object' }     // {
  37.   { type: 'end-object' }       // }
  38.   { type: 'start-array' }      // [
  39.   { type: 'end-array' }        // ]
  40.   { type: 'field-name', val: string }   // the key in a JSON map
  41.   { type: 'string', val: string }       // a string literal
  42.   { type: 'number', val: number }       // a number literal
  43.   { type: 'boolean', val: boolean }    // a boolean literal
  44.   { type: 'null' }                 // a null literal

  45. */
复制代码
3. sys design,讨论has
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
d aggregate the sold count
// e.g. select storeid as x, and color as y, return something like
// storeid,  date,   sold-count
// 1        1-2-2022      60
// 2        2-2-2022      100
// 3        3-2-2022      30

评分

参与人数 1大米 +12 收起 理由
匿名用户-XM385 + 12

查看全部评分


上一篇:FB data engineer GMS组onsite
下一篇:❄️前端店面
地里匿名用户
🔗
匿名用户-2J53X  2022-5-11 13:47:01
系统设计是单机的hashset还是分布式的?
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-ILYFT  2022-6-2 08:25:47
请问楼主第一题怎么答的?感觉把id和date concatenate 在一起作为一个hash key 可解。这个有什么玄机么?还是需要把问题扩展到database里的index?
回复

使用道具 举报

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

本版积分规则

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