美资软件公司JAVA工程师电话面试题目
1. Talk about overriding, overloading.
2. Talk about JAVA design patterns you known.
3. Talk about the difference between LinkList, ArrayList and Victor.
4. Talk about the difference between an Abstract class and an Interface.
5. Class a = new Class(); Class b = new Class();
if(a == b) returns true or false, why?
6. Why we use StringBuffer when concatenating strings?
7. Try to explain Singleton to us? Is it thread safe? If no, how to make it thread safe?
8. Try to explain Ioc?
9. How to set many-to-many relationship in Hibernate?
10. Talk about the difference between INNER JOIN and LFET JOIN.
11. Why we use index in database? How many indexes is the maximum in one table as your suggestion?
12. When ‘Final’ is used in class, method and property, what dose it mean?
13. Do you have any experience on XML? Talk about any XML tool you used ,e.g. JAXB, JAXG.
14. Do you have any experience on Linux?
15. In OOD what is the reason when you create a Sequence diagram?
Administrator 10:34:20
1,堆和栈的区别,有一个64k的字符串,是放到堆上,还是放到栈上,为什么?
2,什么时候用到接口,什么时候用到抽象类,二者区别
3,有一个100万的数组,里边有两个市重复的,如何设计算法找到。
4,设计数据库时,n维,如何设计。
1. Talk about overriding, overloading.
Overriding - same method names with same arguments and same return types associated in a class and its subclass.
Overloading - same method name with different arguments, may or may not be same return type written in the same
class itself.
static/early binding polymorphism:overloading
dynamic/late binding polymorphism:overriding
2. Talk about JAVA design patterns you known.
Creational Patterns
Factory Pattern
Abstract Factory Pattern
Singleton Pattern
Builder Pattern
Prototype Pattern
Structural Patterns
Adapter Pattern
Bridge Pattern
Composite Pattern
Decorator Pattern
Facade Pattern
Flyweight Pattern
Proxy Pattern
Behavioral Patterns
Chain of Responsibility Pattern
Command Pattern
Interpreter Pattern
Iterator Pattern
Mediator Pattern
Momento Pattern
Observer Pattern
State Pattern
Strategy Pattern
Template Pattern
Visitor Pattern
3. Talk about the difference between LinkList, ArrayList and Vector.
vector is synchronized, list is not
vector increases by 100%, list by 50%
4. Talk about the difference between an Abstract class and an Interface.
interface is the special instance of abstract class, it requires its methods(all just declaration) all
implemented,not necessary for the abstract class.
5. Class a = new Class(); Class b = new Class();
if(a == b) returns true or false, why?
false as they are different objects
6. Why we use StringBuffer when concatenating strings?
as it's mutable
7. Try to explain Singleton to us? Is it thread safe? If no, how to make it thread safe?
only one instance can live till it dies. no. use synchronized.
8. Try to explain Ioc?
inversion of control,just like the hollywood mode,when we need it we will call you not you call us.
9. How to set many-to-many relationship in Hibernate?
set a relationship table
for instance, set table A(id, name),B(id, name) many to many relationship,then set table AB(a_id, b_id) to
represent their relation
10. Talk about the difference between INNER JOIN and LFET JOIN.
INNER JOIN-->return all rows from both tables where there is a match.
LEFT JOIN-->Return all rows from the first table, return rows from the second table where there is a match.
11. Why we use index in database? How many indexes is the maximum in one table as your suggestion?
A database index is a data structure that improves the speed of operations on a database table. Indices can be
created using one or more columns of a database table, providing the basis for both rapid random lookups and
efficient access of ordered records.
as many as necessary
12. When ‘Final’ is used in class, method and property, what dose it mean?
final means last, cannot be extended, overridden,reassigned etc..
13. Do you have any experience on XML? Talk about any XML tool you used ,e.g. JAXB, JAXG.
yes,dom,sax,dom4j,jdom,etc...
14. Do you have any experience on Linux?
yes
15. In OOD what is the reason when you create a Sequence diagram?
A sequence diagram represents the interaction between different objects in the system. The important aspect of a
sequence diagram is that it is time-ordered. This means that the exact sequence of the interactions between the
objects is represented step by step. Different objects in the sequence diagram interact with each other by passing
"messages".
1. Talk about overriding, overloading.
2. Talk about JAVA design patterns you known.
3. Talk about the difference between LinkList, ArrayList and Victor.
4. Talk about the difference between an Abstract class and an Interface.
5. Class a = new Class(); Class b = new Class();
if(a == b) returns true or false, why?
6. Why we use StringBuffer when concatenating strings?
7. Try to explain Singleton to us? Is it thread safe? If no, how to make it thread safe?
8. Try to explain Ioc?
9. How to set many-to-many relationship in Hibernate?
10. Talk about the difference between INNER JOIN and LFET JOIN.
11. Why we use index in database? How many indexes is the maximum in one table as your suggestion?
12. When ‘Final’ is used in class, method and property, what dose it mean?
13. Do you have any experience on XML? Talk about any XML tool you used ,e.g. JAXB, JAXG.
14. Do you have any experience on Linux?
15. In OOD what is the reason when you create a Sequence diagram?
Administrator 10:34:20
1,堆和栈的区别,有一个64k的字符串,是放到堆上,还是放到栈上,为什么?
2,什么时候用到接口,什么时候用到抽象类,二者区别
3,有一个100万的数组,里边有两个市重复的,如何设计算法找到。
4,设计数据库时,n维,如何设计。
1. Talk about overriding, overloading.
Overriding - same method names with same arguments and same return types associated in a class and its subclass.
Overloading - same method name with different arguments, may or may not be same return type written in the same
class itself.
static/early binding polymorphism:overloading
dynamic/late binding polymorphism:overriding
2. Talk about JAVA design patterns you known.
Creational Patterns
Factory Pattern
Abstract Factory Pattern
Singleton Pattern
Builder Pattern
Prototype Pattern
Structural Patterns
Adapter Pattern
Bridge Pattern
Composite Pattern
Decorator Pattern
Facade Pattern
Flyweight Pattern
Proxy Pattern
Behavioral Patterns
Chain of Responsibility Pattern
Command Pattern
Interpreter Pattern
Iterator Pattern
Mediator Pattern
Momento Pattern
Observer Pattern
State Pattern
Strategy Pattern
Template Pattern
Visitor Pattern
3. Talk about the difference between LinkList, ArrayList and Vector.
vector is synchronized, list is not
vector increases by 100%, list by 50%
4. Talk about the difference between an Abstract class and an Interface.
interface is the special instance of abstract class, it requires its methods(all just declaration) all
implemented,not necessary for the abstract class.
5. Class a = new Class(); Class b = new Class();
if(a == b) returns true or false, why?
false as they are different objects
6. Why we use StringBuffer when concatenating strings?
as it's mutable
7. Try to explain Singleton to us? Is it thread safe? If no, how to make it thread safe?
only one instance can live till it dies. no. use synchronized.
8. Try to explain Ioc?
inversion of control,just like the hollywood mode,when we need it we will call you not you call us.
9. How to set many-to-many relationship in Hibernate?
set a relationship table
for instance, set table A(id, name),B(id, name) many to many relationship,then set table AB(a_id, b_id) to
represent their relation
10. Talk about the difference between INNER JOIN and LFET JOIN.
INNER JOIN-->return all rows from both tables where there is a match.
LEFT JOIN-->Return all rows from the first table, return rows from the second table where there is a match.
11. Why we use index in database? How many indexes is the maximum in one table as your suggestion?
A database index is a data structure that improves the speed of operations on a database table. Indices can be
created using one or more columns of a database table, providing the basis for both rapid random lookups and
efficient access of ordered records.
as many as necessary
12. When ‘Final’ is used in class, method and property, what dose it mean?
final means last, cannot be extended, overridden,reassigned etc..
13. Do you have any experience on XML? Talk about any XML tool you used ,e.g. JAXB, JAXG.
yes,dom,sax,dom4j,jdom,etc...
14. Do you have any experience on Linux?
yes
15. In OOD what is the reason when you create a Sequence diagram?
A sequence diagram represents the interaction between different objects in the system. The important aspect of a
sequence diagram is that it is time-ordered. This means that the exact sequence of the interactions between the
objects is represented step by step. Different objects in the sequence diagram interact with each other by passing
"messages".