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的更多相关文章

  1. Careercup - Facebook面试题 - 6026101998485504

    2014-05-02 10:47 题目链接 原题: Given an unordered array of positive integers, create an algorithm that ma ...

  2. Careercup - Facebook面试题 - 5344154741637120

    2014-05-02 10:40 题目链接 原题: Sink Zero in Binary Tree. Swap zero value of a node with non-zero value of ...

  3. Careercup - Facebook面试题 - 5765850736885760

    2014-05-02 10:07 题目链接 原题: Mapping ' = 'A','B','C' ' = 'D','E','F' ... ' = input: output :ouput = [AA ...

  4. Careercup - Facebook面试题 - 5733320654585856

    2014-05-02 09:59 题目链接 原题: Group Anagrams input = ["star, astr, car, rac, st"] output = [[& ...

  5. Careercup - Facebook面试题 - 4892713614835712

    2014-05-02 09:54 题目链接 原题: You have two numbers decomposed in binary representation, write a function ...

  6. Careercup - Facebook面试题 - 6321181669982208

    2014-05-02 09:40 题目链接 原题: Given a number N, write a program that returns all possible combinations o ...

  7. Careercup - Facebook面试题 - 5177378863054848

    2014-05-02 08:29 题目链接 原题: Write a function for retrieving the total number of substring palindromes. ...

  8. Careercup - Facebook面试题 - 4907555595747328

    2014-05-02 07:49 题目链接 原题: Given a set of n points (coordinate in 2d plane) within a rectangular spac ...

  9. Careercup - Facebook面试题 - 5435439490007040

    2014-05-02 07:37 题目链接 原题: // merge sorted arrays 'a' and 'b', each with 'length' elements, // in-pla ...

随机推荐

  1. Android ListView动态改变Item高度

    在adapter的getView方法中进行设置,代码如下 @Override public View getView(int position, View convertView, ViewGroup ...

  2. POJ1064

    #include <iostream> #include <iomanip> #include <cmath> using namespace std; int N ...

  3. VxWorks 6.9 内核编程指导之读书笔记 -- POSIX

    POSIX能力 VxWorks扩展了POSIX,为了移植,VxWorks提供了额外的POSIX接口作为可选组件.VxWorks实现了POSIX 1003.1(POSIX .1)一些传统接口以及POSI ...

  4. 20150311—html中iframe(转发)

    JS实现iframe框架页面跳转和刷新 一.js方式的页面跳转 1.window.location.href方式 <script language="javascript" ...

  5. PHP的final、抽象类和方法

    final关键字的用法 final class Computer{ //无法继承的类 final public function run(){ //无法继承的方法 } } class NoteBook ...

  6. [Bootstrap]组件(三)

    输入框组 添加额外元素.input-group-addon 外包元素.input-group>input-group-addon+form-control <div class=" ...

  7. css3学习笔记之按钮

    基本按钮样式 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 <!DOCTYPE ht ...

  8. “==”,比较的是引用 “equals方法”比较的是具体内容

    package com.java1234.chap03.sec08; public class Demo2 { public static void main(String[] args) { //“ ...

  9. 将word中的“空格” 转换为换行符

  10. Discuz X3.2 SEO设置 title 不支持空格的解决方法

    很多使用 Discuz X3.2 的同学都发现这么一个问题:在后台SEO设置-title设定的时候,即使你在连字符两侧输入了空格,在前台也显示不出来,很多同学纠结这个问题,今天终于找到了解决方法,在此 ...