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,但是速度不会理想
相关阅读
听说binary search程序非常难写对,是吗?中的可能不大了,但分享点让焦急等待中的筒子们心情平复点的信息转身份批准之后是否可以离境Is there still ppl waiting for non-pp adv from VSC?How to track H1b process?non-pp, reg,ca,继续没有消息版上好像面Ebay的不多?也是个大公司吧g家面试要穿西装么background check怎么联系当前雇主?flextrade求内推glassdoor 列出的薪资数据是不是比实际的要低?面试中都是怎么测试自己程序正确性的?【Statistical Programmer Position at Boston】求建议(请帮转JobHunting等)发觉自己的Java编程风格在变从Sevis Record 拿到receipt no的,现在都正式收到邮件了吗?挂靠F1 / CPT的学校会不会是骗子?关于面试中interval tree的问题10.1前回国但是10.1后返签 跟10.1后回国并返签有区别吗?先申pre-completion OPT一个月内再申post-completion OPT可行否?