📣 黑五网一特惠|VIP一年通行证5折,蓝莓、Offer多多同步特惠
回复: 5
跳转到指定楼层
上一主题 下一主题
收起左侧

云厨房面经

全局:

2022(4-6月) 码农类General 硕士 全职@cloudkitchens - 内推 - Onsite  | 😐 Neutral 😣 Hard | Fail | 在职跳槽

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

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

x
本帖最后由 Chasedream.df 于 2022-4-24 23:56 编辑

最近面了这个公司前uber ceo做的新公司,onsite需要三小时做一个生产者,消费者的问题,具体如下
虽然面挂了,大家有没有好的思路
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies

评分

参与人数 4大米 +14 收起 理由
supermango + 1 很有用的信息!
oxygen300 + 1 给你点个赞!
匿名用户-HY7AP + 10
michaelzju + 2 很有用的信息!

查看全部评分


上一篇:狗家 ng OA
下一篇:条纹 phone screen
地里匿名用户
🔗
匿名用户-ODRPB  2022-8-9 06:09:22
did you get the offer? take my rice

评分

参与人数 1大米 +1 收起 理由
pika7766 + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
 楼主| Chasedream.df 2022-8-9 07:02:42 来自APP | 只看该作者
全局:
匿名用户 发表于 2022-08-08 15:09:22
did you get the offer? take my rice
没有offer
回复

使用道具 举报

🔗
oxygen300 2022-8-11 05:18:38 | 只看该作者
全局:

Sorry to hear that. Hope you got something better
回复

使用道具 举报

🔗
jackiemy 2022-9-1 05:47:53 | 只看该作者
全局:
大家都是SDE,我下周要去面Bussines Analyst, 不知道会怎么样
回复

使用道具 举报

🔗
 楼主| Chasedream.df 2023-1-9 02:56:52 | 只看该作者
全局:
  1. import json
  2. import time
  3. import random

  4. # Constants
  5. INGESTION_RATE = 2  # orders per second
  6. COURIER_ARRIVAL_RANGE = (2, 6)  # seconds
  7. SHELVES = {
  8.   "Hot": {"temp": "hot", "capacity": 10, "decay_modifier": 1},
  9.   "Cold": {"temp": "cold", "capacity": 10, "decay_modifier": 1},
  10.   "Frozen": {"temp": "frozen", "capacity": 10, "decay_modifier": 1},
  11.   "Overflow": {"temp": "any", "capacity": 15, "decay_modifier": 2}
  12. }

  13. # Load orders from JSON file
  14. with open("orders.json") as f:
  15.   orders = json.load(f)

  16. # Initialize the shelves
  17. shelves = {name: [] for name in SHELVES.keys()}

  18. # Process orders
  19. for order in orders:
  20.   # Wait until the next ingestion time
  21.   time.sleep(1 / INGESTION_RATE)
  22.   # Cook the order
  23.   order["age"] = 0  # initialize age of order
  24.   # Place the order on the appropriate shelf
  25.   shelf_name = None
  26.   for name, shelf in SHELVES.items():
  27.     if shelf["temp"] == order["temp"]:
  28.       shelf_name = name
  29.       break
  30.   # If the shelf is full, place the order on the overflow shelf
  31.   if len(shelves[shelf_name]) == SHELVES[shelf_name]["capacity"]:
  32.     shelf_name = "Overflow"
  33.   # Add the order to the shelf
  34.   shelves[shelf_name].append(order)
  35.   print(f"Placed order {order['id']} on {shelf_name} shelf")
  36.   # Dispatch a courier to pick up the order
  37.   courier_arrival_time = random.uniform(*COURIER_ARRIVAL_RANGE)
  38.   time.sleep(courier_arrival_time)
  39.   # Courier arrives and picks up the order
  40.   print(f"Courier picked up order {order['id']} from {shelf_name} shelf")
  41.   # Courier delivers the order
  42.   print(f"Courier delivered order {order['id']}")

  43. # All orders have been processed
  44. print("All orders have been fulfilled")
复制代码
回复

使用道具 举报

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

本版积分规则

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