A summary of questions in Java common face--java pen

Source: Internet
Author: User
Tags java web asymmetric encryption

Note: This article is reproduced from http://www.cnblogs.com/huajiezh/p/5790928.html, the copyright belongs to its all! Summary of common questions in Java First, the Java Foundation

1. Why is the string class final?

2, HashMap The source code, the realization principle, the bottom structure.

3, say that you know a few Java Collection class: List, set, queue, map implementation class ...

4. Describe the respective realization and difference between ArrayList and LinkedList

5. What are the differences between the queues in Java?

6. The difference between class.forname and ClassLoader in reflection

7, Java7, Java8 new features (Baidu asked, good BT)

8. The operational efficiency of both the Java array and the linked list, in which cases (starting from the beginning, starting at the end, starting from the middle), which operations (INSERT, find, delete) are efficient

9, the problem of the Java Memory Leak survey location: Jmap,jstack use and so on

10, String, StringBuilder, StringBuffer difference

11. The difference between Hashtable and HashMap

13, exception structure, run-time exceptions and non-runtime exceptions, each of the examples

14. String a= "abc" string b = "abc" String c = new String ("abc") string d = "AB" + "C". The result of comparing them with = =

15. Common methods of String class

16. What kinds of reference types do Java have?

17. The difference between abstract classes and interfaces

18. Java's underlying type and byte size.

19, Hashtable,hashmap,concurrenthashmap bottom realization principle and thread safety problem (suggest familiar with JDK source code, can calmly answer)

20, if you do not use the Java JDK to provide tools, you implement a map yourself, how do you do. Said for a long time, said HashMap source code, if I do, will learn from the principle of HashMap, said a pass HashMap realize

21, hash conflict how to do? What are the methods for resolving hash conflicts?

22, HashMap conflict is very bad, the worst performance, you will how to solve? From O (n) to log (n), the idea of a binary sort tree is said

23, Rehash

24, Hashcode () and Equals () generation algorithm, method how to rewrite

Second, Java IO

1, talk about the IO inside the common class, byte stream, character stream, interface, implementation class, method blocking.

2, talk about NiO.

3. What is the difference between String encoding UTF-8 and GBK?

4, when to use byte stream, when use character stream?

5, recursively read the file under the folder, how to implement the code

Third, the Java Web

1, session and cookie differences and contact, session life cycle, multiple services deployment session management.

2. Some related problems of servlet

3, WebService related issues

4, JDBC Connection, forname Way of the steps, how to declare the use of a transaction. Example and specific code

5, no framework configuration of the main configuration of Web. XML content

6. The difference between JSP and servlet

Iv. JVM

1. Java memory model and GC algorithm

2. What does JVM performance tuning do?

3. Describe the 7 areas in the JVM, and then describe the situation where each zone could cause a memory overflow

4, introduce GC and GC root abnormal reference.

5, oneself from classload loading way, loading mechanism to go, from the program run time data area, talk about memory allocation, talk about the string constant pool, talk about JVM garbage collection mechanism, algorithm, hotspot. Anyway, it's all kinds of extensions

6, how the JVM allocates direct memory, how the new object is not allocated on the heap but on the stack, constant pool parsing

7, the array is placed in the JVM older generation (not just set pretenuresizethreshold, ask how big, not done a ask to know)

8. How arrays are accessed in the old age

9, GC algorithm, the permanent generation of objects how GC, GC ring how to deal with

10, who will be GC, when GC

11. What to do if you want to not be GC

12. What to do if you want to survive in GC 1 times

v. Open source Framework

1. The difference between hibernate and Ibatis

2, talk about the MyBatis connection pool.

3. Which jar packages need to be referenced in the spring framework, and the purpose of these jar packages

4. Principle of SPRINGMVC

5, the meaning of SPRINGMVC annotations

6. The relationship and difference between beanfactory and ApplicationContext in spring

7, spring injection of several ways (cyclic injection)

8, spring How to achieve the management of things

9, SPRINGIOC

10. The principles of spring AOP

11. How to use the 1 level and 2 cache in Hibernate and the difference principle (lazy-load understanding)

12, Hibernate principle system architecture, five core interfaces, hibernate object of three state transitions, transaction management.

six, multi-threaded

1. The difference between the start () method and the run () is called directly after the Java thread is created.

2. Common thread pooling patterns and usage scenarios for different thread pools

3, Newfixedthreadpool this kind of thread pool if the number of threads to reach the maximum value will do, the underlying principle.

4, multi-threaded communication between the synchronization problem, synchronized lock is the object, stretch out and synchronized related to a lot of specific problems, such as the same class different methods have synchronized lock, whether an object can be accessed at the same time. Or the static construction method of a class plus the effect of a lock after synchronized.

