Careercup - Facebook面试题 - 4922014007558144

本文探讨了如何设计机制利用黑入的数千台电脑协同下载一个完整网站,如Wikipedia,并确保负载均衡及实现特定网址的查询机制。

2014-05-01 02:13

题目链接

原题:

Design question: Say you have hacked in to a network and can deploy your bot thousands of machines, how would you design your bot so that all the machines work together to download a website, say wikipedia. There should be load balancing and a page should be queryable given its URL.

题目:如果你已经黑了几千台电脑,如何设计机制来用这些肉鸡来协同下载一个完整的网站,比如Wikipedia?要求能够提供查询机制,确定特定的网址被下载到了哪台特定的机器。

解法:这是设计题,肯定没法写出代码了。我只能凭自己能想到的地方,写了几句分析。

代码:

1 // http://www.careercup.com/question?id=4922014007558144
2 Answer:
3     If you've got ahold of a bunch of bots, you may regard it as a heterogeneous group. Different OS, different configuration.
4     You may choose one or more bot machines as scheduling server, and the rest of them as working server.
5     The query URLs will be tranformed into digital sign, so as to decide which bot will perform what downloads.
6     In case that some of the machines lost contact or broke down, others will make up for the loss.
7     

 

转载于:https://www.cnblogs.com/zhuli19901106/p/3702460.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值