Java程序员进阶必练题

No

Topic

Summary

1

JVM basic concept

1. What's is JVM
2. Concept of JVM, JDK, JRE
3. HotSpot
4. Reference type
5. Garbage Collection

2

How to create new object in Java

1. new
2. deseriablize
3. clone
4. reflect

3

Serializable

1. Official definition
2. Why this interface is introduced.
3. When serialized to Persistent status, which is saved, the class or the object? 
4. How to deal the case when property is an object?
5. How to do rollback the object?
6. Why need set serialVersionUID?
7. What's means of externalizable?

4

Transient

1.official definition, should from Java Spec
2. why this keyword is introduced
3. Can be applied to local variable? Static variable? Method? Class?
4. Use example to express
5. Typical purpose

5

Shadow clone vs deep clone

1. Official definition 
2. Why need clone? Any difference between these 2 types?

6

native

1.official definition, should from Java Spec
2. why this keyword is introduced 
3. Typical usage
4. Example

7

final

1. Official definition 
2. Why this interface is introduced. 
3. What's means of final variable, final method, final class.
4. Typical usage.

8

Volatile

1.official definition, should from Java Spec
2. why this keyword is introduced 
3. Typical usage

9

synchronized

1. Official definition 
2. Why this key word is introduced. 
3. What's means of critical resource, how to avoid competition
4. Give example when applied to method, class

10

MultiThread

1. Multithread code sample
2. Concurrent package in java src

11

How to implement Connection Pool

1. What's connection pool, target
2. The normal connection pool setting
3. How to implement

12

Class and object

1. Inner class
2. anonymous class
3. static class

13

Java similar technology and language

1. Java, .net, c#
2. Groovy, Ruby, Ruby on Rails
3. Python, Scala

14

mutex, futex, spin lock

1. Need know the basic term.
2. Need understand the background knowledge

15

Concurrent

1. Java.concurrent package
2. SynchronizedMap and Map.synchronize method
3. BlockingQueue

16

Generic

1. PECS: Produce Extended, Comsumer Super

17

Collection

1. Map, List, Vector, Set
2. Synchornized and Asynchornized
3. Thread-safe and thread-unsafe


No

Question

1

Why is the String class in Java is final immutable object?

2

What problem(s) does abstraction and encapsulation solve?

3

Why wait, notify and notifyAll is defined in Object Class and not on Thread class in Java

4

How Generics works in Java ? What is type erasure ?

5

Explain difference among raw type list, list<Object> and list<?>

6

Thread类中sleep是为什么是静态方法

7

可以把对静态变量的访问放于synchronized 块内么?

8

final,volatile一起使用可以吗?

Practice:

No

Task

Mandatory

1

现有一个Web Application, 可接受用户请求,现要求将insert类的请求用异步单线程方式保存到数据库中. 
为简化起见,可以不执行真正的insert操作.只需将信息打印出来

Y

2

实现至少3种不同的创建线程的方法

Y

3

You have thread T1, T2 and T3, how will you ensure that thread T2 run after T1 and thread T3 run after T2? These thread already started. Try to implement at least 2 ways.

Y

4

Write a program which will result in deadlock

O

5

先有一个很大的数组,可以一次性load到内存,现要求对该数组进行求和,要求利用到多核

Y

6

写一个例子, 该例子有100个任务,启动线程数字由用户输入,要求给出总处理时间,用CountLatchDown

Y

7

写一个周期性处理任务的例子,在这个例子中有100个任务,希望每10个为一组进行处理,当前仅当上一组任务处理完成后才能进行下一组,另外在每一组任务中,当任务剩下50%,30%以及所有任务执行完成时向观察者发出通知

Y

8

有一些很大的数组,放在数据库中,现在要求对这些数据进行求和,要求尽可能快, 可以考虑程序控制两个多线程段,一个是数据读取的多线程部分,不同的connection取不同的limit,一个是数据求和计算的多线程部分,注意同步

O

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值