avatar
Bloomberg电面面经# JobHunting - 待字闺中
S*0
1
刚记起还有一道题,问
Does C++ allow multiple inheritance?
What is the potential problem of multiple inheritance?
就说了说继承的ambiguity,举了个例子
class A
class B,C : public A
class D :public B,C
问:怎么解决?
用virtual inheritance: class B,C : virtual public A
B,C共享基类A
----
下午刚面完,说下周一给结果。
大部分是概念题,和behavior题
Why bloomberg?
Why software developer?
Describe the case that you feel press from colleague
How do you manage projects?
1. Ask a C++ project. Describe what features of c++ are used?
Explain encapsulatoin, inheritance, polymorphism
2.Two threads visit the same resource, what's the problem? How to solve it? What is deadlock? If deadlock happens, what to do?
答:Mutex and semaphore. 问:Difference between Mutex and semaphore
3. How to allocate dynamic memory in C++?
答:Use new
问:What happen when using new?
答:call constructor
问:What happen if there is not enough memory?
4. Do you know memory leak?
答:yes
问:How do you avoid memory leak?
答:Use smart pointer
问:How does that work?
5 Do you know mutable keyword in C++?
答:No. 就不问了。
6. Do you know STL of C++?
答:a little bit.
问:Give list A, list B, get intersection between A and B.
答:Use multiset
问:Complexity?
答:O(m+n)
7. A graph, how to detect cycle?
答:modified DFS. details...
问:what is the problem of Recursion?
答:Stack overflow if basic step is not appropriate
问:How to redesign?
答:Use iterative version of DFS
avatar
d*t
2
能说一下你是CS专业吗?
谢谢!

【在 S*******0 的大作中提到】
: 刚记起还有一道题,问
: Does C++ allow multiple inheritance?
: What is the potential problem of multiple inheritance?
: 就说了说继承的ambiguity,举了个例子
: class A
: class B,C : public A
: class D :public B,C
: 问:怎么解决?
: 用virtual inheritance: class B,C : virtual public A
: B,C共享基类A

avatar
d*t
3
能详细解释一下第6,7两题吗?谢谢!

【在 S*******0 的大作中提到】
: 刚记起还有一道题,问
: Does C++ allow multiple inheritance?
: What is the potential problem of multiple inheritance?
: 就说了说继承的ambiguity,举了个例子
: class A
: class B,C : public A
: class D :public B,C
: 问:怎么解决?
: 用virtual inheritance: class B,C : virtual public A
: B,C共享基类A

avatar
a*2
4
赞面经,一直不知道为什么要用mutable,STL里面有什么member是mutable的吗?哪位
牛人讲讲
avatar
S*0
5
EE
上来,没有问prefer哪种语言,直接开问

【在 d********t 的大作中提到】
: 能说一下你是CS专业吗?
: 谢谢!

avatar
d*t
6
mutable就是可以cast away const class的某个member的

【在 a**********2 的大作中提到】
: 赞面经,一直不知道为什么要用mutable,STL里面有什么member是mutable的吗?哪位
: 牛人讲讲

avatar
d*t
7
那你在简历里说你会multi-threading了?

【在 S*******0 的大作中提到】
: EE
: 上来,没有问prefer哪种语言,直接开问

avatar
g*e
8
is your interviewer's name vicca?
avatar
S*0
9
6. 一开始我用set,然后问了一下list A是否允许duplicate,面试官可能,所以改用
multiset。现在想想,用set也可以,只要找到两个list的intersection就可以了
7.见附件

【在 d********t 的大作中提到】
: 能详细解释一下第6,7两题吗?谢谢!
avatar
S*0
10
没有说

【在 d********t 的大作中提到】
: 那你在简历里说你会multi-threading了?
avatar
a*2
11
const class? 能举个例子吗?

【在 d********t 的大作中提到】
: mutable就是可以cast away const class的某个member的
avatar
S*0
12
没听清楚,口音挺正,反正不是a3

【在 g*********e 的大作中提到】
: is your interviewer's name vicca?
avatar
d*t
13
6.我觉得这种不需要插入删除的用array/vector最好了. 另外什么叫intersect?有一
个数相等?

【在 S*******0 的大作中提到】
: 6. 一开始我用set,然后问了一下list A是否允许duplicate,面试官可能,所以改用
: multiset。现在想想,用set也可以,只要找到两个list的intersection就可以了
: 7.见附件

avatar
S*0
14
就是交集了

【在 d********t 的大作中提到】
: 6.我觉得这种不需要插入删除的用array/vector最好了. 另外什么叫intersect?有一
: 个数相等?

avatar
d*t
15

我一直以为从list中找circle用两个指针一个快跑一个慢跑就可以了。

【在 S*******0 的大作中提到】
: 6. 一开始我用set,然后问了一下list A是否允许duplicate,面试官可能,所以改用
: multiset。现在想想,用set也可以,只要找到两个list的intersection就可以了
: 7.见附件

