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
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