jjjjj
[参加活动]interview questions I met
1099
9
2005-11-28 13:39:00
updated: I will provide the quesitons I met in the recent interview here. hopefully helpful.
there would be 4 categories:
1. brain teasers
2. programming
3. finance
4. behavior
contribute some brain teasers I met:
1. u couple entered a room with another 8 couples. you shake hands with others. but you won't shake hands with your partner. finally you found the numbers of each person shakeing hands are different except you. how many times did your partner shake then?
2. 1000 coins are put in a bag. all the others are regular coins except one, which has both sides head. you picked one coin from the bag, and tossed 10 times, and found you got 10 heads. what is the probability that the coin you get is a regular coin?
3. there are 37 points in the paper. draw lines between any two points. but the lines can't intersect by each other. how many lines can you draw?
4. (I failed this one
) integrate int(0,2) 2-sqrt(4-x^2)5. Russian roulette: put 2 bullets into a revolver with capacity of 6 bullets. the 2 bullets are not adjacent to each other. your opponent triggered, no fire. now it is your turn. you can choose to trigger right away, or spin and then trigger. what is your choice? why?
[此贴子已经被作者于2005-12-3 9:57:08编辑过]
行业,finance
职位,associate
面试发生的大概年份 2005
some programming questions:
1.please declare a class with copy constructor and assignment operator.
2.what is virtual function? how is it implemented? why there is virtual destructor?
3.what is the "A is B" and "A has B"? how to decide when to use which?
4. class B
{
};
class A
{
public:
void f(B const& a)
{
a=10;
}
};
what is that "const" mean? any comments?
5. class foo
{
public:
foo(int i)
{}
};
class Bar:virtual foo
{
public:
Bar()
{}
};
any comments?
6. class X{
public:
X():a(0),b(0){
a=b++;
}
X &operator++(int){
a++;
b++;
return * this;
}
X& operator++(){
a++;
b+=2;
return *this;
}
private:
int a,b;
};
int main(int argc, _TCHAR* argv[])
{
X x;
x++;
(++x)++;
return x;
}
what will be the value of x returned?
7. can friend function access derived class's private member?
8. what if a function throw an expection that is not in its exception list?
[此贴子已经被作者于2005-12-3 10:07:17编辑过]
9.
void (__cdecl *signal( int sig, void (__cdecl *func ) (int [, int ] ))) (int);
explain
10.
class Complex{
public:
Complex(double real, double imaginary=0):_real(real), _imaginary(imaginary)
{};
void operator+ (Complex other){
_real=_real+other.real;
_imaginary=_imaginary+other._imaginary;
}
void operator<<(ostream os){
os<<"("<<_real<<","<<_imaginary<<")";
}
Complex operator++(){
++_real;
return *this;
}
Complex operator++(int){
Complex temp=*this;
++_real;
return temp;
}
private:
double _real,_imaginary;
}
how many issues can you find out of above code?
[此贴子已经被作者于2005-12-3 12:28:55编辑过]
到底了
Hot Deals
All Deals