由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Quant版 - [合集] 面试题(C++,math)
相关主题
贡献一些面试题(GS,BarCap,Credit Suisse,etc.)[合集] 马上就第四年了,现在准备是不是有点晚了
如果排个序,哪三本书是最重要的?什么时候开始找工作?
一道面试题 求解哪一种Quant position最想要Statistics background?
问一道面试题(zz)equity derivative research算quant么?
[合集] numerical computation请问 Risk Management, Trading, or Quant
我也随便写点[JOB]NYC: Convertible Bond Strategist
[合集] Some questions on Quant developer job写昨天和今天的面经(GS, Janestreet)
[合集] 我也随便写点一个C++面试问题
相关话题的讨论汇总
话题: class话题: cout话题: public话题: virtual话题: c++
进入Quant版参与讨论
1 (共1页)
b***k
发帖数: 2673
1
☆─────────────────────────────────────☆
yww (petite) 于 (Wed Feb 20 12:03:09 2008) 提到:
(1)random walk with prob p>0.5 going +1 and 1-p going -1, what's the
probability it will ever hit 5
(2) pseudo code for read/write lock
(3) A is base class, B: public A; C: public B, all classes have a virtual
function f(), what will happen if you can f() in C's Ctor
(4) Singleton, Prototype, State design pattern
(5) what resource is shared between parent and child process after fork ?
(6) derivative of x^
n**x
发帖数: 6
2
for (3), you actually call the f() in the base class A. Never call a virtual
function during construction or destruction because the call never goes
down to the drived class even if you are trying to create a derived class
object.Since base class part is always created before derived class part,
and during the creation of the base class part, all part of C++ will view it
as a base class object since all the derived class part has not been
initialized. So the virtual function to be called is alwa
r***w
发帖数: 35
3
I think the answer for (1) is 1 is p>q. Not familiar with distribution, but
from point of view of PDE, this is a bias random walk, the corresponding PDE
is covection-diffusion. The solution will approach to the drift term in
asymptotic sense. Then, phyiscally 1 is the solution. Mathematically, the
PDE is
u_t+(2p-1)u'=pu", where p>0.5. Then, upwind of conservation law is to right
always. So, hitting 5 always happen.
t*****n
发帖数: 167
4
then, why not B's f()? I think B is already created, right?

virtual
it

【在 n**x 的大作中提到】
: for (3), you actually call the f() in the base class A. Never call a virtual
: function during construction or destruction because the call never goes
: down to the drived class even if you are trying to create a derived class
: object.Since base class part is always created before derived class part,
: and during the creation of the base class part, all part of C++ will view it
: as a base class object since all the derived class part has not been
: initialized. So the virtual function to be called is alwa

d*********1
发帖数: 25
5
#include
using namespace std;
class A {
public:
A() { cout<<"A constructor\n"; }
virtual void f() { cout<<"A"; }
};
class B: public A {
public:
B() { cout<<"B constructor\n"; }
virtual void f() { cout<<"B"; }
};
class C: public B {
public:
C() { cout<<"C constructor\n"; f(); }
virtual void f() { cout<<"C\n"; }
};
int main()
{
A *a= new C;
a->f(); //will print "C"
C
1 (共1页)
进入Quant版参与讨论
相关主题
一个C++面试问题[合集] numerical computation
请教:如果想工科PhD转行做Quant该学什么样的课程?我也随便写点
any one took the phone interview from JP morgan quant research group?[合集] Some questions on Quant developer job
大牛们,能帮我看看我的背景适合做Quant吗?[合集] 我也随便写点
贡献一些面试题(GS,BarCap,Credit Suisse,etc.)[合集] 马上就第四年了,现在准备是不是有点晚了
如果排个序,哪三本书是最重要的?什么时候开始找工作?
一道面试题 求解哪一种Quant position最想要Statistics background?
问一道面试题(zz)equity derivative research算quant么?
相关话题的讨论汇总
话题: class话题: cout话题: public话题: virtual话题: c++