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 ...
随机推荐
- 一、Struts2的概述
一.Struts2概述 是什么? Struts2是一个M(模型---域--范围模型)V(View视图)C(控制器)框架(模型2).框架都是一个半成品.提高开发效率. Struts1是一个MVC框架,非 ...
- 类名 对象名 =new 类名();
类名 对象名 =new 类名();该怎么理解 类名 对象名 =new 类名();=左边:创建一个类的对象=右边:调用这个类的构造函数初始化对象,类名()这个是构造函数,用来做初始化的.
- js事件 event.target
我们购物车里,会时不时增加和删除产品时,就会绑定事件和解绑的动作. <ul> <li></li> <li></li> </ul> ...
- [原创] 初识Agile/CMMI/Scrum
一.背景介绍 在朋友(aehyok)的建议下,初步去了解Visual Studio Online,简称VS Online(即原来的 Team Foundation Service,简称TFS) VS ...
- 认识php钩子-转白俊遥的博客
认识php钩子-转载白俊遥的博客 我们先来回顾下原本的开发流程:产品汪搞出了一堆需求:当用户注册成功后需要发送短信.发送邮件等等:然后聪明机智勇敢的程序猿们就一扑而上:把这些需求转换成代码扔在 用户注 ...
- Android计时器TimerTask,Timer,Handler
Android计时器TimerTask,Timer,若要在TimerTask中更新主线程UI,鉴于Android编程模型不允许在非主线程中更新主线程UI,因此需要结合Android的Handler实现 ...
- programming ruby
ri #rdoc reader attr_reader attr_writer @@xx 类变量都是私有的 def 类名.xx end 类方法 [1,3,5,7].inject(0){|sum,e| ...
- 【Inno Setup】 Inno Setup 64位安装程序默认安装路径
在脚本中加入: ArchitecturesInstallIn64BitMode=x64 ArchitecturesAllowed=x64
- NOJ1142-最大连续和
最大连续和 时间限制(普通/Java) : 1000 MS/ 3000 MS 运行内存限制 : 65536 KByte总提交 : 1282 测试通过 : 230 ...
- ES6 入门系列 - let 和 const 命令
let命令 基本用法 ES6新增了let命令,用来声明变量.它的用法类似于var,但是所声明的变量,只在let命令所在的代码块内有效. { let a = ; ; } a // ReferenceEr ...