[关闭]
@smilence 2013-10-21T11:50:14.000000Z 字数 2336 阅读 4296

Apple Interview Questions for SDE position


Part.1 http://www.mitbbs.com/article_t/JobHunting/32488887.html

1.1.0 聊简历,为什么想来apple,为什么想来ios framework组,问了一些objective-c的概念

1.1.1 一个byte数里面有多少个1,要优化至constant time.

Solution:

  1. //Solution 1:
  2. int bitcount( byte n ){
  3. int count = 0;
  4. for( ; n != 0; n &= n - 1)
  5. count++;
  6. return count;
  7. }
  8. //Solution 2: use lookup table
  9. static int bits_in_byte [256] ;
  10. int bitcount ( byte n ) {
  11. return bits_in_char [n];
  12. // or you can use a lookup table of size 16, and split the byte into 2 halves
  13. }

1.1.2 测试一个api,这个api是用来播放一个audio的,参数只有一个audio类型

1.1.3 还有一个算法貌似是关于两个array的,不难

1.2.1 问objectivec的优点,和C++的区别,还有一些objective c的概念

1.2.2 我记得第二面基本就没有问什么算法和数据结构,问我五年之内的规划,问了问我的project

1.3.1 hashmap讨论了很久,问实现,问collision的各种处理方法,如何retrieve,让给出retrieve的算法

1.3.2 一个sorted的 char array,一次遍历找到哪个字符出现的次数最多


Part.2 http://www.mitbbs.com/article_t/JobHunting/31867639.html

2.1 大算法题 1道: DP/Trie/Hash/Sorting的组合; 例子: Num of coins for a target value

2.2 数Integer中1的个数
Answer: same as 1.1.1

2.3 Implement atoi()

2.4 Implement strstr()

2.5 两个绳子各1小时烧完, 测45分钟


Part.3 http://www.mitbbs.com/article_t/JobHunting/31684631.html

3.1 c++的多态有哪些实现方法。(继承,template specification,好像还有一个)

3.2 为啥用mutex(to avoid unstable states)


Part.4 http://www.mitbbs.com/article_t/JobHunting/32370749.html

4.1 实现一个C++里的map。

4.2 定义个float f=3.1. 为何屏幕上显示是3.0999999.

4.3 用hadoop实现一个sql的query。


Part.5 http://www.mitbbs.com/article_t/JobHunting/32315269.html

5.1 编程题很简单就是个回文字符串

5.2 怎样处理大量请求的问题,如果数据库handle不了怎么办


Part.6 http://www.mitbbs.com/article_t/JobHunting/32127625.html

6.1 Design and implement LRU Cache. ( 要求给出完整的实现代码,包括类的声明,变量的声明,初始化等的。)

6.2 2. The problem description is as follows:You are given a deck containing 313 cards. While holding the deck:

a. Take the top card off the deck and set it on the table
b. Take the next card off the top and put it on the bottom of the deck in your hand.
c. Continue steps 1 and 2 until all cards are on the table. This is a round.
d. Pick up the deck from the table and repeat steps 1-3 until the deck is in the original order.

Write a program to determine how many rounds it will take to put the deck back into the original order.


Part.7 http://www.mitbbs.com/article_t/JobHunting/32056883.html

面试职位: c++ server-side engineer Requirement: c++, python, hadoop, 数据库,large scale data process

7.1.1 c++ shared pointer用法和实现,python generator, yield, list comprehension,xrange, range区别,结构题对齐,编程 FIFO队列

7.1.2 hadoop相关,deamon进程有那些,循环有序数组查找,递归和非递归

7.1.3 电梯设计,调度算法

7.1.4 拓扑排序, 矩形相交,树的结点个数,位运算

7.1.5 map/reduce 程序,相当与sql(select count(*) from a where c='x');

7.1.6 位运算,将16个{00,01,10,11}变成一个32位整数,并解码。

7.1.7 几何题,求方块和圆弧的交集,expression tree设计,grep 电话号码

7.2 hadoop相关

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注