Careercup - Microsoft面试题 - 5700293077499904
2014-05-12 00:02
原题:
For a given map (ie Bing map) given longitude/latitude/ how would you design the system so that when map longitudeDelta/latitdueDelta changed you add additional pins on map for regions that was not previously cover.
In another word, how would you design it to avoid getting and displaying duplicated pins
题目:如果地图上坐标发生了变化,如何避免重复标记地点。(题目愣是没看懂。)
解法:哈希吗?既然坐标是会变化的,那么用自增id或者其他和位置无关的值来作为哈希键值,这样就可以避免重复标记了。
代码:
// http://www.careercup.com/question?id=5700293077499904
Answer:
A location on the map may change, thus using the pair of <latitude, longitude> to be the unique id is not a good id.
Maybe using an auto-increment id is better.
A HashMap<int, Coordinate> which maps the auto-increment id to the coordinate will allow us to change the coordinates as necessary.
By the way, what kind of knowledge are these questions try to test? IQ, experience or inspiration?
Careercup - Microsoft面试题 - 5700293077499904的更多相关文章
- 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面试题 - 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 ...
- Careercup - Microsoft面试题 - 5428361417457664
2014-05-11 03:37 题目链接 原题: You have three jars filled with candies. One jar is filled with banana can ...
随机推荐
- CentOS6.5下挂载NTFS格式的文件系统
下载对应CentOS版本的rpmforge,下载地址:http://pkgs.repoforge.org/rpmforge-release/ 安装rpmforge,输入命令:# rpm -ivh rp ...
- C#中使用官方驱动操作MongoDB
想要在C#中使用MongoDB,首先得要有个MongoDB支持的C#版的驱动.C#版的驱动有很多种,如官方提供的,samus. 实现思路大都类似.这里我们先用官方提供的mongo-csharp-dri ...
- SublimeText快捷键大全(附GIF演示图)
Sublime Text是码农必备之神器,有助于码农快速开垦,如果掌握了Sublime强大的快捷键就可以飞起来了.下面下载吧小编汇总了SublimeText支持的全部快捷键(适用SublimeText ...
- mysql报错Table '.\erchina_news\v9_search' is marked as crashed and should be repaired
直切正题 报该问题的是表引导坏了,需要修复表就行 方法一: 找到mysql的安装目录的bin/myisamchk工具,在命令行中输入: myisamchk -c -r ../data/erchina_ ...
- [CentOS 7] 安装nginx第一步先搭建nginx服务器环境
简要地介绍一下,如何在CentOS 7中安装nginx服务器 方法/步骤 下载对应当前系统版本的nginx包(package) # wget http://nginx.org/packages/ ...
- Delphi For Android 开发笔记 2 NEXTGEN下的字符串类型
delphi开发速度迅捷至少有30%(猜的,呵呵)的原因是因为其字符串(string.WideString.PChar.PAnsiChar等)处理能力. 而从delphi XE4开始,在system等 ...
- Node.js学习笔记 02 Implementing flow control
What is flow control? 和其它语言一样,Node.js 在代码编写时,如何组织代码,如何写出clean code都是不可避免的难点. 同时,由于Node.js的天然特性(异步,事件 ...
- instanceof、==号、Objetc类
1)instanceof: 判断某个对象是否为某个类的实例,注意多态的运用,一个父类引用指向子类的对象,根据继承,子类就是父类,所以子类也可以看做是父类的一个实例. 形式:引用 instanceof ...
- 随机数范围扩展(如rand7()到rand10())(转)
题目:已知有个rand7()的函数,返回1到7随机自然数,让利用这个rand7()构造rand10() 随机1~10.分析:要保证rand10()在整数1-10的均匀分布,可以构造一个1-10*n的均 ...
- hdu 2102 A计划
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2102 A计划 Description 可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸 ...