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. bind() to 0.0.0.0:80 failed (98: Address already in use)

    You can kill it using: sudo fuser -k 80/tcp And then try restarting nginx again: service nginx start

  2. FusionCharts Free 注意事项

    前段时间做的项目中用到了FusionCharts Free 这个插件,今天上班打开网站后竟然发现线形图出错了,如图: Y轴都是 NaNM ,经过在网上的一番查询后终于得知为什么了. 原来Free 版本 ...

  3. 关于GrideView Item点击后出现错乱重叠的情况

    我在一个搜索页做了一个筛选信息的功能 大概思路如下:在根布局中用Include 引入一个筛选框(如图), 然后把边距设置为 android:layout_marginBottom="-250 ...

  4. android app性能优化大汇总(google官方Android性能优化典范 - 第1季)

    大多数用户感知到的卡顿等性能问题的最主要根源都是因为渲染性能.从设计师的角度,他们希望App能够有更多的动画,图片等时尚元素来实现流畅的用户体验.但是Android系统很有可能无法及时完成那些复杂的界 ...

  5. Part 94 Difference between Monitor and lock in C#

  6. Java之累加和

    所谓累加算法,就是数学中数列求的算法,这都是司空见惯了的.下面我们用java求: package com.cdp.leijiahe; import java.util.Scanner; public ...

  7. 【学习笔记】【C语言】算术运算

    C语言一共有34种运算符,包括了常见的加减乘除运算 1. 加法运算+ 除开能做加法运算,还能表示正号:+5.+90 2. 减法运算- 除开能做减法运算,还能表示符号:-10.-29 3. 乘法运算* ...

  8. System.Data.Entity.Internal.AppConfig 类型初始值设定项引发异常

    在一开始时将connectionStrings 写在了configSections之上如下图一示,结果抛出:“System.Data.Entity.Internal.AppConfig”的类型初始值设 ...

  9. eclipse maven spring +spring mvc mybatis

    http://yuanmomo.net/archives/449 http://www.tuicool.com/articles/feqUJz http://wenku.baidu.com/link? ...

  10. 前台JSP页面独立化

    一直从事Java WEB开发的过程中,当然要常常写JSP文件. 本人对JSP文件有些自己的想法. 页面要尽可能的简单,整洁,条理. js文件要尽可能地放到独立的js文件中,然后引用到当前的JSP文件中 ...