由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - A -1st phone
相关主题
[合集] 问问版上的各位都是怎么开始学习算法和设计题目的?一道google题
请教一道题BST和有序双向链表的相互转换?
Amazon phone interview Software Engineering InternRP Amazon Third phone
考大家个新题 visitor reconstruct generic tree贡献几道G家onsite题
这道FB题怎么做?recover binary search tree 常数空间
收集了几个 List相关的题弱问:leetcode里Convert Sorted List to Binary Search Tree
请教一个系统设计问题 (转载)今天计划做20题
bloomberg电面help: leetcode "Recover Binary Search Tree" -- 附代码
相关话题的讨论汇总
话题: tree话题: index话题: array话题: recover话题: what
进入JobHunting版参与讨论
1 (共1页)
P********i
发帖数: 172
1
这周有4个phone, 准备攒人品,汇报版面:
introduce yourself, previous projects,
the most recent project u are working on
1)what is the difference of "==", and "equalTo", why they are different?
when to use each?
2)what is the difference of "has-a", "is-a"
3)in java, final, finalize, finally
4)describe hash table, how to use
5)how to decide the highest bit of a byte?
6)given an un-sorted array with unsigned integer, how can u find out the
index of two numbers which sum up to 10? (write code, read code)
Note, return the index, which means could not destroy the original array.
7)given a root of a tree, after you write the tree to the disk, how can u
recover the tree?
h**********d
发帖数: 4313
2

bless一下
g*********s
发帖数: 1782
3

so sorting is not allowed?

【在 P********i 的大作中提到】
: 这周有4个phone, 准备攒人品,汇报版面:
: introduce yourself, previous projects,
: the most recent project u are working on
: 1)what is the difference of "==", and "equalTo", why they are different?
: when to use each?
: 2)what is the difference of "has-a", "is-a"
: 3)in java, final, finalize, finally
: 4)describe hash table, how to use
: 5)how to decide the highest bit of a byte?
: 6)given an un-sorted array with unsigned integer, how can u find out the

c******t
发帖数: 391
4
Could you explain on the Q7? What the tree recover means?
Also, will they ask to explain the detailed implementation of Hash Table
such as random seed generation or something like that?
Thanks.

【在 P********i 的大作中提到】
: 这周有4个phone, 准备攒人品,汇报版面:
: introduce yourself, previous projects,
: the most recent project u are working on
: 1)what is the difference of "==", and "equalTo", why they are different?
: when to use each?
: 2)what is the difference of "has-a", "is-a"
: 3)in java, final, finalize, finally
: 4)describe hash table, how to use
: 5)how to decide the highest bit of a byte?
: 6)given an un-sorted array with unsigned integer, how can u find out the

P********i
发帖数: 172
5
sure, since tree are pointers, when u save the tree to disk, you need to
record the parent-child relationship in a way which can help u to recover,
when read data from disk back to memory.
There could be several solutions here, the reviewer asked me to provide as
many solutions as possible:
1) preorder + inorder -> reconstruct tree
Note instead of storing the whole tree node, you can just save an ID for
each node, and mapping ID to real node when necessarily.
2) use dewey index
since my research is in database, hence I am somehow familiar with dewey
index solution here, you can check wiki for more information.
e.g. 0 (root)
0.1 0.2
0.1.1 0.1.2 0.2.1 0.2.2
... ... ....
3) check tree to linked list
save linked list information
There are the solutions I proposed, maybe some others, call for new proposal
:)

【在 c******t 的大作中提到】
: Could you explain on the Q7? What the tree recover means?
: Also, will they ask to explain the detailed implementation of Hash Table
: such as random seed generation or something like that?
: Thanks.

P********i
发帖数: 172
6
No sorting allowed, since it may destroy the original index of the array.
Just go ahead with the O(n^2) solution, naive way, as the feedback from the
reviewer, although I proposed 3 solutions
1) sort, search
2) hashtable
3) naive: two for loops

【在 g*********s 的大作中提到】
:
: so sorting is not allowed?

f*********5
发帖数: 576
7
why not use hashtable?

array.
the

【在 P********i 的大作中提到】
: No sorting allowed, since it may destroy the original index of the array.
: Just go ahead with the O(n^2) solution, naive way, as the feedback from the
: reviewer, although I proposed 3 solutions
: 1) sort, search
: 2) hashtable
: 3) naive: two for loops

m****i
发帖数: 650
8
what does this mean
5)how to decide the highest bit of a byte?
How to use linked list to recover the tree?
3) check tree to linked list
save linked list information
c******t
发帖数: 391
9
5) maybe is to check if the highest bit is 0 or 1, how about this?
temp=num;
return (temp>>7)&1
for 3) co-ask...

【在 m****i 的大作中提到】
: what does this mean
: 5)how to decide the highest bit of a byte?
: How to use linked list to recover the tree?
: 3) check tree to linked list
: save linked list information

P********i
发帖数: 172
10
bingo:)
(1<<7) & temp;

【在 c******t 的大作中提到】
: 5) maybe is to check if the highest bit is 0 or 1, how about this?
: temp=num;
: return (temp>>7)&1
: for 3) co-ask...

s*******3
发帖数: 134
11
bless!攒rp!
1 (共1页)
进入JobHunting版参与讨论
相关主题
help: leetcode "Recover Binary Search Tree" -- 附代码这道FB题怎么做?
求解Recover Binary Search Tree的inplace解法收集了几个 List相关的题
Tango 有人面过吗?请教一个系统设计问题 (转载)
关于google电面的疑问bloomberg电面
[合集] 问问版上的各位都是怎么开始学习算法和设计题目的?一道google题
请教一道题BST和有序双向链表的相互转换?
Amazon phone interview Software Engineering InternRP Amazon Third phone
考大家个新题 visitor reconstruct generic tree贡献几道G家onsite题
相关话题的讨论汇总
话题: tree话题: index话题: array话题: recover话题: what