v******a 发帖数: 54 | 1 1. online
做过一边题型就知道了
careercup上有一些online test的题目
2. phone
忘记了,主要是c++的,careercup上和本版上有
3. onsite
a. 两个engineer,一个黑人,一个亚裔(还挺帮忙的)
黑人出了2个题目
1. reverse a int number given a int number
int reverseint(int);
[a. overflow, b. negative number]
2. given a list of scores of students, get the frequence of scores in order.
[use c++ container map]
亚裔
1.difference between assignment operator and copy constructor
2. how to use map, map.find,
3. difference between i++, ++i, which one is more efficient.
Manager
1. Given two sorted integer array, how to find the intersection.
what is best comparision number and worst comparison number.
HR:
common questions | c***2 发帖数: 838 | 2 "Given two sorted integer array, how to find the intersection.
what is best comparision number and worst comparison number."
1) No intersect O(1)
AAAAAAAAABBBBBBBBBBBB or BBBBBBBBBAAAAAAAAAAAA
2) Then Binary search for either case: O(logN)
AAAAAAAAAAAA
BBBBBBBBBBBBB
====K==
or
AAAAAAAAAAA
BBBBBBBBBBB
=K==
3) Then binary search overlapping part K*LogK
So
Best O(1)
Worst nlogn | y*******o 发帖数: 6632 | 3 1. reverse a int number given a int number
int reverseint(int);
how to solve this problem? 300 to 3? 3000 also to 3?
if 10>a>-10 then return a?
Thanks.
【在 v******a 的大作中提到】 : 1. online : 做过一边题型就知道了 : careercup上有一些online test的题目 : 2. phone : 忘记了,主要是c++的,careercup上和本版上有 : 3. onsite : a. 两个engineer,一个黑人,一个亚裔(还挺帮忙的) : 黑人出了2个题目 : 1. reverse a int number given a int number : int reverseint(int);
| d******a 发帖数: 238 | 4 reverse a int number given a int number
how do you determine overflow(see the leftmost bit or compare with INT_MAX)?
if overflowed, what should we do? just give the error message?
. Given two sorted integer array, how to find the intersection.
what is best comparision number and worst comparison number.
best: length of the shorter array ?
worst: O(m + n) ? |
|