5, understand the meaning of reentrant lock, and the difference between Reentrantlock and synchronized

6, synchronous data structure, such as Concurrenthashmap's source understanding and internal implementation principle, why he is synchronous and high efficiency

7. Understanding and use of keywords for thread-safe operations such as atomicinteger and volatile

8. Inter-thread communication, wait and notify

9, the use of timed threads

10, Scene: In a main thread, requires a large number of (many) sub-threads after execution, the main thread does not complete. Many ways to consider efficiency.

11. Differences between processes and threads

12. What is thread safety? Examples Show

13, several states of the thread

14. Concurrent, synchronous interface or method

15, HashMap is thread-safe, why not secure. Concurrenthashmap, thread safety, why security. What is the underlying implementation.

16, the use of common classes under J.U.C. An in-depth study of threadpool; the use of blockingqueue. (The difference between take,poll, put,offer); The implementation of atomic classes.

17, simple introduction of the situation of multithreading, starting from the establishment of a thread. Then how to control the synchronization process, multithreading common methods and structure

18, the understanding of volatile

19, the realization of multithreading there are several ways, multi-threaded synchronization How to do, say a few lines thread commonly used methods

Vii. network communication

1, HTTP is stateless communication, HTTP request method, you can define a new request method.

2, socket communication, and long connection, subcontracting, connection abnormal disconnection processing.

3, the use of socket communication model, AIO and NIO.

4, the use of the socket frame Netty, and the implementation of the principle of NIO, why is asynchronous non-blocking.

5, synchronous and asynchronous, blocking and non-blocking.

6. OSI seven layer model, including some basic knowledge of TCP,IP

7. In HTTP, the difference between get post

8, talk about the relationship between HTTP,TCP,UDP and difference.

9, said the browser access to www.taobao.com, experienced how the process.

10, HTTP protocol, HTTPS protocol, SSL protocol and complete interactive process;

11, TCP congestion, fast callback, IP message discarded

12, HTTPS processing of a process, symmetric encryption and asymmetric encryption

13, head of the various characteristics and differences

14, said the browser access to www.taobao.com, experienced how the process.

viii. MySQL Database

1. mysql storage engine is different

2. Single index, federated index, primary key index

3, MySQL How to divide the table, and after the table if you want to query by the conditions of the page to do (if not by the table field to query, almost inefficient, no solution)

4, the table after the want to let an ID more than one table is self-increasing, efficiency implementation

5, MySQL's master-slave real-time backup synchronization configuration, as well as the principle (from the library read the main library binlog), read and write separation

6. Write SQL statement ...

7. Index data structure, B + Tree

8, the four characteristics of the transaction, as well as their characteristics (atomic, isolation) and so on, the project how to solve these problems

9, the database lock: Row lock, table lock; optimistic lock, pessimistic lock

10. Several granularity of database transaction;

11. Relationship-type and non-relational database differences

Nine, design mode

1. Singleton mode: Full Han, a hungry man. As well as lazy loading in a hungry man, double check

2, Factory mode, decorator mode, observer mode.

3, the advantages of factory method model (low coupling, cohesion, open closed principle)

10. Algorithm

1, using the random algorithm to produce a number, requires the 1-1000w between the number of all generation. (Study high efficiency, solve the problem of conflict)

Combined ordering of 2, two ordered arrays

3, an array of reverse

4. Calculate the positive square root of a positive integer

5. It is common to find, sort algorithms, and their time complexity.

6, Binary Tree traversal algorithm

7. DFS,BFS algorithm

9, more important data structure, such as linked list, queue, stack basic understanding and general realization.

10, sorting algorithm and space-time complexity (why is the fast row unstable, why your project is still in use)

11. Inverse Polish Calculator

12, Hoffman Code

13. Find trees and red and black trees

11. Concurrency and Performance tuning

1, there is a 5k per second request, query the phone number of the place of the pen test (remember incomplete, not listed), how to design the algorithm? More requests, such as 5w, how to design the entire system?

2, high concurrency situation, how our system supports a large number of requests

3. How the cluster synchronizes session state

4, the principle of load balancing

5, if there is a particularly large amount of traffic, to the database, how to do optimization (db design, dbio,sql optimization, Java optimization)

6, if there is a large area of concurrency, on the basis of not increasing the server, how to solve the problem of the server response is not timely ".

7, if your project has a performance bottleneck, you think it may be what aspects, how to solve the problem.

8, how to find the location that caused the performance bottleneck, which position is the performance bottleneck.

9. Have you used the caching mechanism in your project? There is no use for user non-local cache

12. Other

1. Commands under common Linux

If you have any help, please pay attention!

A summary of questions in Java common face--java pen

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.