Careercup - Microsoft面试题 - 5680049562845184
2014-05-10 06:51
原题:
- "How would you find the number of gas stations in the United States?"
- *You cannot look up any concrete information (like the average number of gas stations per state), but you need to yield an accurate answer.
题目:你要如何搞清楚美国有多少个加油站?不准查,不准问。
解法:这个题很出名,是外行人眼里的奇葩智力题。起初我也觉得这题就是智力题,但是读了《编程珠玑》之后明白了这题是对于估算能力的考察。个人觉得估算需要三个条件:1. 发现有关联的变量。2. 明确变量构成的公式。3. 估算各个变量的值,然后计算公式结果。我想到了人口、国土面积、人口密度、之类的变量,但是没法确定加油站的数量到底和哪一个直接相关,所以还是没有办法构造公式。参考了答案以后,算是有了个结论:加油站和人口相关。这个结论真的可靠?
代码:
- // http://www.careercup.com/question?id=5680049562845184
- Answer:
- The number of gas stations is related to population, instead of area of land.
- Thus you have to find out the average density of gas stations by population.
- Here's the answer from another user:
- From the US census you can look up what is the average density of gas station / population ( some number ). Multiply that by the population and you get the answer.
- gas stations / people * (,) = gas stations. Although this answer will be within the standard deviation and you will have to find the upper and lower limit
- +- std.dev.
- Another way would be to do data mining. Either way you need some information, you cannot pull a number out of thin air. Well, unless you travel through each and every street and corner of the country.
- Another great idea: gather telephone books from each and every area of the US and count the number of gas stations in each region and add them up. Not all gas stations are labelled gas stations.
- So, pick and choose, or maybe another idea!!
Careercup - Microsoft面试题 - 5680049562845184的更多相关文章
- Careercup - Microsoft面试题 - 6314866323226624
2014-05-11 05:29 题目链接 原题: Design remote controller for me. 题目:设计一个遥控器. 解法:遥控什么?什么遥控?传统的红外线信号吗?我只能随便说 ...
- Careercup - Microsoft面试题 - 6366101810184192
2014-05-10 22:30 题目链接 原题: Design database locks to allow r/w concurrency and data consistency. 题目:设计 ...
- Careercup - Microsoft面试题 - 24308662
2014-05-12 07:31 题目链接 原题: I have heard this question many times in microsoft interviews. Given two a ...
- Careercup - Microsoft面试题 - 5700293077499904
2014-05-12 00:02 题目链接 原题: For a given map (ie Bing map) given longitude/latitude/ how would you desi ...
- Careercup - Microsoft面试题 - 5204967652589568
2014-05-11 23:57 题目链接 原题: identical balls. one ball measurements ........ dead easy. 题目:9个看起来一样的球,其中 ...
- Careercup - Microsoft面试题 - 5175246478901248
2014-05-11 23:52 题目链接 原题: design an alarm clock for a deaf person. 题目:为聋人设计闹钟? 解法:聋人听不见,那么闪光.震动都可行.睡 ...
- Careercup - Microsoft面试题 - 5718181884723200
2014-05-11 05:55 题目链接 原题: difference between thread and process. 题目:请描述进程和线程的区别. 解法:操作系统理论题.标准答案在恐龙书 ...
- Careercup - Microsoft面试题 - 5173689888800768
2014-05-11 05:21 题目链接 原题: Complexity of a function: int func_fibonacci ( int n) { ) { return n; } el ...
- Careercup - Microsoft面试题 - 6282862240202752
2014-05-11 03:56 题目链接 原题: Given an integer array. Perform circular right shift by n. Give the best s ...
随机推荐
- 关于tableView的优化
现在市场上的iOS应用程序界面中使用最多的UI控件是什么? 答案肯定是UITableView,几乎每一款App都有很多的界面是由UITableView实现的,所以为了做出一款优秀的App,让用户有更好 ...
- css的#和.的区别
css的#和.的区别, css的#和.的区别 2009-03-04 14:43fyws 分类:Html/Css | 浏览 1911 次 css的#和.的区别如:#home #h3 { padding ...
- EXT格式误删除恢复
http://hatemysql.com/ 1.从/proc文件系统恢复数据#lsof |grep -i deletecat 11791 root 1w REG 253,0 94 1048589 /h ...
- zabbix2.4 安装配置
首先从www.zabbix.com下载rpm包: 接下来我要配置一台zabbix server,自己监控自己即使服务端又是客户端,zabbix web gui和zabbix数据库都放在同一台主机上,除 ...
- [转发]导出Excel 格式 mso-number-format
应用中经常会遇到要从系统或数据库中导出数据平面文件,一般是导出到txt,csv或excel.txt和csv一般用在系统间的数据交换,而 excel一般有较好的显示效果,可以按照一定的模板导出,导出就不 ...
- JSP标记
JSP标记是JSP页面中很重要的组成部分,JSP标记包括指令标记.动作标记和自定义标记.其中自定义标记主要讲述与Tag文件有关的Tag标记. 一 指令标记page Page指令标记,简称page指令, ...
- 查看SDCard是否被挂载
获取Environment.getExternalStorageState(),然后得到的字符串进行查看 //android.os.Environment.MEDIA_MOUNTED="mo ...
- SQL Server中查询结果拼接遇到的小问题
前天的项目,刚接手,对于模块还不是很熟悉,其中有一个模块,涉及到4个表,其中主要的表就有两个,只要把这个弄清楚了就一切回归于“太平”了. 模块要求:把两个表的内容查询出来,结果连接在一起.大师说完,感 ...
- 用友二次开发之U810.1销售预订单导入
- 09-排序2 Insert or Merge
要点就是把排序每一步,判断一下是否和第二组数据相同,若相同则输出排序方法和下一次序列. According to Wikipedia: Insertion sort iterates, consumi ...