由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - share一个大公司的onsite interview question
相关主题
f 一些面试题leetcode中的binary tree level order traverse II总是有run t
Re: 别了,纽约 (转载)M家onsite题一道
非常好的总结面试题准备,分享一下!说说我的一次面试经历及如何对付不友好的同胞面试官的
电面两题加州Senior Engineer - Mobile Robot Algorithm
我来谈谈很多人找工作的误区My Microsoft Interview Questions
amazon的interview该准备啥?[合集] Amazon Onsite 面试题
how to judge a linked list is palindrome?请教一个binary search tree和heap的问题。
关于BST traverse的复杂度off market
相关话题的讨论汇总
话题: enemy话题: robot话题: your话题: rooms话题: algorithm
进入JobHunting版参与讨论
1 (共1页)
s*i
发帖数: 388
1
系里的一个印度铁哥们透露给我的,他签了nda所以我就不透露是哪家了,大家应该也
能猜到。
software dev position。
how to design an algorithm to solve this problem:
given a house with several rooms, and a moving enemy, and your robot. the
path
and timing of the enemy is known. try to design a path for your robot that
can
traverse all rooms (can be visited several times) and avoid the enemy. that
is, your robot can not be in the same room at any time during your
traversal.
example: a 2x2 matrix is the house, and each cell is a room. the enemy start
from (1,1), and keep going to (1,2), (2,2), (2,1) then back to (1,1), each
step takes 1 second. your bot starts at a different cell as the enemy and
one strategy is synchronizing with the enemy.
what data structure
what algorithm
how do u improve the total traversing time?
45 min to solve, white board for pseudo code.
g*********s
发帖数: 1782
2
what kind of layout for all rooms in this house, a grid?

the
that
that
traversal.

【在 s*i 的大作中提到】
: 系里的一个印度铁哥们透露给我的,他签了nda所以我就不透露是哪家了,大家应该也
: 能猜到。
: software dev position。
: how to design an algorithm to solve this problem:
: given a house with several rooms, and a moving enemy, and your robot. the
: path
: and timing of the enemy is known. try to design a path for your robot that
: can
: traverse all rooms (can be visited several times) and avoid the enemy. that
: is, your robot can not be in the same room at any time during your

s*i
发帖数: 388
3
yes

【在 g*********s 的大作中提到】
: what kind of layout for all rooms in this house, a grid?
:
: the
: that
: that
: traversal.

B********n
发帖数: 384
4
robot起始位置可以随便选吗?如果可以的话,只要选择奇偶与enemy相反就可以任意走了.
start point enemy (a, b), robot (x, y), as long as (x+y) % 2 != (a+b) % /2

that

【在 s*i 的大作中提到】
: 系里的一个印度铁哥们透露给我的,他签了nda所以我就不透露是哪家了,大家应该也
: 能猜到。
: software dev position。
: how to design an algorithm to solve this problem:
: given a house with several rooms, and a moving enemy, and your robot. the
: path
: and timing of the enemy is known. try to design a path for your robot that
: can
: traverse all rooms (can be visited several times) and avoid the enemy. that
: is, your robot can not be in the same room at any time during your

l*********r
发帖数: 674
5
可以假设只能沿着grid移动把,(1,1)to (2,2) not allowed.

【在 s*i 的大作中提到】
: yes
l*********r
发帖数: 674
6
如果是沿着grid走的话,每一步奇偶性都会变一下。这样robot只要比enemy晚一步出门
就可以直接遍历所有room了。
不知道对面走允不允许,比如说enemy在(1,2)的时候robot start from (1,1)下一步
他们互换位置。

了.

【在 B********n 的大作中提到】
: robot起始位置可以随便选吗?如果可以的话,只要选择奇偶与enemy相反就可以任意走了.
: start point enemy (a, b), robot (x, y), as long as (x+y) % 2 != (a+b) % /2
:
: that

c******w
发帖数: 1108
7
万一enemy有一步是停在一个房间不动呢?

了.

【在 B********n 的大作中提到】
: robot起始位置可以随便选吗?如果可以的话,只要选择奇偶与enemy相反就可以任意走了.
: start point enemy (a, b), robot (x, y), as long as (x+y) % 2 != (a+b) % /2
:
: that

s*i
发帖数: 388
8
it seems that they are looking for graph search algorithm
l*****a
发帖数: 14598
9
那就先把别的屋遍历了,
等他一出来就进去

【在 c******w 的大作中提到】
: 万一enemy有一步是停在一个房间不动呢?
:
: 了.

1 (共1页)
进入JobHunting版参与讨论
相关主题
off market我来谈谈很多人找工作的误区
问几个有关Binary tree的题amazon的interview该准备啥?
从tree的post order traversal和pre,能否build这个tree?how to judge a linked list is palindrome?
BST面试题关于BST traverse的复杂度
f 一些面试题leetcode中的binary tree level order traverse II总是有run t
Re: 别了,纽约 (转载)M家onsite题一道
非常好的总结面试题准备,分享一下!说说我的一次面试经历及如何对付不友好的同胞面试官的
电面两题加州Senior Engineer - Mobile Robot Algorithm
相关话题的讨论汇总
话题: enemy话题: robot话题: your话题: rooms话题: algorithm