去Google工作!
这个是Steve(据王垠说是Google的一个小头目,我在“来点互动”那篇文章里面也写了他推荐的一些书,见该文的回复)写的怎么样去Google谋职,里面有不少实在的建议,给我了不少启发。我这里还摘录他的“技术准备”部分,附上自己的注释和想法,学过算法和数据结构的话扫一遍就可以了。
原文里面还有一个很有意思的技巧,那就是带上白板去面试,除了Steve说的那些好处外,这个肯定会让你独树一帜的!再有就是大家都会忽略的:模拟面试。
原文地址:
感谢王垠的推荐。
我就拷贝了正文的一部分,感兴趣的童鞋请阅读原文吧,文章开始的风格很有意思!
——我会掺杂一些简单翻译和自己的思路,就当作点注释:)不过我不保证和原文的思想保持一致,绝对不保证!因为——我会用我自己的风格来注释,我将会揉合原汁原味的时间伙伴风格进去!
Tech Prep Tips
//嗯,最简单以及直接的秘诀还是去读个该死的计算机学位
The best tip is: go get a computer science degree. The more computer
science you have, the better. You don't have to have a CS degree, but
it helps. It doesn't have to be an advanced degree, but that helps
too.
science you have, the better. You don't have to have a CS degree, but
it helps. It doesn't have to be an advanced degree, but that helps
too.
//对对对,从现在才打算去搞个学位证,读出来胡子都白了,于是Steve就给了一些捷径,当然以及毫无疑问地...他们都围绕了算法和数据结构————毕竟Google不打算招募一群代码工人,and,我绝对没有鄙视worker的意思 - -!
However, you're probably thinking of applying to Google a little
sooner than 2 to 8 years from now, so here are some shorter-term tips
for you.
sooner than 2 to 8 years from now, so here are some shorter-term tips
for you.
//好了以下开始进入正题,首先登场的自然是我们的大O...
Algorithm Complexity(算法复杂度): you need to know Big-O. It's a must. If you
struggle with basic big-O complexity analysis, then you are almost
guaranteed not to get hired. It's, like, one chapter in the beginning
of one theory of computation book, so just go read it. You can do it.
struggle with basic big-O complexity analysis, then you are almost
guaranteed not to get hired. It's, like, one chapter in the beginning
of one theory of computation book, so just go read it. You can do it.
//这些口水细节我真的懒得翻译了,如果你真的想补下课,就去找点书来好好读读,做点习题吧;如果你是刚入门,就去读那本数据结构与算法分析(C语言描述),强烈建议你读C语言描述的而不是C++描述的。因为那样会让你的大脑运转得更多。作者在后面对算法设计也推荐了一本书,请留意;还有就是那本经典入门:算法导论,里面除了算法,还讲了很多东西,比如基本和高级的数据结构,相关的数学知识,多是离散数学的,还有就是一些复杂问题,比如NP等等,你可以选读一下,关于这门课在MIT的开放课上有很详细的指导,具体细节请参看我的自学补完:http://uneeda.blog.51cto.com/289042/61691,虽说是“我的自学系统”,但实际上里面给了不少实际的建议,这些建议应该会是和大多数人的。
Sorting(排序): know how to sort. Don't do bubble-sort. You should know the
details of at least one n*log(n) sorting algorithm, preferably two
(say, quicksort and merge sort). Merge sort can be highly useful in
situations where quicksort is impractical, so take a look at it.
details of at least one n*log(n) sorting algorithm, preferably two
(say, quicksort and merge sort). Merge sort can be highly useful in
situations where quicksort is impractical, so take a look at it.
For God's sake, don't try sorting a linked list during the interview.
两个最常用的,合并排序和快速排序,他建议我们多掌握一些n*log(n) 的排序算法
Hashtables:(哈希表) hashtables are arguably the single most important data
structure known to mankind. You absolutely have to know how they work.
Again, it's like one chapter in one data structures book, so just go
read about them. You should be able to implement one using only arrays
in your favorite language, in about the space of one interview.
structure known to mankind. You absolutely have to know how they work.
Again, it's like one chapter in one data structures book, so just go
read about them. You should be able to implement one using only arrays
in your favorite language, in about the space of one interview.
掌握哈希表(散列表/函数)同样是项基本功。我们应该要能够去应用它才行,不管你要用什么语言,请学会使用它。
Trees(树啊...树): you should know about trees. I'm tellin' ya: this is basic
stuff, and it's embarrassing to bring it up, but some of you out there
don't know basic tree construction, traversal and manipulation
algorithms. You should be familiar with binary trees, n-ary trees, and
trie-trees at the very very least. Trees are probably the best source
of practice problems for your long-term warmup exercises.
stuff, and it's embarrassing to bring it up, but some of you out there
don't know basic tree construction, traversal and manipulation
algorithms. You should be familiar with binary trees, n-ary trees, and
trie-trees at the very very least. Trees are probably the best source
of practice problems for your long-term warmup exercises.
You should be familiar with at least one flavor of balanced binary
tree, whether it's a red/black tree, a splay tree or an AVL tree. You
should actually know how it's implemented.
tree, whether it's a red/black tree, a splay tree or an AVL tree. You
should actually know how it's implemented.
You should know about tree traversal algorithms: BFS and DFS, and know
the difference between inorder, postorder and preorder.
the difference between inorder, postorder and preorder.
You might not use trees much day-to-day, but if so, it's because
you're avoiding tree problems. You won't need to do that anymore once
you know how they work. Study up!
you're avoiding tree problems. You won't need to do that anymore once
you know how they work. Study up!
你总得知道数的一些基本知识吧,遍历,操作和应用,树在实践中是很常用的,大家必须要熟练掌握,噢,他说我们要做好长期热身练习...呵呵!
在最让人郁闷的情况下,你都得掌握二叉树,N元树,二叉查找树,伸展树;
其余时候(嘿嘿!),要熟练至少一种均衡二分树,不管它是一个红黑树, splay树或AVL树。你要真正懂得这类高级数据结构的实现。
还有就是遍历算法啦:深度优先和广度优先是最基础的啦!还要会区别中序,后序,先序和层序。
Graphs(图图图图图图)
Graphs are, like, really really important. More than you think. Even
if you already think they're important, it's probably more than you
think.
if you already think they're important, it's probably more than you
think.
There are three basic ways to represent a graph in memory (objects and
pointers, matrix, and adjacency list), and you should familiarize
yourself with each representation and its pros and cons.
pointers, matrix, and adjacency list), and you should familiarize
yourself with each representation and its pros and cons.
You should know the basic graph traversal algorithms: breadth-first
search and depth-first search. You should know their computational
complexity, their tradeoffs, and how to implement them in real code.
search and depth-first search. You should know their computational
complexity, their tradeoffs, and how to implement them in real code.
You should try to study up on fancier algorithms, such as Dijkstra and
A*, if you get a chance. They're really great for just about anything,
from game programming to distributed computing to you name it. You
should know them.
A*, if you get a chance. They're really great for just about anything,
from game programming to distributed computing to you name it. You
should know them.
Whenever someone gives you a problem, think graphs. They are the most
fundamental and flexible way of representing any kind of a
relationship, so it's about a 50-50 shot that any interesting design
problem has a graph involved in it. Make absolutely sure you can't
think of a way to solve it using graphs before moving on to other
solution types. This tip is important!
fundamental and flexible way of representing any kind of a
relationship, so it's about a 50-50 shot that any interesting design
problem has a graph involved in it. Make absolutely sure you can't
think of a way to solve it using graphs before moving on to other
solution types. This tip is important!
图的重要超过了我们的想象!
首先你要知道他的不同表示法,就是邻接表和矩阵那些...
r然后你应该知道的基本图遍历算法:广度优先搜索和深度优先搜索。还有他们的复杂度,tradeoffs(权衡?哈哈我不知道这个是讲的啥...请大家指正一下!),以及如何具体实现,代码级别的。
有时间再研究下fancier algorithms(该死...花式算法,不知道做何解,仿佛只可意会呐),如Dijkstra的和A *,因为你可能会有机会接触到分布式计算
Other data structures(其他数据结构)
You should study up on as many other data structures and algorithms as
you can fit in that big noggin of yours. You should especially know
about the most famous classes of NP-complete problems, such as
traveling salesman and the knapsack problem, and be able to recognize
them when an interviewer asks you them in disguise.
you can fit in that big noggin of yours. You should especially know
about the most famous classes of NP-complete problems, such as
traveling salesman and the knapsack problem, and be able to recognize
them when an interviewer asks you them in disguise.
You should find out what NP-complete means.
Basically, hit that data structures book hard, and try to retain as
much of it as you can, and you can't go wrong.
much of it as you can, and you can't go wrong.
这个就是一些研究问题,比如NP完全问题,一些典型就是旅行商问题和背包问题了。
Math(数学)
Some interviewers ask basic discrete math questions. This is more
prevalent at Google than at other places I've been, and I consider it
a Good Thing, even though I'm not particularly good at discrete math.
We're surrounded by counting problems, probability problems, and other
Discrete Math 101 situations, and those innumerate among us blithely
hack around them without knowing what we're doing.
prevalent at Google than at other places I've been, and I consider it
a Good Thing, even though I'm not particularly good at discrete math.
We're surrounded by counting problems, probability problems, and other
Discrete Math 101 situations, and those innumerate among us blithely
hack around them without knowing what we're doing.
Don't get mad if the interviewer asks math questions. Do your best.
Your best will be a heck of a lot better if you spend some time before
the interview refreshing your memory on (or teaching yourself) the
essentials of combinatorics and probability. You should be familiar
with n-choose-k problems and their ilk – the more the better.
Your best will be a heck of a lot better if you spend some time before
the interview refreshing your memory on (or teaching yourself) the
essentials of combinatorics and probability. You should be familiar
with n-choose-k problems and their ilk – the more the better.
I know, I know, you're short on time. But this tip can really help
make the difference between a "we're not sure" and a "let's hire her".
And it's actually not all that bad – discrete math doesn't use much of
the high-school math you studied and forgot. It starts back with
elementary-school math and builds up from there, so you can probably
pick up what you need for interviews in a couple of days of intense
study.
make the difference between a "we're not sure" and a "let's hire her".
And it's actually not all that bad – discrete math doesn't use much of
the high-school math you studied and forgot. It starts back with
elementary-school math and builds up from there, so you can probably
pick up what you need for interviews in a couple of days of intense
study.
Sadly, I don't have a good recommendation for a Discrete Math book, so
if you do, please mention it in the comments. Thanks.
if you do, please mention it in the comments. Thanks.
这个不讲多了,主要就是要求一些基本的离散数学能力,如计数和概率,在《算法导论》第八部分会让你做一些回顾的。顺带推荐,也是再再再再强调的,SICP(计算机程序的构造与解释)!
Operating Systems
This is just a plug, from me, for you to know about processes, threads
and concurrency issues. A lot of interviewers ask about that stuff,
and it's pretty fundamental, so you should know it. Know about locks
and mutexes and semaphores and monitors and how they work. Know about
deadlock and livelock and how to avoid them. Know what resources a
processes needs, and a thread needs, and how context switching works,
and how it's initiated by the operating system and underlying
hardware. Know a little about scheduling. The world is rapidly moving
towards multi-core, and you'll be a dinosaur in a real hurry if you
don't understand the fundamentals of "modern" (which is to say, "kinda
broken") concurrency constructs.
and concurrency issues. A lot of interviewers ask about that stuff,
and it's pretty fundamental, so you should know it. Know about locks
and mutexes and semaphores and monitors and how they work. Know about
deadlock and livelock and how to avoid them. Know what resources a
processes needs, and a thread needs, and how context switching works,
and how it's initiated by the operating system and underlying
hardware. Know a little about scheduling. The world is rapidly moving
towards multi-core, and you'll be a dinosaur in a real hurry if you
don't understand the fundamentals of "modern" (which is to say, "kinda
broken") concurrency constructs.
The best, most practical book I've ever personally read on the subject
is Doug Lea's Concurrent Programming in Java. It got me the most bang
per page. There are obviously lots of other books on concurrency. I'd
avoid the academic ones and focus on the practical stuff, since it's
most likely to get asked in interviews.
is Doug Lea's Concurrent Programming in Java. It got me the most bang
per page. There are obviously lots of other books on concurrency. I'd
avoid the academic ones and focus on the practical stuff, since it's
most likely to get asked in interviews.
这个也不多说了,就是进程,线程和并发问题。因为我们正走入多核时代,然后他介绍了一本书,Concurrent Programming in Java ,即.Concurrent Programming in Java ,Doug Lea
Java 并发编程:设计原则与模式
http://www.douban.com/subject/1244021/
Java 并发编程:设计原则与模式
http://www.douban.com/subject/1244021/
这方面的研究,我想除了看Linux内核以外,还应该关注集群,包括Google的一些实现,比如他的GFS,MapReduce和BigTable等,当然研究beowulf集群的同时,还可以看看skeletion(MapReduce就运用了其中最简单一种实现),当然要是对学术感兴趣的话你可以对skeletion深入下去,给个老巢,http://homepages.inf.ed.ac.uk/mic/Skeletons/ ,这里不再深入,因为这超出了这篇文章讲的范围,以后有时间我会撰写相关的文章的。我的最后一点建议是,看看Hadoop! 以上,请自己Google一下!
Coding
You should know at least one programming language really well, and it
should preferably be C++ or Java. C# is OK too, since it's pretty
similar to Java. You will be expected to write some code in at least
some of your interviews. You will be expected to know a fair amount of
detail about your favorite programming language.
should preferably be C++ or Java. C# is OK too, since it's pretty
similar to Java. You will be expected to write some code in at least
some of your interviews. You will be expected to know a fair amount of
detail about your favorite programming language.
这个地方真是郁闷,讲的这么少,我就自己讲一下吧,coding的时候请注意一些技巧的掌握,比如递归转迭代,这些都是很有用的东西,在面试的时候会对你的编程习惯和技巧做一个考察,还有一些基本能力,比如指针和内存管理,当然如果你只学Java的话,你就得错过这些美妙的东西了,虽然他们宣称垃圾回收机制把你解放了,但实际上Java这类语言有时候也把我们的能力给“封装”起来了,在你真正进入要求效率工程界之前,还是请你熟练掌握他们!至少它们会让你的头脑保持灵活并熟悉一些底层的操作.同时请学习一些函数式语言(比如Lisp),他们真的很有用,请相信我!
Other Stuff
Because of the rules I outlined above, it's still possible that you'll
get Interviewer A, and none of the stuff you've studied from these
tips will be directly useful (except being warmed up.) If so, just do
your best. Worst case, you can always come back in 6-12 months, right?
Might seem like a long time, but I assure you it will go by in a
flash.
get Interviewer A, and none of the stuff you've studied from these
tips will be directly useful (except being warmed up.) If so, just do
your best. Worst case, you can always come back in 6-12 months, right?
Might seem like a long time, but I assure you it will go by in a
flash.
The stuff I've covered is actually mostly red-flags: stuff that really
worries people if you don't know it. The discrete math is potentially
optional, but somewhat risky if you don't know the first thing about
it. Everything else I've mentioned you should know cold, and then
you'll at least be prepped for the baseline interview level. It could
be a lot harder than that, depending on the interviewer, or it could
be easy.
worries people if you don't know it. The discrete math is potentially
optional, but somewhat risky if you don't know the first thing about
it. Everything else I've mentioned you should know cold, and then
you'll at least be prepped for the baseline interview level. It could
be a lot harder than that, depending on the interviewer, or it could
be easy.