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的更多相关文章

  1. Careercup - Microsoft面试题 - 6314866323226624

    2014-05-11 05:29 题目链接 原题: Design remote controller for me. 题目:设计一个遥控器. 解法:遥控什么?什么遥控?传统的红外线信号吗?我只能随便说 ...

  2. Careercup - Microsoft面试题 - 6366101810184192

    2014-05-10 22:30 题目链接 原题: Design database locks to allow r/w concurrency and data consistency. 题目:设计 ...

  3. Careercup - Microsoft面试题 - 24308662

    2014-05-12 07:31 题目链接 原题: I have heard this question many times in microsoft interviews. Given two a ...

  4. Careercup - Microsoft面试题 - 5204967652589568

    2014-05-11 23:57 题目链接 原题: identical balls. one ball measurements ........ dead easy. 题目:9个看起来一样的球,其中 ...

  5. Careercup - Microsoft面试题 - 5175246478901248

    2014-05-11 23:52 题目链接 原题: design an alarm clock for a deaf person. 题目:为聋人设计闹钟? 解法:聋人听不见,那么闪光.震动都可行.睡 ...

  6. Careercup - Microsoft面试题 - 5718181884723200

    2014-05-11 05:55 题目链接 原题: difference between thread and process. 题目:请描述进程和线程的区别. 解法:操作系统理论题.标准答案在恐龙书 ...

  7. Careercup - Microsoft面试题 - 5173689888800768

    2014-05-11 05:21 题目链接 原题: Complexity of a function: int func_fibonacci ( int n) { ) { return n; } el ...

  8. Careercup - Microsoft面试题 - 6282862240202752

    2014-05-11 03:56 题目链接 原题: Given an integer array. Perform circular right shift by n. Give the best s ...

  9. Careercup - Microsoft面试题 - 5428361417457664

    2014-05-11 03:37 题目链接 原题: You have three jars filled with candies. One jar is filled with banana can ...

随机推荐

  1. CentOS学习笔记--时间

    时间 有装过Linux系统的人,可能都会有这样的经历,就是该机器安装windows系统时,时间正确,但是安装了linux系统后,尽管时区选择正确,也会发现系统时间不对.这是由于安装系统时采用了UTC, ...

  2. Java调第三方的webservice接口

    1.eclipse中add dynamic web project 2.选中项目右键new——> webservice ——> webservice client 在service def ...

  3. html5,html5教程

    html5,html5教程 1.向后兼容 HTML5是这样被定义的:能向后兼容目前UA处理内容的方式.为了让语言更简单,一些老的元素和Attribute被舍弃.比如一些纯粹用于展现的元素(译注:即非语 ...

  4. 两分钟让你明白什么是ERP

    把专业的问题通俗化——    ERP(Enterprise Resource Planning)企业资源计划系统,是指建立在信息技术基础上,以系统化的管理思想,为企业决策层及员工提供决策运行手段的管理 ...

  5. wamp+zendstudio12+xDebugger环境搭建

    1.网上找到Wampserver,下载即可,一路安装即可,安装好后打开浏览器输入http://localhost即可看到有没有安装成功 比如我的是这样的,就说嘛wampserver安装成功了 wamp ...

  6. mybatis使用笔记

    关于动态SQL里的条件查询(if test): 1.lombok插件和mybatis插件在有些变量名下会冲突,比如一个变量为rType的字段,lombok插件认为应该是getRType,但是mybat ...

  7. BAT命令介绍【转自Internet】

    一.简单批处理内部命令简介 1.Echo 命令 打开回显或关闭请求回显功能,或显示消息.如果没有任何参数,echo 命令将显示当前回显设置. 语法: echo [{on│off}] [message] ...

  8. C# 代码重启windows服务

    ServiceController service = new ServiceController("EnergyRecordService"); protected void b ...

  9. mysql数据库开发规范

    对规范的遵守可用二八原则,不要教条.为满足实际需求 可忽视部分规范. 1.索引规范 *目标 |--利用最小的索引成本找到需要的行记录 *原则 |--做前缀匹配 |--选择区分度高的列做前缀索引列 |- ...

  10. 内存分配函数malloc、realloc、calloc、_alloca

    1.内存分配函数_alloca.malloc.realloc.calloc: _alloca 函数原型void * __cdecl _alloca(size_t); 头文件:malloc.h _all ...