I'm interview questions summary

1. collection

1.1 What are the common set of interfaces?

Collection (with interfaces), set, List, Map

The difference 1.2ArrayList and LinkList?

① different data structures: ArrayList subbing layer is an array, the LinkedList before jdk1.8 + is an array with the list, an array is used after jdk1.8 + + black tree list
② different initial size: ArrayList to 10, LinkedList no The initial size
③ query: fast ArrayList, LinkedList slow.
④ add, modify, delete:. the LinkedList fast, slow the ArrayList
⑤ time complexity: ArrayList-O (1), Linkedist-O (n) ---- query

What's the difference between 1.3 Iterater and ListIterater,

① Iterater we can use to traverse the collection set and List collections, ListIterater can only traverse the List collection.
②Iterater can only be traversed forward, ListIterater traverse in both directions.
③ListIterater add additional functionality by adding an element, replacement, and a pre-acquisition the next index

1.4 by fail-fast iterators What do you know?

Every time we try to get the next element when Iterater fail-fast property to check the current set of changes to whatever he throws ConcurrentModificationException (concurrent modification abnormal), to achieve all Iterater in the collection are by fail-fast designed. Such concurrent ConCurrentHashMap and CopyOnWiteArrayList excluded).

1.5 collections provide random access to those elements? (There are key and the index)

ArrayList,HashMap,TreeMap和HashTable

1.6 Those collections are safe?

vectot, HashMap, properties and Stack are synchronized, thread-safe, can be used in a multithreaded environment.

What is the difference 1.7Array and ArrayList? When more suitable Array?

①Atrray 'capable of receiving data and object base type. ArrayList receiving the object only.
②Array a specified size, but the size is dynamic ArrayList.
③Array method ArrayList provided not so much, but sometimes useful Array
for variable traverse basic types, although the use of their collections to reduce encoding active packing the task, in basic types of list of specified size will become slower.

1.8 What are the similarities and differences ArrayList and the Vector?

ArrayList and Vector are very similar in a lot of time.
① Both are based on the index, supported internally by an array.
Both ② maintain the order of insertion, we were able to get the elements according to the order of insertion.
Iterators ③ArrayList and the Vector are fail-fast realization of
both vector and ④ArrayList agree null values, the elements of random access can use the index value.
different points ArrayList and the vector
①Vector are synchronized, and ArrayList is not synchronized, but seek iteration when changing the list should be used CopyOnwriteAtrrayList.
②ArrayList faster than Vector, it is not synchronized.
③ArrayList more common, there are Collections tools.

1.9 How decided to use HashMap or TreeMap

In the map for the insert, and delete operations such positioning HashMap is the best choice. Based on the size of your collection might hashMap added quickly.
However, you need to assume an ordered collection of key traversal, TreeMap is a better choice.

What are the similarities and differences 1.10HashMap and HashTable?

①HashMap agreed Key and Value is null, and HashTable disagree.
②HashTable is synchronized, different HashMap, HashTable suitable for multi-threaded environment.
③ introduced in jdk1.4 a subclass LinkedHashMap, HashMap, if you want to traverse order, you are very easy shift from HashMap LinkedHashMap, but this is not the HashTable. Its order is irreversible.
④HashMap provide keyset is traversed because he is fail-fast, but HashTable provides key of Enumeration traverse, it does not support fail-fast.
⑤HashTable be felt is the legacy of the class, if you seek when the iterative changes Map, should be used CocurrentHashMap.

1.11 If ArrayList I have two students placed inside the object, but there are exactly two students inside the list, how to eliminate?

The students set object exists in the collection, because the collection set to go heavy.

2.JDBC

2.1 talk about steps the native JDBC connections.

The first step: the Class.forName () to load the database connected to the drive;
second step: the DriverManager.getConnection () Gets a data connection object;
Step 3: SQL sql obtaining the session object, there are two ways Statement, PreparedStatement;
fourth step : SQL execution result set, before executing SQL parameter value if the parameter value set the setXXX ();
step Five: result set is closed, close the session, the connection is closed.

3. Abnormal

3.1 What you appeared abnormal at the time of the writing process?

Rpc,NullPoint…

4.Spring

4.1Spring IOC?

4.2Spring AOP?

4.3 talk about Spring?

5.Mybatis

5.1 Mybatis talk about the benefits of?

5.2Mybatis how JDBC handled?

6.Zookeeper Dubble

6.1 Zookeeper Dubble talk about the execution flow of?

6.2 protocol and talk about the similarities and differences ZAB Http protocol?

7.SpringBoot

7.1 SpringBoot start to talk about class?

7.2 SpringBoot talk about the benefits of using?

8 .SpringClould

8.1 talk about several major pieces of SpringCloud? We are used to do? What are the ingredients act as the project?

9.MySql

9.1Mysql indexes created before? Why create an index? Create a statement?

9.2 What to talk about MySQL Innodb and MyISAM indexes were used?

9.3 talk about the difference between the B + Tree and Hash? Talk about the underlying implementation principles?

9.4 Trigger used it?

9.5 Stored Procedures used it?

What are 9.6Mysql function?

9.7 connect the left and right connector, the connector used it?

10.Redis

10.1Redis of basic data types?

10.2Redis avalanche, penetration breakdown.

11.ElasticSearch

What 11.1ElasticSearch in the index is the?

11.2 Why ElasticSearch?

11.3ElasticSearch underlying principle?

11.4ElasticSearch in the inverted index?

11.5 What is your use of the word?

Published 69 original articles · won praise 6 · views 2479

Guess you like

Origin blog.csdn.net/qq_40539437/article/details/104993864
Recommended