剑客
关注科技互联网

硅谷互联网公司直播笔记

1. Overview of US interview

– Structure

– Categories

– behavioral + algorithm + system design + experience

2. Resume first

– US Style

– Programming & coding signal

– Github project starts/followers/ ACM Topcoder/ w / reward /

3. Phone interviews & Behavioral questions

4. Algorithm & System design

– 面试总结: 一亩三分地

1. Validate the arguments &

2. think about the scale issue

3. Think about all the solutions.

a+b+c=0 => a+b=-c

1. 枚举2元素,然后查找-c, binary search

2.枚举2元素,然后查找-c, hash

3. sort, 枚举1元素, 两边夹逼

int threesum(int[] a) {

// validate arguments

// logic code

// post-process

}

2. Fibonacci

1, 1, 2, 3, 5, 8, 13, 21, 34

// n = 3, => 2, n =6 => 8

1. Fib(n) = Fib(n-1) + Fib(n-2)

2. range problem

3. possible solutions

– Recursive , O(2^n), O(1)

– Iterative way, O(n), O(1)

– Matrix multiplication O(logN), O(1)

y = x^k, logk

1. x*x*x*…*x; divide & conquer

2. k < 0, k. double

3. possible solutions

– divide & conquer, recursive

exp(k/2),

if (k even): return exp(k/2)* exp(k/2)’

else: return exp(k/2)* exp(k/2) * x;

– binary bits, iterative

/**

*

*/

public double exp(int x, int k) {

if (k == 0 && x == 0) throw new IllegalArgumentException();

if (k == 0) return 1;

if (k < 0) return 1.0 / exp(x, -k);

double tmp = exp(x, k / 2);

return k % 2 == 1

? tmp * tmp * x

: tmp * tmp;

}

int getFib(int n) {

// validate the arguments

if (n <= 0)

throw exception // interviewer

int x, y, z

a[1] = a[2] = 1;

for i = 3 -> n {

a[i] = a[i-1] + a[i-2];

}

return a[n];

}

System design & 更加细节的面试培训教程


BitTiger

5. Q&A

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址