Careercup - Google面试题 - 5377673471721472
2014-05-08 22:42
原题:
How would you split a search query across multiple machines?
题目:如何把一个搜索query分发到多个机器上?
解法:又是“Guy”出的题目。对query字符串算取数字签名,然后对集群的机器数量取模,就可以得到对应落在的机器了。
代码:
// http://www.careercup.com/question?id=5377673471721472
// Answer:
// The genenral practice of splitting queries across multiple machine, would require two parts:
// 1. convert the query to a digital sign, possibly an integer.
// 2. modulo it by the number of machines in a cluster, this process may be multi-layered.
// Other scheduling strategies may affect the result of splitting, but I think modulo will be a simple and balanced way to split the queries.
int main()
{
return ;
}
Careercup - Google面试题 - 5377673471721472的更多相关文章
- Careercup - Google面试题 - 5732809947742208
2014-05-03 22:10 题目链接 原题: Given a dictionary, and a list of letters ( or consider as a string), find ...
- Careercup - Google面试题 - 5085331422445568
2014-05-08 23:45 题目链接 原题: How would you use Dijkstra's algorithm to solve travel salesman problem, w ...
- Careercup - Google面试题 - 4847954317803520
2014-05-08 21:33 题目链接 原题: largest number that an int variable can fit given a memory of certain size ...
- Careercup - Google面试题 - 6332750214725632
2014-05-06 10:18 题目链接 原题: Given a ,) (,) (,), (,) should be returned. Some suggest to use Interval T ...
- Careercup - Google面试题 - 5634470967246848
2014-05-06 07:11 题目链接 原题: Find a shortest path ,) to (N,N), assume is destination, use memorization ...
- Careercup - Google面试题 - 5680330589601792
2014-05-08 23:18 题目链接 原题: If you have data coming in rapid succession what is the best way of dealin ...
- Careercup - Google面试题 - 5424071030341632
2014-05-08 22:55 题目链接 原题: Given a list of strings. Produce a list of the longest common suffixes. If ...
- Careercup - Google面试题 - 6331648220069888
2014-05-08 22:27 题目链接 原题: What's the tracking algorithm of nearest location to some friends that are ...
- Careercup - Google面试题 - 5692127791022080
2014-05-08 22:09 题目链接 原题: Implement a class to create timer object in OOP 题目:用OOP思想设计一个计时器类. 解法:我根据自 ...
随机推荐
- windwos异地备份Mysql数据库
@echo off@title Mysqlbackup echo MySQL数据库备份 echo ***********************echo Today %date%echo Time % ...
- CentOS 6.X版本升级PHP
#-----------------------------CentOS 6.X版本升级PHP------------------#! /bin/sh #1.关闭selinuxcp -rp /etc/ ...
- 用Lambda表达式操作List集合
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- 掌握iOS自动布局
1,自动布局是一种基于约束的布局(constraint-based layout)引擎,它可以根据开发者在对象上的约束自动调整大小与位置. 2.在iOS 6之前使用的布局模型是“spring& ...
- Silverlight IIs发布问题
1.在IIS上部署系统没有问题,在vs中链接oracle中出错(数据连接不成功,请检查该数据库是否已启动尝试加载oracle客户端时引发BadImageFormatException.如果在安装32位 ...
- JMeter2.13进行压力测试
1.安装 2. 样本数目 总共发送到服务器的请求数. 最新样本 代表时间的数字,是服务器响应最后一个请求的时间 吞吐量 是服务器每分钟处理的请求数. 平均值 是总运行时间除以发送到服务器的请求数. 中 ...
- 【MySql】5.6.14版本的安装和测试
当前状态:apache2.4.6和php5.5.6已经安装成功: mysql的安装和测试: 一.安装mysql5.6.14,参考http://wenku.baidu.com/link?url=_0jk ...
- C#通过WinAPI获取内存信息,32位64位可用
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Runti ...
- (转)Android SlidingTabLayout定制分割线和指示条颜色
本文转载与:http://blog.csdn.net/zhangphil/article/details/48863347 Android SlidingTabLayout默认的滑动指示条是系统默认的 ...
- JAVA中ArrayList用法
JAVA中ArrayList用法 2011-07-20 15:02:03| 分类: 计算机专业 | 标签:java arraylist用法 |举报|字号 订阅 Java学习过程中做题时 ...