avatar
报个Uber电面面经# JobHunting - 待字闺中
e*g
1
小印哥。
先问一道system design相关的,如何保证service有high availability。
我把load balancer,brown out protection, throttling,single point
failure等等扯了一遍,大家觉得还有啥点没有cover到?
第二道是找出一个二叉树中任意两个叶子结点最长的距离。
直接递归做了,O(n)
感觉都答得不错,希望有onsite。
avatar
e*a
2
failover
avatar
b*5
3
WTF is brown out protection... never heard of it... google doesn't really
yield any result...

【在 e******g 的大作中提到】
: 小印哥。
: 先问一道system design相关的,如何保证service有high availability。
: 我把load balancer,brown out protection, throttling,single point
: failure等等扯了一遍,大家觉得还有啥点没有cover到?
: 第二道是找出一个二叉树中任意两个叶子结点最长的距离。
: 直接递归做了,O(n)
: 感觉都答得不错,希望有onsite。

avatar
f*n
4
Brownout -> when a host's available request handlers are all busy servicing
requests.
protection: Selectively fast fail certain requests based on priority.
It is widely used in AWS.

【在 b**********5 的大作中提到】
: WTF is brown out protection... never heard of it... google doesn't really
: yield any result...

avatar
e*g
5
多谢,这个以后要加上。

【在 e***a 的大作中提到】
: failover
avatar
e*g
6
就是这个。

servicing

【在 f**********n 的大作中提到】
: Brownout -> when a host's available request handlers are all busy servicing
: requests.
: protection: Selectively fast fail certain requests based on priority.
: It is widely used in AWS.

avatar
f*r
7
预祝LZ拿到大offer

【在 e******g 的大作中提到】
: 小印哥。
: 先问一道system design相关的,如何保证service有high availability。
: 我把load balancer,brown out protection, throttling,single point
: failure等等扯了一遍,大家觉得还有啥点没有cover到?
: 第二道是找出一个二叉树中任意两个叶子结点最长的距离。
: 直接递归做了,O(n)
: 感觉都答得不错,希望有onsite。

avatar
h*a
8
lz,请问这个题目是,指定一个叶节点,找到和这个节点最远的距离呢,还是要找到这
个树上所有叶节点中,最长的距离?
要是第二种,那就比较简单,就是左边depth+右边depth -1就行?
谢谢

【在 e******g 的大作中提到】
: 就是这个。
:
: servicing

avatar
e*g
9
多谢!

【在 f*******r 的大作中提到】
: 预祝LZ拿到大offer
avatar
e*g
10
所有叶节点中最长的距离。这个距离是节点的个数,所以在每个点的时候你要通过left
depth + right depth + 1来更新max,然后返回max(left depth, right depth) +
1。

【在 h**********a 的大作中提到】
: lz,请问这个题目是,指定一个叶节点,找到和这个节点最远的距离呢,还是要找到这
: 个树上所有叶节点中,最长的距离?
: 要是第二种,那就比较简单,就是左边depth+右边depth -1就行?
: 谢谢

avatar
h*a
11
嗨,那不就是max Depth of BT那道题目吗,或者就是求二叉树的高度嘛。
节点之间的距离,应该是指从一个节点(当然有可能是叶节点)到达另一个节点经过的
节点数目。

left
+

【在 e******g 的大作中提到】
: 所有叶节点中最长的距离。这个距离是节点的个数,所以在每个点的时候你要通过left
: depth + right depth + 1来更新max,然后返回max(left depth, right depth) +
: 1。

avatar
e*g
12
不好意思之前没解释清楚,这个还是不太一样。
这个题要求找出任意两个叶子节点之间距离最大的那个。不过解法很相似。

【在 h**********a 的大作中提到】
: 嗨,那不就是max Depth of BT那道题目吗,或者就是求二叉树的高度嘛。
: 节点之间的距离,应该是指从一个节点(当然有可能是叶节点)到达另一个节点经过的
: 节点数目。
:
: left
: +

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。