一亩三分地论坛

 找回密码
 获取更多干货,去instant注册!

扫码关注一亩三分地公众号
查看: 2377|回复: 20
收起左侧

Ditto Technology的OA(全选择题 基础知识)

[复制链接] |试试Instant~ |关注本帖
attractor 发表于 2015-10-9 06:22:10 | 显示全部楼层 |阅读模式

2015(10-12月) 码农类 硕士 全职@Ditto - 网上海投 - 在线笔试 |Failfresh grad应届毕业生

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看,没有帐号?获取更多干货,去instant注册!

x
申请的是一家三番小公司的research engineer的岗位,要求oa错三道以下,楼主提交以后发现自己错了6道,再仔细一看发现有两个题自己选项看错了。。。看来今天做oa不在状态。。。但是改正后还是错了四道,都不知道自己哪里错了,所以打算分享给大家 ,就当娱乐娱乐,大家一起看看基础知识。如果能指正的就再好不过了。


1) In an ordered array of size N, binary search finds an answer in 10 steps maximum. What is the max number of steps will the binary search need for an array of size 2 * N?
  • N
  • 20
  • N+1
  • 11
.鐣欏璁哄潧-涓浜-涓夊垎鍦
2) X is an integer drawn from a uniform distribution 1..7 (including 1 and 7). What is the probability that bit 1 of the binary representation of X is set? (Assume that the lowest bit has index 0).
  • 4/7
  • 1/7
  • 1/3
  • 1

3) A quick sort takes 10ms on average to sort an array of 1000 numbers. What would be the expected sorting time for 5000 numbers?
  • 50 ms
  • 62 ms
  • 32 ms
  • 308 ms

4) If P(A) = 0.3, P(B|A) = 0.4, P(B|not A) = 0.7, then P(B) is:
  • 0.28
  • 0.12
  • 0.61
  • 0.7

5) The first-order Taylor series expansion for (1 + x)^a around x=0 is:
  • 1 + x
  • a(1 + x)^(a-1)
  • 1 + ax
  • such expansion does not exist

6) How practically useful is an algorithm with the run time complexity of O(N^4)?
  • Not very useful because it gets slow even with moderately large input sequences
  • Very useful because its run time complexity is polynomial
  • Not very useful because it is NP-hard
  • Useful but only if N is larger than 1,000
. 1point3acres.com/bbs
7) If you use a breadth-first (expanding left to right) algorithm for printing all nodes of the following three.
A|\B C|  \D   EWhat your output would be? :
  • ABDCE
  • ABCDE
  • ACEDB
  • DEBCA

8) If X = 25 in the base 17, what is X in base 9?
  • 43
  • 38
  • 170
  • 17

9) You have a database of 950 photos of cats and 50 photos of dogs. You have a program that tells cats from dogs automatically. You run it using your database, and you see that it reports 6% error rate. Does the program work well?
  • Yes, because it gives me a correct answer in 94% of cases.
  • Yes, because the probability to encounter an image picturing a cat is the same as that of a dog, and the program is only mistaked in 6% of the cases.
  • No, because it performs worse than a guess based on the distribution of dog and cat images in the database.
  • No, because it should give a maximum error of 1%.

10) You have a bag with 5 different stones. You take stones out of the bag, one by one. If you change the order in which you take out stones, how many different ways are there to empty the bag?
  • 120
  • 3125
  • 25
  • 1

11) You have 1000 atoms of a radioactive material. 5% of the atoms decay every minute. How many atoms of the material you will still have after 10 minutes?
  • 950
  • 599
  • 100
  • 500

12) You have two threads that run in parallel, both executing the following code:
line1: if (counter == 10) return;line2: ++counter;where counter is a global variable initially set to 0. If you want to guarantee that both threads will execute return once the variable counter reaches 10, what synchronization strategy will you choose? :
  • No synchronization is necessary, both threads will return just fine.
  • Acquire a mutex before line1 and release it after line1.
  • Acquire a mutex after line1 and release it after line2.
  • Acquire a mutex before line1 and release it after line2.

13) You have the following C++ function.
void foo() { int a = 10; if (true) { int b = 20; } int c = 30; cout << &a << “ “ << &c << endl;}When you call it, it prints the following output:0x00000000abcabcab 0x00000000abcabcb3Assuming that type int takes 4 bytes in memory, what do you think the address of b will be? :
  • 0x00000000abcabcaf
  • 0x00000000abcabca7
  • 0x00000000abcabcb7
  • There is no address for b because it is allocated on the heap.

