由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - amazon二面
相关主题
谷歌电面二面面筋(悲剧了)问个amazon面试题
用queue 做树的广度优先遍历,空间复杂度是多少?M家问题
Level order traversal只让用一个Queue怎么做?请教一道题
请教一道google的数组遍历题弱问一道G家电面题
问一道算法题电面面经
Google经典题目一问google面试问题
一道算法题Amazon二面
题都感觉做对了,面试的人也满意,为什么二面过后还是直接悲剧呢……顺便上P面经问两道微软题
相关话题的讨论汇总
话题: int话题: sum话题: complexity话题: return话题: chess
进入JobHunting版参与讨论
1 (共1页)
c***g
发帖数: 472
1
1 abstract和interface有什么区别, 鄙人长期不用java了,直接说不会
2 念了一段code, 问我什么问题
int f(int x) {

if(x==1) return 1;

return x*f(x-1);
}
然后问如果整数特别大的话, 怎么计算
3 设计一个chess game
4 一个int数组, 给你一个sum, 找出和是sum的两个int
听说amazon onsite的都发一个kindle啊, 是不是真的啊, 去过的人说说?
y******5
发帖数: 43
2
Thank you for your post.
2 念了一段code, 问我什么问题
int f(int x) {

if(x==1) return 1;

return x*f(x-1);
}
Problems:
(1). x<0
(2). overflow
4 一个int数组, 给你一个sum, 找出和是sum的两个int
solution 1: hash table, time complexity O(n), space complexity O(n)
solution 2: sort in-place, time complexity O(nlgn), space complexity O(1)
y***m
发帖数: 7027
3
2.负数死递归?
int f(int n){
int k=1 or -1;
while(k<=n){
x=x*k;
k++ or k--
}
return x;
}
3. 建各个棋子object定义属性,走法,建hashmap 存棋子位置坐标等,
queue存方案,多线程,优先级调度...
4. 遍历同时把元素和sum-元素值分别放两个hash A,B同时检查,如没找着,遍历B去找
A是否有 o(n)?

【在 c***g 的大作中提到】
: 1 abstract和interface有什么区别, 鄙人长期不用java了,直接说不会
: 2 念了一段code, 问我什么问题
: int f(int x) {
:
: if(x==1) return 1;
:
: return x*f(x-1);
: }
: 然后问如果整数特别大的话, 怎么计算
: 3 设计一个chess game

a******7
发帖数: 106
4
about 3,
why do we need multi-thread, only two users, each have the turn at one
time.
why do we need hashmap, when you make move on board, you need check if
other chess is on certain position. So how about using a N*N array, with
each hold pointer to a chess object or NULL.
why do we need queue, a sequence of moves? One user's moves always
changes based on the other's moves, right? So I guess there gonna be
some decision tree, if the other make some decision, then we choose
certain path accordingly.
Comment if I'm wrong. Thanks!

【在 y***m 的大作中提到】
: 2.负数死递归?
: int f(int n){
: int k=1 or -1;
: while(k<=n){
: x=x*k;
: k++ or k--
: }
: return x;
: }
: 3. 建各个棋子object定义属性,走法,建hashmap 存棋子位置坐标等,

w********p
发帖数: 948
5
请教一下,有让当时写code吗?
d**e
发帖数: 6098
6
对这类游戏的设计,我一直有个疑问是到哪一步才停止计算哪一步才是最优的?

【在 a******7 的大作中提到】
: about 3,
: why do we need multi-thread, only two users, each have the turn at one
: time.
: why do we need hashmap, when you make move on board, you need check if
: other chess is on certain position. So how about using a N*N array, with
: each hold pointer to a chess object or NULL.
: why do we need queue, a sequence of moves? One user's moves always
: changes based on the other's moves, right? So I guess there gonna be
: some decision tree, if the other make some decision, then we choose
: certain path accordingly.

y***m
发帖数: 7027
7
发散式思考,选择最优策略,次优策略。。存list把。。。每个策略一个queue呢?这
样按原定计划就是一步步move out? 不过决策树也是挺好的解决模型吧
hashmap只是初步考虑,按棋子名取信息,不过你说的类似坐标方式二者结合可能会更
方便..

【在 a******7 的大作中提到】
: about 3,
: why do we need multi-thread, only two users, each have the turn at one
: time.
: why do we need hashmap, when you make move on board, you need check if
: other chess is on certain position. So how about using a N*N array, with
: each hold pointer to a chess object or NULL.
: why do we need queue, a sequence of moves? One user's moves always
: changes based on the other's moves, right? So I guess there gonna be
: some decision tree, if the other make some decision, then we choose
: certain path accordingly.

1 (共1页)
进入JobHunting版参与讨论
相关主题
问两道微软题问一道算法题
问一个时间复杂度的问题,数组里取k个最大数Google经典题目一问
hash_map 的遍历问题一道算法题
CS algorithm question题都感觉做对了,面试的人也满意,为什么二面过后还是直接悲剧呢……顺便上P面经
谷歌电面二面面筋(悲剧了)问个amazon面试题
用queue 做树的广度优先遍历,空间复杂度是多少?M家问题
Level order traversal只让用一个Queue怎么做?请教一道题
请教一道google的数组遍历题弱问一道G家电面题
相关话题的讨论汇总
话题: int话题: sum话题: complexity话题: return话题: chess