gewhiz / testRep

testing for the first Repository
2 stars 1 forks source link

linkedin #3

Open gewhiz opened 9 years ago

gewhiz commented 9 years ago

singleton并让其thread-safe,还问到了lazy initialiation的和volatile关键字的意义

gewhiz commented 9 years ago

binary tree level order traversal, 写了三种方法。。。(BFS用arraylist,类似 DFS,BFS用queue)

onsite:

  1. romanToInt, intToRoman, N points, m nearst ones
  2. 双向链表,每个node可能都有父节点和子节点,每个父子节点又是一个链表。把它 拍扁,顺序随意,O(1)空间复杂度 edit distance
  3. system deisign: design amazon product page
  4. project presentation
  5. group fit
gewhiz commented 9 years ago

http://www.geeksforgeeks.org/given-an-array-of-of-size-n-finds-all-the-elements-that-appear-more-than-nk-times/

gewhiz commented 9 years ago

hashmap,写完后继续要求要考虑multi-thread

linkedin 有两类用户,普通user和influencer,数据量都很大,写一个类, 要求O(1)的 get(user), set(user, type), getAllInfluencer. 我一开始用两个 hashset,问我有没更好的办法,后来问明白他其实就是想要bitset, 写出搞定

gewhiz commented 9 years ago

http://leetcode.com/2010/09/serializationdeserialization-of-binary.html

gewhiz commented 9 years ago

minimize the cost of painting K houses, each house has different costs to paint in different colors, 2 houses (next to each other) cannot be painted in the same color. DP

http://stackoverflow.com/questions/24646122/3-houses-and-minimum-cost-of-painting