14) What will be an equivalent of the boolean expression A or (B or not C)?
  • not A and not B and C
  • not (A and B and not C)
  • not (not A and not B and C)
  • (not A and not B) and not C

15) What regular expression tests validity of a phone number that looks like this: +7 812 123-4567?
  • /+[0-9] [0-9]{3} [0-9]{3}-[0-9]{4}/
  • /\+[0-9] [0-9]{3} [0-9]{3}-[0-9]{4}/
  • /\+ [0-9]*{1,4}/
  • /\+[0-9] [0-9]+ [0-9]*-[0-9]*/. from: 1point3acres.com/bbs
.鏈枃鍘熷垱鑷1point3acres璁哄潧
16) Consider the following code for string concatenation.
def concat(s1, s2):    result = s1    for ch in s2:        result += ch    return resultHow efficient is it? :
  • Very efficient.
  • Not very efficient because it copies only one character per iteration.
  • Very inefficient because it frequently reallocates the contents of result.
  • Not very efficient because it is written in python.

17) Continue the following sequence of numbers: 18, 27, 38, 51, ....
  • 65
  • 66
  • 67
  • 68

18) Let's assume that you have to train a logistic regression model over relatively small dataset. How would you setup an experiment to find the best model parameters?
  • Split input dataset randomly into 3 parts, e.g.: 70% to train the model, 15% for model validation and 15% to test the model.
  • Use traditional k-fold cross-validation approach.
  • Since input dataset is small, we should use the whole dataset to train the model.
  • Split input dataset randomly into 2 parts: 90% for training the model and 10% for testing.

19) Consider we want to implement a naive matrix multiplication using c++: A * B = C. Let's use vector<vector<int>> to store matrices A, B and C. Size of the matrices is N * N, where N = 1000.
  // Variant A.  for (int i = 0; i < N; ++i) {    for (int j = 0; j < N; ++j) {      for (int k = 0; k < N; ++k) {        C[j] += A[k] * B[k][j];      }    }  }  // Variant B.  for (int i = 0; i < N; ++i) {    for (int j = 0; j < N; ++j) {      for (int k = 0; k < N; ++k) {        C[j] = C[j] + A[k] * B[k][j];      }    }  }  // Variant C.  for (int i = 0; i < N; ++i) {    for (int k = 0; k < N; ++k) {      for (int j = 0; j < N; ++j) {        C[j] = C[j] + A[k] * B[k][j];      }    }  }  // Variant D.  for (int j = 0; j < N; ++j) {    for (int k = 0; k < N; ++k) {      for (int i = 0; i < N; ++i) {        C[j] += A[k] * B[k][j];      }    }  }Which version of the code works faster? :
  • Variant A
  • Variant B
  • Variant C
  • Variant D

20) This quiz has 20 questions, with 4 answer choices each, and only one of the choices is right. What is the probability to get exactly 50% of the quiz right by selecting answers completely at random?
  • 0.00332
  • 0.0025
  • 0.025
  • 0.00992

-google 1point3acres

补充内容 (2015-10-9 06:25):
抱歉,我的答案好像没显示出来,下面是我做的答案:
D,A,B,C,A
A,A,A,C,A
B,D,A,C,B
C,B,D,D,D

补充内容 (2015-10-12 12:33):
由于概念不清,导致第五题做错了,正确答案应该是C,还有三道是错的。。。
chengluxi 发表于 2015-10-12 03:15:25 | 显示全部楼层
第二十题我怎么算也算不出答案,不知楼主是怎么做的? 鏉ユ簮涓浜.涓夊垎鍦拌鍧.
. 1point3acres.com/bbs
还有第八题,应该就是log(17) x = 25吧,那么就求9^x是多少呗,为什么我也算不出来答案呢?
回复 支持 反对

使用道具 举报

muancy 发表于 2015-10-12 03:42:18 | 显示全部楼层
chengluxi 发表于 2015-10-11 11:15
第二十题我怎么算也算不出答案,不知楼主是怎么做的?

还有第八题,应该就是log(17) x = 25吧,那么就求 ...

第八题应该是43吧,25(base17)应该不就是2 * 17 + 5 = 39(base 10)。. 涓浜-涓夊垎-鍦帮紝鐙鍙戝竷
39 = 4 * 9 + 3 = 43(base 9)

