j*h
2 楼
攒人品。
实现一个控制调用某第三方API次数的控制器。对于接收到的调用请求,一秒钟内只能
响应N次, 超过N次,就忽略。
实现一个控制调用某第三方API次数的控制器。对于接收到的调用请求,一秒钟内只能
响应N次, 超过N次,就忽略。
l*y
4 楼
你不是在P?怎么来面U啦?
B*r
7 楼
http://www.youup.info/news/2011-spring-festival-concert
【在 S**********g 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: 高清全部节目,不是分段的那种,有吗?
: 谢谢
【在 S**********g 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: 高清全部节目,不是分段的那种,有吗?
: 谢谢
b*5
13 楼
but this goes against the spirit of uber. in fact, this goes against the
spirit of programming! why would i want to reinvent some rate limiter when
there's a perfectly good rate limiter provided to me by the excellent
engineers from google?!
【在 q********c 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: Of course you cannot use other library. 看来这是个高频题。
:
: u
spirit of programming! why would i want to reinvent some rate limiter when
there's a perfectly good rate limiter provided to me by the excellent
engineers from google?!
【在 q********c 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: Of course you cannot use other library. 看来这是个高频题。
:
: u
k*l
14 楼
工作的角度没错
从interview的角度,好像一般更喜欢你自己能实现/优化一个常见的功能
大概意思是如果你会做看懂别人的东西会比较容易些吧
【在 b**********5 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: but this goes against the spirit of uber. in fact, this goes against the
: spirit of programming! why would i want to reinvent some rate limiter when
: there's a perfectly good rate limiter provided to me by the excellent
: engineers from google?!
从interview的角度,好像一般更喜欢你自己能实现/优化一个常见的功能
大概意思是如果你会做看懂别人的东西会比较容易些吧
【在 b**********5 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: but this goes against the spirit of uber. in fact, this goes against the
: spirit of programming! why would i want to reinvent some rate limiter when
: there's a perfectly good rate limiter provided to me by the excellent
: engineers from google?!
f*r
16 楼
这题和这贴相似:http://www.mitbbs.com/article_t/JobHunting/33088133.html
具体解法可以看5楼
【在 j*h 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: 攒人品。
: 实现一个控制调用某第三方API次数的控制器。对于接收到的调用请求,一秒钟内只能
: 响应N次, 超过N次,就忽略。
具体解法可以看5楼
【在 j*h 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: 攒人品。
: 实现一个控制调用某第三方API次数的控制器。对于接收到的调用请求,一秒钟内只能
: 响应N次, 超过N次,就忽略。
k*a
17 楼
感觉上可以用一个list,
每次来一个request, 判断和list head的时间间隔,
如果在1秒以外,remove list head, 直到list head在1秒以内
然后,如果队列的长度为N, 则忽略,如果不是N,那就把请求的时间加入list, 并处
理请求
但是如果多线程就比较麻烦了,可以加synchronized,但是速度不会理想
每次来一个request, 判断和list head的时间间隔,
如果在1秒以外,remove list head, 直到list head在1秒以内
然后,如果队列的长度为N, 则忽略,如果不是N,那就把请求的时间加入list, 并处
理请求
但是如果多线程就比较麻烦了,可以加synchronized,但是速度不会理想
k*a
18 楼
感觉上可以用一个list,
每次来一个request, 判断和list head的时间间隔,
如果在1秒以外,remove list head, 直到list head在1秒以内
然后,如果队列的长度为N, 则忽略,如果不是N,那就把请求的时间加入list, 并处
理请求
但是如果多线程就比较麻烦了,可以加synchronized,但是速度不会理想
每次来一个request, 判断和list head的时间间隔,
如果在1秒以外,remove list head, 直到list head在1秒以内
然后,如果队列的长度为N, 则忽略,如果不是N,那就把请求的时间加入list, 并处
理请求
但是如果多线程就比较麻烦了,可以加synchronized,但是速度不会理想
相关阅读
说到斗老印公司有一个full stack初级职位Use JSON or XML (转载)H1B premium process收到receipt number 15天如果你有合同工工作想找公司办H1BTheranos 算不算被烙印整死的实现find的功能帮忙看看offer 非IT超强打包内推 FLAG+Uber+Snapchat请问各位大牛airbnb的网络工程师工作好申请吗?提前结束面试LA SFV 附近寻 Sr. engineernvidia 2017 new H1b 有拿到的吗九章系统设计班: 谁要组团?更新uber offer招GPU工程师目前为止H1B PP如果没消息是不是就意味着跪了?被问这样的问题一个公司没问身份问题就让我去onsite急问背景调查,简历上写ce但刚意识到学位证上是ee