刚拿到一个tire 1的IB的开发职位,帖子里是面经,有兴趣的看看

Barclays capital Singapore, Analyst interview question.

1) first round, phone interview. 1 to 1

difference between ArrayList and Vector. what design pattern is used in ArrayList

what is the ThreadLocal and how to leverage it. Will this class solve the thread contention problem?

difference between volatile and synchronized(intrinsic lock).

How to find out whether a circle exist in a list.

given a unsorted array, given a number A, how to find out all the two numbers which are in the array and sum is A.

Compare Hibernate with ibatis.

explain the most useful fetch strategy in Hibernate.

list out all the objects u can use in a jsp page directly.

Is Map a collection type? if not, why.

any experience in software load balancer? for example LVS. explain hearbeat.

How many methods in Object class, which methods will be override by the application developer and why.

explain the erasure of generics. What is the upper bound and lower bound. What is collection of unknown and how we use it.

will finally always run? explain the following code
try {
doSth();
} catch (Throwable t){
System.exit(1);
} finally {
System.out.println(“I am in finally ”);
}



2) On site interview, 3 people, 1 application engineer, 1 analyst, 1 pm.

what is the new feature in jdk 5 compared with jdk 1.4. Have you ever looked into Java 7.

any experience in Apache commons, explain the commons-collection strutcture. Write a piece of code to simulate lazy load collection. any experience in google collection? what is the disadvantage of google collection.

what is enclosure. (fuck this, it is in Java 7 and has not been released yet.)

how does connection pool work.

transaction isolation level.

Given a code snippet, find the problem and fix it. (dead lock)

explain the command, observe pattern. how to use it. Any example in JDK?

explain the GC. explain at least two gc algorithm and how to use them. (Concurrency and CMS)

How to profile a JVM. any tool you are good at. How to do analysis if you got the snapshot of the heap.

typical web authentication procedure.

give me perfect Singlton which will be run in a multithread env. (pls look into java concurrency)

If two thread contend for a specific resource, how to find out which resource it is without profiling tools. (thread dump).

Explain the pojo’s lifecycle in hibernate. What is first level and second level cache. How to enable them.

Can we cluster hibernate and why.

How to simulate the hot deploy in an application server.

Why Java need abstract and interface at the same time.

Merge two sorted linked list and make sure the result is also sorted.

simulate the class inheritance in Javascript (prototype)

what is drawback of google web tool kit.

Any experience in source control system. (replied CVS and SVN), what is the difference between CVS and SVN. Have u heard of perforth? What is the standard development lifecycle in SVN? explain the meaning of trunk, branch, tag.
What is the meaning of merge.

tell me the sort algorighm you know. the different scenario they should be used in.

any ext-js experience.

behavior question.

3) final round, 1 hiring manager.

Why we call spring as a light-weight container.

how to design a web crawler. make sure these crawler crawl all the competor’s website and we provide lower price than that.

explain thread-safety. explain and give an example of semphere, reentrantlock and countdownlatch. How to avoid dead lock. difference between semphere and lock, are they interchangeable? what is a blocking queue in jdk 5.

database sharding experience? tell me the different sharding stragety. How to use hibernate sharding.

given a very slow application server, how to tune it

difference between hashtable and hashmap, what is bucket. if possible, tell something about the source code of hashmap in jdk. How to design a good hash function?

session related j2ee best practice. If our application servers are clustered and fail over enabled, what kind of Objects can be stored in session and why.

session failed over. tell me some real product’s strategy. for example tomcat. websphere, weblogic

spring security. how to integrate it with microsoft site minder.

explain the fail index. what can cause the index not work.

what is the difference of IN and exist keyword in Oracle.
Select name from employee where name not in (select name from student);
Select name from employee where not exists (select name from student);
explain the query plan.

what is N+1 select. How hibernate avoid it. Should we always avoid N+1 select and why?

Spring AOP. how to simulate a spring AOP by either jdk proxy or CGLib. Can we use AOP to achieve proxy pattern.

why we need inner class? static inner class? explain the source code of ArrayList.

How to recover the previous session after restarting the server?

contextclassloader, how application server load different applications and maintain their own libs in JVM. Can we simulate it and how.


what is ‘with’ keyword doing in javascript.
请先 登录 后评论

8 个回答

孔瑶盛

其实问的问题不难
比我以前毕业时候面淘宝问的简单多了。

请先 登录 后评论
花光

这些题楼主都会吗?
有几题挺不常见的。
design pattern of arraylist, threadlocal, failover, erasour of generics, load balancer.....

而且cover的东西也不少, GWK, spring, hibernate, (iBatis), AOP, classLoader, load balance, javascript, DB..

不过没有struts啊?还是Spring MVC。 还是太common了,所以没有问。

可以问一下楼主工作多久了吗?

请先 登录 后评论
孔瑶盛

有兴趣就知道答案
比如说失效转移,不同的application server有不同的策略。有的是有专门的失效服务器做中心备份,有的是对等拷贝。各有优点。比如说范型擦除,我回答的时候是和C++比较来回答的 (我做过C++开发),我个人认为java的范型和C++相比简直是糟粕,但无论如何,它提供了编译期的范型安全支持。 比如说arraylist,有兴趣的人应该都会看看源代码,用到的设计模式自然就知道了。 所以我觉得兴趣非常重要,有兴趣,积累就多了。

请先 登录 后评论
孔瑶盛

前两天我面GOOGLE的题目
这些题不准往外说的,但是我贴上来,大家学习学习,看看google的难度。


把一个字符串转换成32bit的整数

=> 要注意处理溢出的情况

在一个数组中寻找三个数,使得它们的和为0

=> 这个是找两个和为0的数的扩展

俩数组交集。有序或无序。

实现cache.

给字符串,里边是几个单词中间没空格,输出所有可能的句子。比如“好运气”,输
出好空格运气。

数据流统计最近一个小时流量。

写程序找最大convex多边形。

复制无loop的有向图。

给字符串找最短一段出现过abc。

给一段内存,如何设计malloc和free.

设计密码产生器,不许是字典里的单词。

快速设计一个bloom filter,这个题我用java答的,其实bloom filter的设计难点在K Hash吧,我就简单用了SHA1算hash了,interviewer不太满意。

offer 没拿到,google 不好进。。。。

请先 登录 后评论
孔瑶盛

cache那个题目被问的格外多
主要是分布式cache应该如何设计

请先 登录 后评论
孔瑶盛

有些是我想不起来,在网上搜的面经的题目
但是好像都没啥答案,愿意切磋的产内给我发消息吧。

请先 登录 后评论
荀丹亮

orthogonal 的hash function本来就不好找吧。。不知道他的意图是什么。
你觉得难只是因为平时没有太接触而已。。IT领域也很广,这面试注重的多是搜索和数据相关算法。一个人也不可能什么精通。。能精通一个领域已经很牛了,没必要追求完美,因为完美是不可能的。

请先 登录 后评论
花光

所以楼主读了很多东西啊
我一直都是做java/j2ee development,也做了几年了。fail over, load balancer,其实working experience wise,很少会用到。arraylist source code, 就几乎不可能了。 GC algorithm, JVM profiling, N+1,...

楼主还是做C++的。 楼主可以推荐下,看得那本这么强的书吗?

请先 登录 后评论
  • 0 关注
  • 0 收藏,132 浏览
  • 孔瑶盛 提出于 2019-07-18 09:10