补充内容 (2015-10-11 12:18):
第二十,应该是C(20, 10) * 0.25^10 * 0.75 ^ 10
回复 支持 反对

使用道具 举报

yiliaobailiao 发表于 2015-10-12 10:34:38 | 显示全部楼层
第五题,为啥是A呢?
回复 支持 反对

使用道具 举报

 楼主| attractor 发表于 2015-10-12 12:28:50 | 显示全部楼层
yiliaobailiao 发表于 2015-10-12 10:34
第五题,为啥是A呢?

我网上查的泰勒展开的公式:f(x)|x=a ~ f(a) + f'(a)(x - a) + f''(a)(x - a)^2。哦,no,我知道了,我把first order可能理解错了,如果first order是f(a) + f'(a)(x - a),答案就是C了。。。我以为是f(a),所以选了A。嗯,可能这道题做得有点问题,谢谢提出疑问
回复 支持 反对

使用道具 举报

pk38555 发表于 2015-11-18 11:57:39 | 显示全部楼层
这是我遇到的题,18,19没有,剩下的是一样的
12) An HTML page can include links to CSS files and Javascript files. As a web browser loads a page, it also loads linked CSS and Javascript. A web browser can load multiple CSS at the same time, but it has to load Javascript files serially. Let's assume we have roundtrip latency between web browser and web server to be 200ms and download speed of 1000KBps. Let's also assume we have 3 CSS files 200KB each, and 2 Javascript files 100KB each. What is the best way to optimize the load time of the page?. 1point3acres.com/bbs
A          Move Javascript links over CSS links so that their download begins faster.
B          Concatenate all CSS files to avoid latency on multipe CSS requests.
C          Concatenate all Javascript files into one file to avoid latency on multipe Javascript requests.
D          None of the above.. Waral 鍗氬鏈夋洿澶氭枃绔,
.鏈枃鍘熷垱鑷1point3acres璁哄潧
19) A server needs to verify client session validity on every request. What would be your choice of architecture for such validation?
A          Since there is a network connection between the client and the server, no session validation is necessary.
B          Every request from the client includes a token issued by the server. The server keeps tokens for all active sessions in server memory. A session is valid if the server finds the token in the list of active tokens.. 鍥磋鎴戜滑@1point 3 acres
C          Every request from the client includes a token issued by the server. The server keeps tokens for all active sessions in the database. A session is valid if the server finds the token after querying the database.
D          Every request from the client includes a token issued earlier by the server. The token is encrypted by server, and contains an expiration date. A session is valid if the server finds that the token has not expired at the moment of validation.. 涓浜-涓夊垎-鍦帮紝鐙鍙戝竷

My answer: C, B

补充内容 (2015-11-18 12:01):
我拿90%
回复 支持 反对

使用道具 举报

Fireleg 发表于 2015-11-24 03:18:04 | 显示全部楼层
pk38555 发表于 2015-11-18 11:57
这是我遇到的题,18,19没有,剩下的是一样的 鏉ユ簮涓浜.涓夊垎鍦拌鍧.
12) An HTML page can include links to CSS files and Javas ...

层主面过了吗?
回复 支持 反对

使用道具 举报

pk38555 发表于 2015-11-24 08:21:42 | 显示全部楼层
刚刚面了,挂了
. from: 1point3acres.com/bbs 题目:
7瓶红酒,一瓶有毒,
有三个老鼠可以试毒,可以随便mix,怎么知道哪瓶有毒,三只老鼠必须同时试。只有一次机会
回复 支持 反对

使用道具 举报

巫山云似盖 发表于 2015-11-26 08:46:25 | 显示全部楼层
第三题怎么错了?是选B呀。
lz确定第12,18,19是对的吗?
. 涓浜-涓夊垎-鍦帮紝鐙鍙戝竷
补充内容 (2015-11-26 09:11):
第19题A和C是一维的array,不是matrix吗?
回复 支持 反对

使用道具 举报

巫山云似盖 发表于 2015-11-26 12:51:54 | 显示全部楼层
pk38555 发表于 2015-11-24 08:21
刚刚面了,挂了
题目:
7瓶红酒,一瓶有毒,

请问层主的电面是一个半小时吗?只有这道智力题吗?有没有编程?都有什么内容呢?
回复 支持 反对

使用道具 举报

 楼主| attractor 发表于 2015-11-26 15:45:29 | 显示全部楼层
