x****k 发帖数: 2932 | 1 一家IB的Analytics developer的onsite,只记得部分题目,一些比较简单的题目就不
写了。括号后是我认为的答案或者提示。
1. write a iterative function to calculate fibonacci sequence
2. what is the difference of Delete table and truncat table.(about sql &
database)
3. what is ACID.(about sql or database)
4. write a find() for BST, How to decide the element could not be found.((
less than && No left child) || (large than && no right child))
5. how to reverse a link list using one point
(should I use recursive calling)
6. find the sizeof(int) without using sizeof(). (大家可以讨论一下,我用(~
0x0)右移位做的,但是不对方希望的答案)
7. main()
{
folk();
folk();
folk();
printf("abc\n");
}
How many abc will be printed?
8. what is the difference between.
kill proces_id
kill -9 process_id
另外一家类似职位的电面,全部是stl的问题,很简单。
1. new a vector, what is the size(),
2. how to prevent relocation when push elements into a vector. (reserve())
3. why vector use relocation instead of chunks of memory.(keep compatible
with C array)
4. how is deque implemented?(uses chunks of memory)
5. the different of set & map? what is the return value of find()? (an
iterator of element )
6. what is the member function needed to use set.find() or map.find().(less(
))
7. what if the element class doesn't have less() operator? (pass a functor
to constructor as comparing function)
8. for loop to find a element in a vector, what is the method the class need
to support? (equal operator)
9. For smart pointer, How it implement the reference counter(a pointer to a
int or unsigned int)
发挥得一般,不是技术问题,感觉表现得不够活跃。面完后觉得还是很不错的职位。求
bless! |
w***s 发帖数: 1026 | 2 bless
【在 x****k 的大作中提到】 : 一家IB的Analytics developer的onsite,只记得部分题目,一些比较简单的题目就不 : 写了。括号后是我认为的答案或者提示。 : 1. write a iterative function to calculate fibonacci sequence : 2. what is the difference of Delete table and truncat table.(about sql & : database) : 3. what is ACID.(about sql or database) : 4. write a find() for BST, How to decide the element could not be found.(( : less than && No left child) || (large than && no right child)) : 5. how to reverse a link list using one point : (should I use recursive calling)
|
G********0 发帖数: 1359 | 3 Bless~
【在 x****k 的大作中提到】 : 一家IB的Analytics developer的onsite,只记得部分题目,一些比较简单的题目就不 : 写了。括号后是我认为的答案或者提示。 : 1. write a iterative function to calculate fibonacci sequence : 2. what is the difference of Delete table and truncat table.(about sql & : database) : 3. what is ACID.(about sql or database) : 4. write a find() for BST, How to decide the element could not be found.(( : less than && No left child) || (large than && no right child)) : 5. how to reverse a link list using one point : (should I use recursive calling)
|
d*****n 发帖数: 1956 | |
P***e 发帖数: 3441 | 5 bless~
【在 x****k 的大作中提到】 : 一家IB的Analytics developer的onsite,只记得部分题目,一些比较简单的题目就不 : 写了。括号后是我认为的答案或者提示。 : 1. write a iterative function to calculate fibonacci sequence : 2. what is the difference of Delete table and truncat table.(about sql & : database) : 3. what is ACID.(about sql or database) : 4. write a find() for BST, How to decide the element could not be found.(( : less than && No left child) || (large than && no right child)) : 5. how to reverse a link list using one point : (should I use recursive calling)
|
d******a 发帖数: 238 | 6 bless!
第六题可以用 (unsigned int)((int *)0 + 1),类似的问题还有求结构体中某变量的
offset |
x****k 发帖数: 2932 | 7 多谢多谢!很久没写类似的代码,都忘光了。
【在 d******a 的大作中提到】 : bless! : 第六题可以用 (unsigned int)((int *)0 + 1),类似的问题还有求结构体中某变量的 : offset
|
t*******y 发帖数: 637 | 8 bless
【在 x****k 的大作中提到】 : 一家IB的Analytics developer的onsite,只记得部分题目,一些比较简单的题目就不 : 写了。括号后是我认为的答案或者提示。 : 1. write a iterative function to calculate fibonacci sequence : 2. what is the difference of Delete table and truncat table.(about sql & : database) : 3. what is ACID.(about sql or database) : 4. write a find() for BST, How to decide the element could not be found.(( : less than && No left child) || (large than && no right child)) : 5. how to reverse a link list using one point : (should I use recursive calling)
|
b********n 发帖数: 609 | 9 看了你的答案,感觉你答得不好。
【在 x****k 的大作中提到】 : 一家IB的Analytics developer的onsite,只记得部分题目,一些比较简单的题目就不 : 写了。括号后是我认为的答案或者提示。 : 1. write a iterative function to calculate fibonacci sequence : 2. what is the difference of Delete table and truncat table.(about sql & : database) : 3. what is ACID.(about sql or database) : 4. write a find() for BST, How to decide the element could not be found.(( : less than && No left child) || (large than && no right child)) : 5. how to reverse a link list using one point : (should I use recursive calling)
|
x****k 发帖数: 2932 | 10 你是指第一组问题还是第二组?第一组我的确不是很理想。
【在 b********n 的大作中提到】 : 看了你的答案,感觉你答得不好。
|
|
|
b********n 发帖数: 609 | 11 第二组也一般,deque明明是queue,什么chunk of memory
【在 x****k 的大作中提到】 : 你是指第一组问题还是第二组?第一组我的确不是很理想。
|
x****k 发帖数: 2932 | 12 deque的内部实现是一个或多个memory block,而不是连续地址的一块memory。
【在 b********n 的大作中提到】 : 第二组也一般,deque明明是queue,什么chunk of memory
|
b********n 发帖数: 609 | 13 deque全称叫什么??
【在 x****k 的大作中提到】 : deque的内部实现是一个或多个memory block,而不是连续地址的一块memory。
|
b********n 发帖数: 609 | 14 而且你第三题和第九题也不太对。
【在 x****k 的大作中提到】 : deque的内部实现是一个或多个memory block,而不是连续地址的一块memory。
|
x****k 发帖数: 2932 | 15 deque (usually pronounced like "deck") is an irregular acronym of double-
ended queue.
queue只是数据结构,可以用array,link list甚至拿两个stacks去实现。
【在 b********n 的大作中提到】 : deque全称叫什么??
|
d******a 发帖数: 238 | 16 同意你的看法。
C++.Standard.Library,.The.A.Tutorial.and.Reference 书上的。
the deque is implemented typically as a bunch of individual blocks, with the
first block growing in one direction and the last block growing in the
opposite direction
【在 x****k 的大作中提到】 : deque的内部实现是一个或多个memory block,而不是连续地址的一块memory。
|
D***h 发帖数: 183 | 17 既然连queue和deque都分不清,你自己也别来误导阿,我还要参考lz答案呢。
【在 b********n 的大作中提到】 : deque全称叫什么??
|
D***h 发帖数: 183 | 18 big bless!
【在 x****k 的大作中提到】 : 一家IB的Analytics developer的onsite,只记得部分题目,一些比较简单的题目就不 : 写了。括号后是我认为的答案或者提示。 : 1. write a iterative function to calculate fibonacci sequence : 2. what is the difference of Delete table and truncat table.(about sql & : database) : 3. what is ACID.(about sql or database) : 4. write a find() for BST, How to decide the element could not be found.(( : less than && No left child) || (large than && no right child)) : 5. how to reverse a link list using one point : (should I use recursive calling)
|
x****k 发帖数: 2932 | 19 多谢bless。我不能保证正确,所以拿出来给大家讨论,也仅供***参考***
【在 D***h 的大作中提到】 : 既然连queue和deque都分不清,你自己也别来误导阿,我还要参考lz答案呢。
|
x****k 发帖数: 2932 | 20 第三题的答案是对方说的,不是我说的,我也没必要当场和他较这个真。后来翻书又看
了一遍,最大的优点是对于vector可以使用raw pointer to refer individual
element,而其他container必须使用iterator
你觉得第九题该怎么回答?
【在 b********n 的大作中提到】 : 而且你第三题和第九题也不太对。
|
|
|
b********n 发帖数: 609 | 21
this is right
it's not a pointer to a number, but a pointer to a counter object
【在 x****k 的大作中提到】 : 第三题的答案是对方说的,不是我说的,我也没必要当场和他较这个真。后来翻书又看 : 了一遍,最大的优点是对于vector可以使用raw pointer to refer individual : element,而其他container必须使用iterator : 你觉得第九题该怎么回答?
|
b********n 发帖数: 609 | 22 u don't know a single word out of ur big mouth.
【在 D***h 的大作中提到】 : 既然连queue和deque都分不清,你自己也别来误导阿,我还要参考lz答案呢。
|
d**e 发帖数: 6098 | 23 shhh....冷静冷静,不要激动
【在 b********n 的大作中提到】 : u don't know a single word out of ur big mouth.
|
b********n 发帖数: 609 | 24
double-
u can say all associate containers are implemented on memory blocks, but
that's not an answer. u should've said deque is double ended queue,
usually implemented by dynamic array or doubly-linked list.
【在 x****k 的大作中提到】 : deque (usually pronounced like "deck") is an irregular acronym of double- : ended queue. : queue只是数据结构,可以用array,link list甚至拿两个stacks去实现。
|
b********n 发帖数: 609 | 25 hehe, relax. I've seen too many stupid ppl to be 激动
【在 d**e 的大作中提到】 : shhh....冷静冷静,不要激动
|
y*******n 发帖数: 129 | 26 谁给解释一下第7题,我编译了下,怎么每次输出的结果不一定啊。
或者 5个,或者1个,甚至有时更多。求高手指点。
【在 x****k 的大作中提到】 : 一家IB的Analytics developer的onsite,只记得部分题目,一些比较简单的题目就不 : 写了。括号后是我认为的答案或者提示。 : 1. write a iterative function to calculate fibonacci sequence : 2. what is the difference of Delete table and truncat table.(about sql & : database) : 3. what is ACID.(about sql or database) : 4. write a find() for BST, How to decide the element could not be found.(( : less than && No left child) || (large than && no right child)) : 5. how to reverse a link list using one point : (should I use recursive calling)
|
d******a 发帖数: 238 | 27 it should be 8 times. how could you get 5 or 1?
【在 y*******n 的大作中提到】 : 谁给解释一下第7题,我编译了下,怎么每次输出的结果不一定啊。 : 或者 5个,或者1个,甚至有时更多。求高手指点。
|
b********n 发帖数: 609 | 28 he must misread the output since stdio is shared among child processes...
8 seems right to me.
【在 d******a 的大作中提到】 : it should be 8 times. how could you get 5 or 1?
|
d**e 发帖数: 6098 | 29 re...
为了灌水需要,在大家的答案上我加个解释 :p
int main(int argc, char *argv[])
{
fork(); // #1, p1
fork(); // #2, p2, f1_2
fork(); // #3, p3, f1_3, f1_2_3, f2_3
printf("abc\n");
return 0;
}
p1, p2, p3表示是最外面main的子进程
f1_2表示这个fork是fork1的子进程,编号为#2, 类似的是f1_3, f2_3
f1_2_3表示是fork1的子进程f1_2的子进程,编号为#3 ...
再加上外面的main的print,一共8个
【在 b********n 的大作中提到】 : he must misread the output since stdio is shared among child processes... : 8 seems right to me.
|
y*******n 发帖数: 129 | 30 Thanks.
I think i misread the output as I executed the program in linux terminal.
The terminal shell will also need to fork a child process to execute the
program. someetimes the return of that shell prompt is early than the last
printf, making it look like the output is a new input. one example i got.
$ ./fork_test
abc
abc
abc
abc
$ abc
abc
abc
abc
【在 d**e 的大作中提到】 : re... : 为了灌水需要,在大家的答案上我加个解释 :p : int main(int argc, char *argv[]) : { : fork(); // #1, p1 : fork(); // #2, p2, f1_2 : fork(); // #3, p3, f1_3, f1_2_3, f2_3 : printf("abc\n"); : return 0; : }
|
|
|
y********o 发帖数: 9263 | |
t*********n 发帖数: 278 | 32 1. new a vector, what is the size(),
what is answer for this one. Thanx.
【在 x****k 的大作中提到】 : 一家IB的Analytics developer的onsite,只记得部分题目,一些比较简单的题目就不 : 写了。括号后是我认为的答案或者提示。 : 1. write a iterative function to calculate fibonacci sequence : 2. what is the difference of Delete table and truncat table.(about sql & : database) : 3. what is ACID.(about sql or database) : 4. write a find() for BST, How to decide the element could not be found.(( : less than && No left child) || (large than && no right child)) : 5. how to reverse a link list using one point : (should I use recursive calling)
|