c****m 发帖数: 179 | 1 看版上的面经,为啥google家的面试好像没有很多多线程的问题?感觉这个在system实
践中蛮重要
的,有么有人有具体的相关面试题共享一下,谢谢! |
g**e 发帖数: 6127 | 2 列几个我被问的题吧,没面过google。银行码工多线程问的很多。概念性的就不列了,
比如什么是deadlock, livelock,怎么预防,怎么解锁之类的。基本上都是java的问题
1. write a method to transfer funds between two bank accounts
2. what's synchronized keyword in java? how does it work? what's the
difference between sychronize keyword and other high end locks in java.util.
concurrent package?
3. what's the best way to stop a thread and why?
4. what's the difference between daemon thread and regular thread?
5. implement your own ReentrantLock class.
6. should we always use locks in concurrent package and abandom sychronize
keyword, why?
7. implement consumer/producer with/without using advanced class in
concurrent package.
欢迎补充。Java concurrency in practice是好书,搞熟悉了多线程的问题基本不在话下
【在 c****m 的大作中提到】 : 看版上的面经,为啥google家的面试好像没有很多多线程的问题?感觉这个在system实 : 践中蛮重要 : 的,有么有人有具体的相关面试题共享一下,谢谢!
|
c****m 发帖数: 179 | 3 赞,我看的careercup的相关章节,感觉不如ls的给力。 |
g**e 发帖数: 6127 | 4 补充一个
write a thread safe lazy initialization singleton class
【在 c****m 的大作中提到】 : 赞,我看的careercup的相关章节,感觉不如ls的给力。
|
i*****t 发帖数: 636 | 5 good one
util.
【在 g**e 的大作中提到】 : 列几个我被问的题吧,没面过google。银行码工多线程问的很多。概念性的就不列了, : 比如什么是deadlock, livelock,怎么预防,怎么解锁之类的。基本上都是java的问题 : 1. write a method to transfer funds between two bank accounts : 2. what's synchronized keyword in java? how does it work? what's the : difference between sychronize keyword and other high end locks in java.util. : concurrent package? : 3. what's the best way to stop a thread and why? : 4. what's the difference between daemon thread and regular thread? : 5. implement your own ReentrantLock class. : 6. should we always use locks in concurrent package and abandom sychronize
|
c*****l 发帖数: 879 | |
g***s 发帖数: 3811 | 7 that's normal.
I was asked to code for 5 & 7 long time ago.
【在 c*****l 的大作中提到】 : 我面的时候问了 还要现场编程
|
g**e 发帖数: 6127 | 8 呵呵,singleton和producer/consumer我也要求写代码。reentrancelock只要说个idea
就行了
还有问ConcurrentHashMap实现的,这个倒没要求写代码的
【在 g***s 的大作中提到】 : that's normal. : I was asked to code for 5 & 7 long time ago.
|
k*******p 发帖数: 219 | |