Redian新闻
>
google电面第一轮面经 求bless
avatar
google电面第一轮面经 求bless# JobHunting - 待字闺中
X*n
1
10分钟前刚结束 都是老题 求bless
1. unsigned int 二进制bit位reverse int长度未知 (O(n)coding, improve to O(
logn))
2. virtual destructor
3. tcp congestion control
4. research discussion
5. what happen when type url in browser
6. access privileges in C++
7. remove duplicate files
avatar
h*n
2
bless

【在 X*********n 的大作中提到】
: 10分钟前刚结束 都是老题 求bless
: 1. unsigned int 二进制bit位reverse int长度未知 (O(n)coding, improve to O(
: logn))
: 2. virtual destructor
: 3. tcp congestion control
: 4. research discussion
: 5. what happen when type url in browser
: 6. access privileges in C++
: 7. remove duplicate files

avatar
s*t
3
第一个logn怎么弄?

【在 X*********n 的大作中提到】
: 10分钟前刚结束 都是老题 求bless
: 1. unsigned int 二进制bit位reverse int长度未知 (O(n)coding, improve to O(
: logn))
: 2. virtual destructor
: 3. tcp congestion control
: 4. research discussion
: 5. what happen when type url in browser
: 6. access privileges in C++
: 7. remove duplicate files

avatar
d*g
4
第一题啥意思?是把unsigned int的每个bit位翻转吗?还是123变321这样的?
avatar
l*y
5
bless
avatar
c*2
6
No.
I think:
00001011 ==> 11010000
treat an int as an array of binary bits.
Similar to: reverse a string in place

【在 d*********g 的大作中提到】
: 第一题啥意思?是把unsigned int的每个bit位翻转吗?还是123变321这样的?
avatar
t*j
7
楼主面的哪个组,tcp congestion control都要考,
我记得就是调节window大小吧。要答的多detail么?

【在 X*********n 的大作中提到】
: 10分钟前刚结束 都是老题 求bless
: 1. unsigned int 二进制bit位reverse int长度未知 (O(n)coding, improve to O(
: logn))
: 2. virtual destructor
: 3. tcp congestion control
: 4. research discussion
: 5. what happen when type url in browser
: 6. access privileges in C++
: 7. remove duplicate files

avatar
c*2
8
I was asked the same question before from a startup:
int mirror_bits( int num)
{
int tmp=0;
int i=0;
int int_size_in_bits=sizeof(int)*8;
while(num>(1<if((1<tmp |= 1<}
i++;
}

return tmp;
}
avatar
l*y
9
那不知道数组长度咋办?

【在 c***2 的大作中提到】
: No.
: I think:
: 00001011 ==> 11010000
: treat an int as an array of binary bits.
: Similar to: reverse a string in place

avatar
r*l
10

classic question bit reverse
lgn implementation, there are more efficient and fancy way of bit
operation, but this is most straightforward.
// assume 32 bits integer
unsigned int reverseBits(unsigned int x) {
x = (((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << 1));
x = (((x & 0xcccccccc) >> 2) | ((x & 0x33333333) << 2));
x = (((x & 0xf0f0f0f0) >> 4) | ((x & 0x0f0f0f0f) << 4));
x = (((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8));
return((x >> 16) | (x << 16));
}

【在 l********y 的大作中提到】
: 那不知道数组长度咋办?
avatar
X*n
11
对就是这个意思

【在 c***2 的大作中提到】
: No.
: I think:
: 00001011 ==> 11010000
: treat an int as an array of binary bits.
: Similar to: reverse a string in place

avatar
X*n
12
没有哪个组, 估计面试官看了我简历是做网络相关的就问网络题了
tcp congestion control我也就记得个大概 就窗口控制说了说 不知道怎么样

【在 t*****j 的大作中提到】
: 楼主面的哪个组,tcp congestion control都要考,
: 我记得就是调节window大小吧。要答的多detail么?

avatar
G*0
13
Bless~

【在 X*********n 的大作中提到】
: 10分钟前刚结束 都是老题 求bless
: 1. unsigned int 二进制bit位reverse int长度未知 (O(n)coding, improve to O(
: logn))
: 2. virtual destructor
: 3. tcp congestion control
: 4. research discussion
: 5. what happen when type url in browser
: 6. access privileges in C++
: 7. remove duplicate files

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