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 ...
随机推荐
- 查看cics 运行状态
查看cics 运行状态cicscp -v status all
- java语言基础02
一.Java语言基础(常量的概述和使用)(掌握) 1:什么是常量 就是在程序的执行过程中其值不发生改变的量. 2:Java中常量的分类 (1):字面值常量 (2):自定义常量(面向对象部分讲解) 3: ...
- CSS3实现轮播图效果2
先前用CSS3做了一个一张图片实现的轮播,但是这样的图片很难找,于是又改进了一下. HTML: <div class="box"> <ul> <li& ...
- linu流量监控
iftophttp://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858923.html 默认是监控第一块网卡的流量iftop 监控eth1iftop ...
- Creating a Unique File Name
If you are working with files or file attachments in PeopleCode, you will typically want to create a ...
- [leetcode]_Valid Parentheses
题目:判断给定字符串中的括号是否合法.题目中涉及三种符号'(' + ')' , '[' + ']' , '{' + '}'. 思路:利用stack来存储符号. 注意申请char型stack是: Sta ...
- Java基本开发环境搭建(适合第一次使用)
Java基本开发环境搭建(适合第一次使用) 编写人:cc 阿爸 2013-10-17 一.开发工具获取 1.开发工具包JDK l 下载地址: 到ORACLE公司官方网站(http://www.ora ...
- MySql like模糊查询使用详解
一.SQL的模式匹配允许你使用“_”匹配任何单个字符,而“%”匹配任意数目字符(包括零个字符).在 MySQL中,SQL的模式缺省是忽略大小写的.下面显示一些例子.注意在你使用SQL模式时,你不能使用 ...
- 小课堂week13 Clean Code Part2
Clean Code Part2 对象与数据结构 首先让我们进行一个严肃的思考,对象与数据结构的区别在哪里? 如下两段代码分别用数据结构和对象的方法来描述了一个Point. public class ...
- Python学习教程(learning Python)--1.4 Python数据处理基础
本节主要讨论数据操作及运算符等基础知识,熟悉C语言相关知识的读者请跳过此节. 在高级语言编程过程中,有了数据以后通常要对数据进行相应的数据处理,加.减.乘.除等基本运算,不难理解. 在Python里 ...