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 ...
随机推荐
- 一个Brushes笔画应用ios源码完整版
效果很不错的画笔App,提供几十种不同的画笔,包括毛笔画笔.拥有绘画App的一些基本功能,包括颜色选择.绘画保存,支持撤销(undo).重做(redo)以及橡皮擦功能等等,甚至还支持类似PhotoSh ...
- 【Linux】程序内获取文件系统挂载信息
Linux shell可通过查看/etc/mtab或者/proc/mounts文件来获取当前文件系统挂载信息,示例: 程序内读取/etc/mtab或者/proc/mounts,解析字符串较为繁琐,可以 ...
- 命名空间中的“MvcBuildViews”。 无效
VS2013转VS2010时出现如下错误: 错误提示: 警告 1 元素 命名空间“http://schemas.microsoft.com/developer/msbuild/2003”中的“Prop ...
- 配置NTP服务ntpd/ntp.conf(搭建Hadoop集群可参考)
本文拟定是在一个局域网内(比如一个Hadoop集群)设定一台NTP服务器作为整个网络的标准时间参考,使用网络(集群)内的所有机器保持时间一致!以下是详细的操作步骤: 1. 修改选定的服务器的本地时间 ...
- PHP判断用户所在国家并跳转对应的目录
<?php // 淘宝API查询国家代码 $url = "http://ip.taobao.com/service/getIpInfo.php?ip=".get_client ...
- 大话RAC介质恢复---只有备份文件的恢复
场景:Oracle 10g RAC:数据文件.控制文件.联机日志.参数文件都使用ASM,归档到ASM.完整备份后,删除所有控制文件.联机日志.数据文件:最后利用备份进行不完全恢复. 1.模拟灾难场景( ...
- 自适应游标共享技术01(Adaptive Cursor Sharing)
什么是ACS(adaptiver cursor sharing) Oracle通过绑定变量技术解决了SQL语句硬解析过多的问题,降低了资源的争用.但是绑定变量在引入cursor sharing,增加了 ...
- STM32F0xx_USART收发配置详细过程
前言 串口对于处理器来说算是一种标配,也是在软件开发中必不可少的,那就是使用串口来调试信息(打印出相应的信息).STM32F0系列的芯片,串口根据型号不同,数量也不同,从1个到8个不等. 今天主要总结 ...
- linux之I2C裸机驱动解析(转)
1 硬件特性 1.1 概述 I2C总线是由Philips公司开发的两线式串行总线,这两根线为时钟线(SCL)和双向数据线(SDA).由于I2C总线仅需要两根线,因此在电路板上占用的空间更少, ...
- ios 文件操作
1.常见的NSFileManager文件方法 -(NSData *)contentsAtPath:path //从一个文件读取数据 -(BOOL)createFileAtPath: path cont ...