Careercup - Facebook面试题 - 4922014007558144
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?要求能够提供查询机制,确定特定的网址被下载到了哪台特定的机器。
解法:这是设计题,肯定没法写出代码了。我只能凭自己能想到的地方,写了几句分析。
代码:
// http://www.careercup.com/question?id=4922014007558144
Answer:
If you've got ahold of a bunch of bots, you may regard it as a heterogeneous group. Different OS, different configuration.
You may choose one or more bot machines as scheduling server, and the rest of them as working server.
The query URLs will be tranformed into digital sign, so as to decide which bot will perform what downloads.
In case that some of the machines lost contact or broke down, others will make up for the loss.
Careercup - Facebook面试题 - 4922014007558144的更多相关文章
- Careercup - Facebook面试题 - 6026101998485504
2014-05-02 10:47 题目链接 原题: Given an unordered array of positive integers, create an algorithm that ma ...
- Careercup - Facebook面试题 - 5344154741637120
2014-05-02 10:40 题目链接 原题: Sink Zero in Binary Tree. Swap zero value of a node with non-zero value of ...
- Careercup - Facebook面试题 - 5765850736885760
2014-05-02 10:07 题目链接 原题: Mapping ' = 'A','B','C' ' = 'D','E','F' ... ' = input: output :ouput = [AA ...
- Careercup - Facebook面试题 - 5733320654585856
2014-05-02 09:59 题目链接 原题: Group Anagrams input = ["star, astr, car, rac, st"] output = [[& ...
- Careercup - Facebook面试题 - 4892713614835712
2014-05-02 09:54 题目链接 原题: You have two numbers decomposed in binary representation, write a function ...
- Careercup - Facebook面试题 - 6321181669982208
2014-05-02 09:40 题目链接 原题: Given a number N, write a program that returns all possible combinations o ...
- Careercup - Facebook面试题 - 5177378863054848
2014-05-02 08:29 题目链接 原题: Write a function for retrieving the total number of substring palindromes. ...
- Careercup - Facebook面试题 - 4907555595747328
2014-05-02 07:49 题目链接 原题: Given a set of n points (coordinate in 2d plane) within a rectangular spac ...
- Careercup - Facebook面试题 - 5435439490007040
2014-05-02 07:37 题目链接 原题: // merge sorted arrays 'a' and 'b', each with 'length' elements, // in-pla ...
随机推荐
- js使用CSS将图片转换成黑白(灰色、置灰)
详细内容请点击 可能早就知道,像汶川这种糟糕的日子网站全灰在IE下是可以轻松实现的(filter: gray;),不过,当时,其他浏览器是无解的. 不过,时代发展,如今,CSS3的逐步推进,我们也开始 ...
- django 学习-18 用户管理Auth系统使用
1.首先跟之前说的admin的要求有点像, vim urls.py from django.contrib import adminadmin.autodiscover() ...
- Echarts 使用遇到的问题
1.在使用ECharts的数据视图时,单击打开数据视图如下,当单击close按钮时,如果当前图像区域包含在一个<from></from>标签中,则会刷整个新页面, 去掉< ...
- 关于DB2 SQL0805N找不到程序包的错误解决办法
DB2在执行SQL语句的时候会使用内部定义的包(package)来保持不同级别的游标的稳定性, 包的名字就是“ULLID.SYSLH2XX“. DB2 里面默认的时候会创建3个这样的包即SYSLH20 ...
- cmd 命令收集
window类 1.命令打开系统设置页面 1.control keymgr.dll 打开凭据管理器 2.gpedit.msc 打开管理面板 3.mspaint--------画图板 4.msts ...
- 《Cocos2d-x实战 工具卷》上线了
感谢大家一直以来的支持! 各大商店均开始销售:京东:http://item.jd.com/11659696.html当当:http://product.dangdang.com/23659809.ht ...
- Cocos2d-x场景生命周期函数介绍
层(Layer)的生命周期函数有如下: init().初始化层调用. onEnter().进入层时候调用. onEnterTransitionDidFinish().进入层而且过渡动画结束时候调用. ...
- 16款最佳HTML5超酷动画演示及源码
1.HTML5/CSS3图片选择动画 可选择多张图片 之前我们已经分享过几款很酷的HTML5图片特效,像HTML5 3D图片折叠特效.HTML5 3D旋转图片相册等应用.今天我们来分享一款既炫酷又实用 ...
- Ant打jar包指定MainClass
一般用ant打jar的时候不用指定程序的入口!这个jar一般是给其他app引用的. 但是如果该jar就是程序的启动jar.例如: java -jar abc.jar 这个时候需要指定jar的入口类! ...
- 灰度直方算法 C++
#include <string> #include "20140318计算类的面积.cpp" //////////////////////////////////// ...