【转载】非常棒的算法面试类资源汇总

今天看到了这篇文章,非常非常棒:http://blog.csdn.net/nedushy123/article/details/23827361

 

把内容转载如下,以作收藏:

 

经典算法面试题一览

 

1. 自然就是careercup (类似的网站还有glassdoor

careercup不难,参考二爷划的重点,早早开始做,即使先开始做前几章简单的。一亩三分地经常有刷题活动

Cracking the Coding Interview v5  8.9/88

image    

 

2. leetcode的题稍难一些,不过很有趣,可以参考这份难度系数表刷题(文末有附),还有一个tips,这哥们儿刷题代码都放在github上了,可以参考下

   google code jam google面可以做做

   interviewstreet

   codility 手把手教你做面试题

 

3. 推荐 Coding interview exposed (3ed) 这个最简单了,基础比较挫的可以从这里开始

这本书籍不是“课本”,不是“课程”,而是教你做各种常见面试题目的。熟练掌握这本书籍的内容,是你找到工作的基础。

Programming Interviews Exposed 8.0/60 | 程序员面试攻略 7.7/86

image   s2833948

 

4. 中文资料系统学习

编程之美 8.3/2289

image

剑指Offer:名企面试官精讲典型编程题 何海涛的博客

剑指offer 8.3/159

image

结构之法 算法之道 July的博客

 

中文在线编程系统:

九度Online Judge (基于《剑指Offer》)

ITint5也不错

英雄会,在线编程挑战平台,时而会有奖品

 

5.攻略

一亩三分地 留美招工Tips Warald 

mitbbs的JobHunting版(需FQ)

大牛制定的MIT算法导论公开课学习计划,配套精选的ACM题

网易云课堂出了求职自救战

 

6.资讯

水木Intern版

 

7.语言

Python面试题集合

 

8.其他书籍

编程珠玑 9.2/1215

image

The Google Resume 8.2/38 | 金领简历 8.2/20

image   image

This Is What A GOOD Resume Should Look Like

大话数据结构 8.1/336

image

大话设计模式 8.3/1139

image

鸟哥的Linux私房菜.基础学习篇  9.1/1097

image

UNIX环境高级编程 9.4/1531

image

UNIX编程艺术 9.1/1651

image

人人都有好工作 7.9/45

image

谁是谷歌想要的人才 7.4/195

image

浪潮之巅 9.1/10221

image

黑客与画家 8.8/7032

image

暗时间 8.5/4871

image

程序员面试宝典 6.1/118(很多错误)

image

 

参考:

http://www.1point3acres.com/bbs/thread-50411-1-1.html

http://www.zzsec.org/tags.html#leetcode-ref

 

附:

leetcode Questions

IdQuestionDifficultyFreqencyData StructuresAlgorithms
1Two Sum25array, setsort, two pointers
8String to Integer (atoi)25stringmath
20Valid Parentheses25stringstack
21Merge Two Sorted Lists25linked listsort, two pointers, merge
65Valid Number25stringmath
70Climbing Stairs25 dp
88Merge Sorted Array25arraytwo pointers, merge
125Valid Palindrome25stringtwo pointers
153Sum35arraytwo pointers
50Pow(x, n)35 binary search, math
73Set Matrix Zeroes35array 
98Validate Binary Search Tree35treedfs
127Word Ladder35graphbfs, shortest path
28Implement strStr()45stringtwo pointers, KMP, rolling hash
56Merge Intervals45array, linked list, red-black treesort, merge
57Insert Interval45array, linked list, red-black treesort, merge
27Remove Element14arraytwo pointers
13Roman to Integer24 math
24Swap Nodes in Pairs24linked list 
67Add Binary24stringtwo pointers, math
129Sum Root to Leaf Numbers24treedfs
2Add Two Numbers34linked listtwo pointers, math
12Integer to Roman34 math
22Generate Parentheses34stringdfs
23Merge k Sorted Lists34linked list, heapsort, two pointers, merge
46Permutations34arraypermutation
49Anagrams34string, hashtable 
77Combinations34 combination
78Subsets34arrayrecursion, combination
79Word Search34arraydfs
91Decode Ways34stringrecursion, dp
102Binary Tree Level Order Traversal34treebfs
131Palindrome Partitioning34stringdfs
69Sqrt(x)44 binary search
26Remove Duplicates from Sorted Array13arraytwo pointers
83Remove Duplicates from Sorted List13linked list 
112Path Sum13treedfs
7Reverse Integer23 math
19Remove Nth Node From End of List23linked listtwo pointers
62Unique Paths23arraydp
108Convert Sorted Array to Binary Search Tree23treedfs
17Letter Combinations of a Phone Number33stringdfs
39Combination Sum33arraycombination
53Maximum Subarray33arraydp
63Unique Paths II33arraydp
64Minimum Path Sum33arraydp
74Search a 2D Matrix33arraybinary search
82Remove Duplicates from Sorted List II33linked listrecursion, two pointers
86Partition List33linked listtwo pointers
93Restore IP Addresses33stringdfs
105Construct Binary Tree from Preorder and Inorder Tr33array, treedfs
106Construct Binary Tree from Inorder and Postorder T33array, treedfs
114Flatten Binary Tree to Linked List33treerecursion, stack
116Populating Next Right Pointers in Each Node33treedfs
29Divide Two Integers43 binary search, math
33Search in Rotated Sorted Array43arraybinary search
34Search for a Range43arraybinary search
43Multiply Strings43stringtwo pointers
51N-Queens43arraydfs
52N-Queens II43arraydfs
72Edit Distance43stringdp
94Binary Tree Inorder Traversal43tree, hashtablerecursion, morris, stack
103Binary Tree Zigzag Level Order Traversal43queue, treebfs, stack
109Convert Sorted List to Binary Search Tree43linked listrecursion, two pointers
128Longest Consecutive Sequence43array 
130Surrounded Regions43arraybfs, dfs
132Palindrome Partitioning II43stringdp
4Median of Two Sorted Arrays53arraybinary search
10Regular Expression Matching53stringrecursion, dp
44Wildcard Matching53stringrecursion, dp, greedy
81Search in Rotated Sorted Array II53arraybinary search
66Plus One12arraymath
101Symmetric Tree12treedfs
110Balanced Binary Tree12treedfs
9Palindrome Number22 math
35Search Insert Position22array 
36Valid Sudoku22array 
38Count and Say22stringtwo pointers
80Remove Duplicates from Sorted Array II22arraytwo pointers
113Path Sum II22treedfs
3Longest Substring Without Repeating Characters32string, hashtabletwo pointers
11Container With Most Water32arraytwo pointers
184Sum32array 
55Jump Game32array 
59Spiral Matrix II32array 
61Rotate List32linked listtwo pointers
92Reverse Linked List II32linked listtwo pointers
5Longest Palindromic Substring42string 
25Reverse Nodes in k-Group42linked listrecursion, two pointers
37Sudoku Solver42arraydfs
40Combination Sum II42arraycombination
42Trapping Rain Water42arraytwo pointers, stack
45Jump Game II42array 
47Permutations II42arraypermutation
48Rotate Image42array 
54Spiral Matrix42array 
68Text Justification42string 
75Sort Colors42arraysort, two pointers
76Minimum Window Substring42stringtwo pointers
89Gray Code42 combination
90Subsets II42arrayrecursion, combination
99Recover Binary Search Tree42treedfs
115Distinct Subsequences42stringdp
117Populating Next Right Pointers in Each Node II42treedfs
124Binary Tree Maximum Path Sum42treedfs
31Next Permutation52arraypermutation
41First Missing Positive52arraysort
84Largest Rectangle in Histogram52arraystack
87Scramble String52stringrecursion, dp
97Interleaving String52stringrecursion, dp
58Length of Last Word11string 
100Same Tree11treedfs
104Maximum Depth of Binary Tree11treedfs
111Minimum Depth of Binary Tree11treedfs
126Word Ladder II11  
14Longest Common Prefix21string 
118Pascal's Triangle21array 
119Pascal's Triangle II21array 
121Best Time to Buy and Sell Stock21arraydp
6ZigZag Conversion31string 
163Sum Closest31arraytwo pointers
30Substring with Concatenation of All Words31stringtwo pointers
71Simplify Path31stringstack
96Unique Binary Search Trees31treedp
107Binary Tree Level Order Traversal II31treebfs
120Triangle31arraydp
122Best Time to Buy and Sell Stock II31arraygreedy
32Longest Valid Parentheses41stringdp
95Unique Binary Search Trees II41treedp, dfs
123Best Time to Buy and Sell Stock III41arraydp
60Permutation Sequence51 permutation, math
85Maximal Rectangle51arraydp, stack

很可惜二爷不再更新了,未名上Jc2013补充了一点新题

1. Clone Graph-> BFS+HashMap
2. Gas Station->DP
3. Candy->Two Pointers
4. Single Number-> Xor, HashMap, or Sum or Product way to find
5. Single Number II -> Xor, HashMap
6. Copy List with Random Pointers -> Two Pointers, HashMap with two times 
traverse(like clone graph)
7. List Cycle, List Cycle II, Reorder List-> Two Pointers
8. Binary Tree Preorder, Postorder recursive -> Using stack to mock 
recursive way, or implement like morris way.
9. LRU Cache-> HashMap + list 
10. Insertion sort list -> Two Pointers
11. Sort List-> I implement merge sort, still, two pointers method, 
combination of merge sort list and split
list
12. Word Break -> DFS DP
13. Word Break II -> DP + Backtracking

 

二爷的Careercup 150总结

很多人都说把这150题做了一遍或几遍,但是我感觉算法题才是重点,其他的很多题面 
试基本碰不上,没看出来有必要全做。这里总结一下自己认为重要的题。 

第一章 : 
全部重要 (1.6, 1.7 Leetcode上有)。 
1.5 面A碰到 (string compression) 
1.7面Z碰到 (set 0) 
1.8面Bigfish碰到 (string rotation) 

第二章 (2.4, 2.5 Leetcode上有): 
全部重要。 
2.2面Bigfish碰到 (find kth) 

第三章 : 
感觉就是3.2 (min stack), 3.5 (two stack queue) 重要。两道题面M被问到过。3.6 
(sort stack)感觉也有可能被考到。 

第四章 (4.1, 4.3, 4.5 Leetcode上有): 
感觉4.2, 4.3, 4.5,4.6, 4.7 重要。4.5 (valid BST)面E,Q碰到过 

第五章:5.4 (n & (n-1)) 

第六章:6.5 (drop egg) 

第七章:7.3 (line intersection),7.6 (line passes most points) 

第八章:8.4 (parking lot), 8.10 (hashtable) 

第九章 (9.1, 9.2, 9.5, 9.6,9.8,9.9 Leetcode上有): 
感觉都重要 (9.10 (stack of boxes), 9.11 (boolean expression) 貌似可以忽略 
)。 

第十章(10.1, 10.2, 10.3 Leetcode上有): 
10.1 (merge) M碰到过两次 
10.3 
10.4 (external sort) E碰到 
10.6 

第十七章(17.8, 17.12, 17.13 Leetcode上有): 
17.1 (swap number) 
17.2 (tic-tac-toe) 面I遇到过 
17.7 (integer->english) 
17.8 (largest sum) 经典, 注意变形题 (largest product), 面RF碰到过 
17.9 (frequency of occurrences) S碰到 
17.11 (rand7) 
17.12 (2 sum) G碰到 
17.13 (BT -> Linkedlist) 

第十八章(9): 
18.2 (shuffle deck) 貌似经典 
18.3 (random) 
18.4 (count 2s) 注意思路,可能会出现类似题 
18.5 (shortest distance) 
18.6 (quick select) 面Z, G碰到类似题 
18.9-18.12 

一共50道题。其他很多题可以做练习,但是面试碰到的概率不大。上边一些题面试也很 
难碰到但是是不可不练的题,比如八皇后。另外就是别完全follow书上的答案,注意看 
有没有bug。希望大家能补充一下自己认为重要的。

 

二爷的DP总结

不断看到有新人学习DP,想谈谈我的感受。 
我大概是去年底,今年初开始学习DP的。以前没有一点概念。去年G电面我的时候就出 
了一道最简单的DP题,那时我根本不知道什么是DP,在提示下用recursion做出来的, 
没有用cache。 
开始学习DP是在careercup 150那本书上。下面是一些感受。 

1. careercup定义的DP就是recursion+cache。这个定义指导了我很长时间。我认为这 
个定义是DP的初级阶段,有误导性,使得我在练习的时候发现很多题型用这个定义套不 
上。误导性在于: 1, recursion+cache是DP不错,但是DP并不等于recursion+cache。 
2, recursion的DP并不优化,因此从recursion出发做DP不是个好思路。 

2. 我后来理解的DP是这样子的。很简单就是推DP公式。也就是说怎么用F(n-i) 推导出 
F(n)来。当然这也是最难的。发现很多难题还是很难想到这个公式的,可能就得多练习 
了,培养思路。这个定义跟careercup上的不一样的地方主要是思考的方式不同,一个 
是推公式,一个是找recursion的办法。而DP的关键是推公式,如果从recursion出发的 
话,很多题可能做不出来。 

做DP题需要注意两点: 
1. 能用iteration就不要用recursion。这也证明了careercup上的定义有局限性了。 
2. DP是用空间换时间。所以DP题做熟了,应该考虑怎样优化空间了。能用常数空间就 
不要用O(n), 能用O(n)就不要用O(n^2).  (我觉得这也是Vissa的霸气所在。Vissa面F 
的时候说过“这么简单的DP题,我从来都是用常数空间”)。 

最后就是多做题才能培养思路。一般面试应该不会有很难的DP题,多练习一下有了思路 
,再能写出iteration和空间优化的解法,并且能保证少bug的话,应该面试就差不多了。

转载于:https://www.cnblogs.com/charlesblc/p/6126756.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值