avatar
d*t
16
唉,看来又要恶补multi-threading了,这个东西很烦,不同的library有不同的
implementation。 ZThread下面就没有semaphore

【在 S*******0 的大作中提到】
: 没有说
avatar
d*t
17
那有可以能有多个交集啊?交完了还可以分了再交的

【在 S*******0 的大作中提到】
: 就是交集了
avatar
b*n
18
如果你用 C++ set,那么复杂度就不是 O(m+n) 了,
C++ 的 set 都是 BST,应该是O(mlogm+nlogm)
如果是用 Java 的 hashset 就没问题了

【在 S*******0 的大作中提到】
: 6. 一开始我用set,然后问了一下list A是否允许duplicate,面试官可能,所以改用
: multiset。现在想想,用set也可以,只要找到两个list的intersection就可以了
: 7.见附件

avatar
d*t
19
用set/vector/array算法是不是就是遍历A,B.find(A[i])?
或者用一个boolean array,有重复就flip?这样可以是O(m+n)

【在 b******n 的大作中提到】
: 如果你用 C++ set,那么复杂度就不是 O(m+n) 了,
: C++ 的 set 都是 BST,应该是O(mlogm+nlogm)
: 如果是用 Java 的 hashset 就没问题了

avatar
q*x
20
how could iterative dfs solve recursion overflow? you still need to use
stack and stack may still overflow.

【在 S*******0 的大作中提到】
: 就是交集了
avatar
z*u
21
mutable 是你的对象为 const 的情况下也允许修改的 data member?
effective c++ 里边提到了

【在 a**********2 的大作中提到】
: 赞面经,一直不知道为什么要用mutable,STL里面有什么member是mutable的吗?哪位
: 牛人讲讲

avatar
d*t
22
对我这样不懂graph的这种问题怎么解决?

【在 q****x 的大作中提到】
: how could iterative dfs solve recursion overflow? you still need to use
: stack and stack may still overflow.

avatar
y*g
23
应该是logm(m+n)

【在 b******n 的大作中提到】
: 如果你用 C++ set,那么复杂度就不是 O(m+n) 了,
: C++ 的 set 都是 BST,应该是O(mlogm+nlogm)
: 如果是用 Java 的 hashset 就没问题了

avatar
s*n
24
他这是共享桌面给你看的题目么?

【在 S*******0 的大作中提到】
: 6. 一开始我用set,然后问了一下list A是否允许duplicate,面试官可能,所以改用
: multiset。现在想想,用set也可以,只要找到两个list的intersection就可以了
: 7.见附件

avatar
d*t
25
都是概念题怎么可能

【在 s*******n 的大作中提到】
: 他这是共享桌面给你看的题目么?
avatar
y*g
26
stack as a data structure is often allocated in heap memory, which is much
larger than stack memory

【在 q****x 的大作中提到】
: how could iterative dfs solve recursion overflow? you still need to use
: stack and stack may still overflow.

avatar
d*t
27
能不能告诉我不会graph怎么找circle?

【在 y*******g 的大作中提到】
: stack as a data structure is often allocated in heap memory, which is much
: larger than stack memory

avatar
S*0
28
一开始我也纳闷呢,他意思是避免出现stack overflow,就是想让我换一种方式实现

【在 q****x 的大作中提到】
: how could iterative dfs solve recursion overflow? you still need to use
: stack and stack may still overflow.

avatar
S*0
29
没有,直接问的,根据回答再问新的问题

【在 s*******n 的大作中提到】
: 他这是共享桌面给你看的题目么?
avatar
d*t
30
我看前面有些非CS的面经,似乎偏重于brain teaser啊。为啥楼主被拷问得这么全面啊
?虽然不是什么太深的题目,不过真的很全啊。

【在 S*******0 的大作中提到】
: 没有,直接问的,根据回答再问新的问题
avatar
a*2
31
既然是const的member function,就不应该允许修改member variable,又引入一个
mutable实在很奇怪

【在 z****u 的大作中提到】
: mutable 是你的对象为 const 的情况下也允许修改的 data member?
: effective c++ 里边提到了

avatar
r*t
32
不到 effective, primer 里面就有了。

【在 z****u 的大作中提到】
: mutable 是你的对象为 const 的情况下也允许修改的 data member?
: effective c++ 里边提到了

avatar
q*x
33
西佳佳就是这么古怪。

【在 a**********2 的大作中提到】
: 既然是const的member function,就不应该允许修改member variable,又引入一个
: mutable实在很奇怪

avatar
y*g
34
const是接口,对外的,
mutable是内部实现,只要外界认为是const就好,比如实现一个using counter之类的


【在 a**********2 的大作中提到】
: 既然是const的member function,就不应该允许修改member variable,又引入一个
: mutable实在很奇怪

avatar
y*g
35
不会只能说不会啊

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