查看: 2406| 回复: 1
跳转到指定楼层
上一主题 下一主题
收起左侧

[找工就业] Robinhood 电面

全局:

2020(4-6月)-CS硕士+1-3年 | 网上海投|大纽约地区 码农类General全职@robinhood

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

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

x
Robinhood 电面

1. bad transfer : 加锁 + email call function 已到后面去。
2. Take in a stream of orders (as lists of limit price, quantity, and side, like ["155", "3", "buy"]) and return the total number of executed shares.

Rules
- An incoming buy is compatible with a standing sell if the buy's price is >= the sell's price. Similarly, an incoming sell is compatible with a standing buy if the sell's price <= the buy's price.. ----
- An incoming order will execute as many shares as possible against the best compatible order, if there is one (by "best" we mean most favorable to the incoming order).
- Any remaining shares will continue executing against the best compatible order, if there is one. If there are shares of the incoming order remaining and no compatible standing orders, the incoming order becomes a standing order.

Example input:
Stream of orders.
("150", "10", "buy"), ("165", "7", "sell"), ("168", "3", "buy"), ("155", "5", "sell"), ("166", "8", "buy")

建一个Order 的class  用两个PriorityQueue match 解决,最后还需要跑test case.

一个小时候通知 not move forward, 不知道挂在哪里了。

上一篇:Defer一年找国内实习如何解决在校身份?
下一篇:脸家 电面加面
全局:
请问楼主是后端岗位还是web呀
回复

使用道具 举报

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

本版积分规则

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