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 ...
随机推荐
- 【转】自己动手写SC语言编译器
自序 编译原理与技术的一整套理论在整个计算机科学领域占有相当重要的地位,学习它对程序设计人员有很大的帮助.我们考究历史会发现那些人人称颂的程序设 计大师都是编译领域的高手,像写出BASIC语言的BIL ...
- ASP.NET Ajax核心对象
本章学习目标 主要掌握AJAX的基本概念和实现机制,学习并创建XMLHttpRequest对象,使用XMLHttpRequestObject对象获取服务器端的数据 主要内容如下,请点击ASP.NET ...
- 如何安装 JAVA 7 (JDK 7u75) 在 CentOS/RHEL 7/6/5 Fedora
先下载JDK For 64 Bit:- # cd /opt/ # wget --no-cookies --no-check-certificate --header "Cookie: gpw ...
- iOS 复杂tableView的 cell一般设计思路
- C#代码配置IIS 操纵IIS
前言: IIS到目前经历了四个版本分别为 IIS4.0 IIS5.0 IIS6.0 IIS7.0,其中IIS6.0 IIS7.0是在5.0的安全问题的基础上获得的发展,目前为止.6.0版本以后的都是 ...
- vs2010工具栏 不显示dx控件
进入命令提示符 跳转到Dev控件安装目录,如目录D:\Program Files (x86)\DevExpress 2010.1\Components\Toolss下, 然后执行命令:ToolboxC ...
- 20141017--循环语句for 穷举
穷举:把所有的可能性都列举一遍 1.羽毛球怕15元一个,球3元一个,水2元一瓶,一共有200元,每种至少一个,列出所有可能: 2. 50元钱,有面值2元,3元,5元,不要求每种至少一张,有多少种组 ...
- [Apache Maven Shade Plugin] [example] [001] 官方例子:includes-excludes
链接地址:[Selecting Contents for Uber JAR](http://maven.apache.org/plugins/maven-shade-plugin/examples/i ...
- jQuery 表单验证 jquery.validator.js
前端开发中经常会碰到表单的制作,其中必备的功能就是提交前的一些简单的验证,非空啊.手机号码啊.E-mail等等等等,这里是一个 jQuery 的表单验证插件,蛮好用的,收录一下. 下面是验证的效果图: ...
- 《Mail电子邮件日志存储的管理》RedHat6.3——以一举三
我们都知道很多日志的模块都是放在这下面的 要是想修改或是添加其他服务的日志,怎么办?修改下面的配置文件 测试下是否ok 轮转日志和定位分析和分析日志汇总报告: 安装logwatch软件包,这个没啥说的 ...