巫山云似盖 发表于 2015-11-26 08:46
第三题怎么错了?是选B呀。
lz确定第12,18,19是对的吗?
. 涓浜-涓夊垎-鍦帮紝鐙鍙戝竷
哦,我的意思是我有三道是错的。第三题是选B,第12题我确定是对的,18题不确定,我那天做OA实在状态不好。19题也是要再斟酌以下,一个考点应该是a += b的运算要比a = a + b快,第二个考点就是矩阵的内存存储,怎样运算提高效率。还有我可能有一道bfs搞错成了dfs。具体大家做了再仔细看看。我投的是reseach engineer岗位,general的岗位18,19题应该其他人也有贴出
回复 支持 反对

使用道具 举报

xiyu.xie 发表于 2015-12-1 07:16:18 | 显示全部楼层
pk38555 发表于 2015-11-24 08:21
刚刚面了,挂了. 涓浜-涓夊垎-鍦帮紝鐙鍙戝竷
题目:
7瓶红酒,一瓶有毒,
.鏈枃鍘熷垱鑷1point3acres璁哄潧
跪求分享啊!层主好人。offer滚滚来
回复 支持 反对

使用道具 举报

pk38555 发表于 2015-12-5 01:16:45 | 显示全部楼层
巫山云似盖 发表于 2015-11-26 12:51
请问层主的电面是一个半小时吗?只有这道智力题吗?有没有编程?都有什么内容呢?
. 涓浜-涓夊垎-鍦帮紝鐙鍙戝竷
是一个小时,就问了这一题,还没得上来,然后就没有然后了,祝大家好运
回复 支持 反对

使用道具 举报

wingschains 发表于 2015-12-5 06:08:48 | 显示全部楼层
觉得19题貌似是跟c的Row-major order这个性质有关。我觉得是A,不知道对不对,因为在同一个row的elements的memory是continuous的。
回复 支持 反对

使用道具 举报

wingschains 发表于 2015-12-5 06:09:50 | 显示全部楼层
18题觉着是B。因为data size小的时候用cross-validation比较好。
回复 支持 反对

使用道具 举报

墨墨 发表于 2015-12-12 02:21:17 | 显示全部楼层
巫山云似盖 发表于 2015-11-26 12:51
请问层主的电面是一个半小时吗?只有这道智力题吗?有没有编程?都有什么内容呢?
. 1point3acres.com/bbs
问一下,你是面了这个公司吗~~~是的话求面经呀~~~
回复 支持 反对

使用道具 举报

墨墨 发表于 2015-12-12 02:21:56 | 显示全部楼层
pk38555 发表于 2015-11-24 08:21
刚刚面了,挂了
题目:
7瓶红酒,一瓶有毒,

有木有告诉你正确答案呢。。
回复 支持 反对

使用道具 举报

kazi16 发表于 2016-3-4 06:03:03 | 显示全部楼层
muancy 发表于 2015-10-12 03:42
第八题应该是43吧,25(base17)应该不就是2 * 17 + 5 = 39(base 10)。
39 = 4 * 9 + 3 = 43( ...

第二十,
http://math.stackexchange.com/qu ... ment-of-binary-bits
. 鐣欏鐢宠璁哄潧-涓浜╀笁鍒嗗湴(20! / (10! * 10!)) * 3/4^10 * 1/4^10,
D is correct.
回复 支持 反对

使用道具 举报

kazi16 发表于 2016-3-4 09:18:38 | 显示全部楼层
for software engineer

test.html.pdf

63.91 KB, 下载次数: 1, 下载积分: 大米 -1 升

回复 支持 反对

使用道具 举报

kazi16 发表于 2016-3-10 10:16:20 | 显示全部楼层
7瓶红酒,一瓶有毒,
有三个老鼠可以试毒,可以随便mix,怎么知道哪瓶有毒,三只老鼠必须同时试。只有一次机会

answer: binary, 2^3 = 8
回复 支持 反对

使用道具 举报

本版积分规则

请点这里访问我们的新网站:一亩三分地Instant.

Instant搜索更强大,不扣积分,内容组织的更好更整洁!目前仍在beta版本,努力完善中!反馈请点这里

关闭

一亩三分地推荐上一条 /5 下一条

手机版|小黑屋|一亩三分地论坛声明 ( 沪ICP备11015994号 )

custom counter

GMT+8, 2016-12-10 05:59

Powered by Discuz! X3

© 2001-2013 Comsenz Inc. Design By HUXTeam

快速回复 返回顶部 返回列表