找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

12
返回列表 发新帖
楼主: 完美世界
收起左侧

[Goldman Sachs] 高盛设计题面经

[复制链接]

1148

主题

175

精华

3545

积分

神级会员

Rank: 7Rank: 7Rank: 7

积分
3545
发表于 10-5-2017 08:54 AM | 显示全部楼层

We can implement this scenario with an observer pattern. The observed object taking in the number of stocks to be bought. The same object will also maintain a list of observers (the exchanges so to say). As soon as the observed object receives a buy order of say n stocks, it will notify all observers (stock exchanges), which in return will return the best selling price from them. This price can be compared at the observed object's end and the first order can be executed at the exchange offering the best selling (lowest) price. Do this recursively for n number of orders and your entire buy order will be executed at the lowest price. You can perform the same scenario for a sell order of n stocks as well.

回复 支持 反对

使用道具 举报

4

主题

0

精华

56

积分

资深会员

Rank: 2

积分
56
发表于 10-18-2017 12:26 PM | 显示全部楼层
why all the replies are the same?
回复 支持 反对

使用道具 举报

5

主题

0

精华

16

积分

新米人

Rank: 1

积分
16
发表于 3-31-2018 01:42 AM | 显示全部楼层
heroiii 发表于 10-18-2017 12:26 PM
: }8 {8 f2 V2 |+ ?7 d  y% |& Q1 Gwhy all the replies are the same?

' l% b) w8 Q  R5 t8 jmaybe some of them are just bots
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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