preface

This document is a compilation of Java interview questions from Ali interviewers; Includes Java basics, Java Collections containers, Java exceptions, concurrent programming, JVM, Spring, Spring MVC, Spring Boot, Spring Cloud, MyBatis, Redis, MySQL database, message middleware MQ and RabbitMQ, Dubbo, Linux, Tomcat, ZooKeeper, Netty, architecture design & distributed & data structure and algorithm, etc., are all the interview questions of Internet big factory. Some fans have already won offers from many big factories with this PDF.

On the left side of each interview document is an outline of the document, which is specially organized for your convenience. This article is limited by space, so here are only partial screenshots. Need to answer the resolution of friends can pay attention to the public number: Kylin bug.

Xiaobian this share space may be a little long, watching friends can first understand the catalog

  1. JavaOOP Interview questions — 108
  2. Java Collections/generics Interview questions — 24
  3. Java Exception Interview questions — 8
  4. IO and NIO in Java — 15 questions
  5. Java Reflection Interview questions — 10
  6. Java Serialization Interview questions — 10
  7. Java Annotation Interview questions — 2
  8. Multithreading & and hair questions – 108
  9. JVM interview questions — 87
  10. Mysql interview questions — 83 questions
  11. Redis interview questions — 50
  12. Memcached Interview questions — 24
  13. MongoDB Interview questions — 95
  14. String Interview questions — 131
  15. Spring Cloud Interview questions — 35
  16. RabbitMQ interview questions — 32
  17. Dubbo interview questions — 40
  18. MyBatis Interview questions — 28 questions
  19. ZooKeeper — 49 questions
  20. Data structure interview questions — 9
  21. Algorithmic interview questions — 21
  22. Elasticsearch interview questions — 24
  23. Kafka Interview questions — 25
  24. Micro service interview questions — 50
  25. Linux Interview questions — 48

Dry share is coming!!

JavaOOP Interview questions

1. What is THE B/S architecture? What is the C/S architecture

2. What are the development platforms for Java?

3. What is JDK? What is the JRE?

4. What are the features of the Java language

5. The difference between object-oriented and process-oriented

What is a data structure?

7. What are Java data structures?

What is OOP?

The relationship between class and object?

10. There are several data types in Java

Naming rules for identifiers.

12. The instanceof keyword

13. What is an implicit conversion and what is an explicit conversion

Can a Char type be converted to an int? Can I convert it to a string, can I convert it to a double

What is unpacking?

16. What are the wrapper classes in Java?

17. What does a Java class contain?

How do you solve the problem of errors in floating-point data operations?

19. What are the characteristics of object-oriented?

20, access modifiers, public, private, protected, and don’t write what is the difference between (the default)?

Article space is limited, temporarily show part of the answer to the analysis of concerns about the public number: Kylin bug.

Java collections/generics interview questions

1. Differences between ArrayList and linkedList

2. Differences between HashMap and HashTable

3. The difference between Collection package structure and Collections

4. Common features of generics (to be added)

List,Set,Map

What’s the difference between Array and ArrayList?

7. What are the features of Map

8. Collection classes are stored in the java.util package and have several main interfaces

9, What is the list interface

10. ArrayList

11. Vector (Array implementation, thread synchronization)

Talk about LinkList.

13, What Set

14. HashSet (Hash table)

What is a TreeSet?

LinkHashSet (HashSet+LinkedHashMap)

17, HashMap (array + list + red-black tree)

18. Talk about ConcurrentHashMap

19. HashTable (Thread-safe)

20. TreeMap (sortable)

Java exception interview questions

1. What are the two types of exceptions in Java?

Compile time exception

Runtime exception

2. How many mechanisms are there for handling exceptions?

Exception catching: try… The catch… Finally, throws exceptions: throws throws. public class Box { private T t; public void add(T t) { this.t = t; }public T get() { return t; }}

3. How to customize an exception

Inherit an Exception class, usually RumtimeException or Exception

4, try catch fifinally, try has a return, finally is executed?

Execute, and finally executes before the return in the try

Conclusion:

1. The finally block executes whether or not an exception occurs;

2. Finally is still executed when there is a return ina try and catch;

3. Finally is executed after an expression operation followed by a return, so the return value of a function is determined before finally is executed.

4. It is best not to include a return in finally. Otherwise, the program will exit prematurely.

5. Excption and Error package structure

6. Thow is different from THORws

7, The difference between Error and Exception?

What is the difference between error and exception

IO and NIO in Java

IO streams in Java?

2. Java IO vs. NIO

3, commonly used IO classes have those

4. The difference between byte stream and character stream

Block IO model

6. Non-blocking IO model

7, multiplexing IO model

8. Signal driven IO model

9. Asynchronous IO model

10, JAVA NIO

NIO buffer

12. Non-blocking of NIO

13, the Channel

14 and Buffer

15, the Selector

5, Java reflection interview questions

1. What other methods can you use to create objects besides using new?

2. Is it more efficient to create objects with Java reflection or with new?

The role of Java reflection

4. Where is reflection used?

5, the implementation of reflection:

Java reflection class

7. Pros and cons of reflection mechanism:

Java Reflection API

9, Reflection use steps (get Class object, call object method)

There are several ways to get a Class object

6. Java serialization

What is Java serialization and how to implement it?

2. Save (persist) objects and their state to memory or disk

Serialized objects are held as byte arrays – static members are not saved

4. Serialized user remote object transfer

5, Serializable implementation

6. WriteObject and readObject customize serialization policies

7. Serialize ids

Serialization does not save static variables

The Transient keyword prevents the variable from being serialized to a file

10. Serialization (implemented in Deep Clone 1)

Java notes interview questions

1. What are the four standard meta-annotations?

2. What are annotations?

Eight, multithreading & and hair questions

JAVA Concurrent Knowledge base

1. There are several ways to implement multithreading in Java

Inherit the Thread class

3. Implement the Runnable interface.

ExecutorService, Callable, and Future have return value threads

5. Thread pool-based approach

6. Four thread pools

7. How do I stop a running thread

8. What is the difference between notify() and notifyAll()?

What’s the difference between sleep() and wait()?

10. What is volatile? Can order be guaranteed?

What is the difference between the start() and run() methods in Thread?

12. Why are wait, notify, and notifyAll not in thread?

13. Why are wait and notify called in synchronous blocks?

What is the difference between the interrupted and isInterruptedd methods in Java?

15. What is the difference between Synchronized and ReentrantLock in Java?

16, there are three threads T1,T2,T3, how to ensure sequential execution?

17. What is the difference between SynchronizedMap and ConcurrentHashMap?

What is thread safety

19. What is the use of yield in Thread?

What is the difference between submit() and execute() methods in Java thread pools?

21, say what you know about synchronized

22, tell me how you use the synchronized keyword. Have you used the three main ways of using synchronized keyword in your project

23. What is thread safety? Is Vector a thread-safe class?

Article space is limited, temporarily show part of the answer to the analysis of concerns about the public number: Kylin bug.

JVM interview questions

1. Is there a memory leak in Java? Please describe it briefly.

2, In 64-bit JVMS, int length is the majority.

What are the differences between Serial and Parallel GC?

For 32-bit and 64-bit JVMS, is the length of a variable of type int the majority?

5. The difference between WeakReference and SoftReference in Java?

6. What does the JVM option -xx :+UseCompressedOops do? Why use it

7. How to determine whether the JVM is 32-bit or 64-bit using a Java program?

What is the maximum heap memory for 32-bit and 64-bit JVMS?

What are the differences between JRE, JDK, JVM and JIT?

Explain Java heap space and GC?

11. JVM memory area

12. Program counter (thread private)

13. Virtual stack (thread private)

Local method area (thread private)

15. Can you guarantee GC execution?

How to obtain the memory used by Java programs? What percentage of the heap is used?

17. What is the difference between a heap and a stack in Java?

Describe how the JVM loads class files

What is GC? Why GC?

20. Heap (Heap- thread shared) – run-time data area

10, Mysql interview question

1. Database storage engine

2. TokuDB (Fractal Tree- Nodes with data)

3, MyIASM

4, the Memory

5. What are the database engines

6. Differences between InnoDB and MyISAM

7, index,

8. Common indexing principles are

9. What are the three paradigms of database

10. First Normal Form (1st NF – columns are non-separable)

11. Second Normal Form (2nd NF- Each table describes only one thing)

3rd NF- No transitive dependencies on non-primary key columns

A database is a transaction

14. SQL optimization

15. Explain the differences between DROP, DELETE and TRUNCate

What is a view

17. What is inner join, left outer join and right outer join?

18. What are the problems caused by concurrent transactions?

What are the transaction isolation levels? What is the default isolation level for MySQL?

How to optimize the large table?

11. Redis interview questions

1. What is Redis?

2. What is the difference between Redis and other key-value stores?

3. Redis data type?

4. What are the benefits of using Redis?

5. What advantages does Redis have over Memcached?

6. What are the differences between Memcache and Redis?

Redis is single-process single-thread?

What is the maximum capacity of a string value?

9. Redis Persistence mechanism

10. Cache avalanche, cache penetration, cache warm-up, cache update, cache degradation and other problems

What is hot data and cold data

12. Why is single-threaded Redis so fast

13. Data types of Redis and usage scenarios of each data type

Redis expiration strategy and memory elimination mechanism

Redis common performance problems and solutions?

16, why Redis operation is atomic, how to ensure atomic?

17, Redis transaction

18. What is the persistence mechanism of Redis? What are their strengths and weaknesses?

19. Redis Common performance Problems and solutions:

Delete redis expiration key?

21, Redis recycling strategy (elimination strategy)?

22. Why does EDis need to put all data in memory?

23. Do you know the synchronization mechanism of Redis?

Pipeline has what advantage, why to use Pipeline?

25, Have you used Redis cluster? What is the principle of cluster?

26. When will Redis cluster solution make the whole cluster unusable?

27, What are the Java clients supported by Redis? Which is the official recommendation?

28. What are the advantages and disadvantages of Jedis versus Redisson?

29. How to set and verify the password in Redis?

What is the Redis hash slot?

31, What is the master/slave replication model of Redis cluster?

Will Redis cluster write operations be lost? Why is that?

33. How are Redis clusters replicated?

34. What is the maximum number of nodes in Redis cluster?

How to select database for Redis cluster?

How to test the connectivity of Redis?

Article space is limited, temporarily show part of the answer to the analysis of concerns about the public number: Kylin bug.

12. Memcached

1. What is Memcached and what does it do?

2. What are the application scenarios of memcached service in enterprise cluster architecture?

3. What are the features and working principles of Memcached?

4. Describe the Memcached memory management mechanism.

How does memcached work?

6. What is memcached’s biggest advantage?

Memcached and MySQL query

8. What are the advantages and disadvantages of memcached versus local caches such as PHP APC and Mmap files?

9. What is the cache mechanism for memcached?

10. How does memcached implement redundancy?

13. MongoDB Interview questions

1. What is mongodb?

2. What are the features of mongodb?

What do you mean by NoSQL database? What is the difference between NoSQL and RDBMS directly? Why use and not use NoSQL databases? What are the advantages of NoSQL databases?

What are the types of NoSQL databases?

5. What are the basic differences between MySQL and MongoDB?

6. How do you compare MongoDB to CouchDB and CouchBase?

7. What makes MongoDB the best NoSQL database?

8. Does journal playback encounter problems when entries are incomplete (for example, one of them happens to fail midway)?

9. What is the role of profilers in MongoDB?

What is a namespace?

11. If a user removes an attribute of an object, check whether the attribute is deleted from the storage tier.

12. Can log features be used for secure backup?

Is null allowed?

14. Update operation fsync to disk immediately?

How to perform transaction/lock?

16. Why is my data file so huge?

14, String interview question

Spring Boot interview question

1. What are the main features of Spring Framework versions?

2. What is Spring Framework?

3. List the advantages of the Spring Framework.

What are the different features of the Spring Framework?

5. How many modules are there in the Spring Framework, and what are they?

What is a Spring configuration file?

What are the different components of a Spring application?

8. What are the ways to use Spring?

What is the Spring IOC container?

What is dependency injection?

11. How many ways can dependency injection be accomplished?

Distinguish constructor injection from setter injection

How many IOC containers are available in Spring?

Distinguish between BeanFactory and ApplicationContext.

15. List some advantages of IoC.

16. Implementation mechanism of Spring IoC

17, What is Spring bean?

18. What configuration methods does Spring provide?

19. Spring supports centralized bean scopes?

What is the lifecycle of the Spring Bean container?

21. What are Spring’s internal beans?

22. What is Spring assembly

23. What are the methods of automatic assembly?

24. What are the limitations of automatic assembly?

25. What is annotation-based container configuration

26. How do I start annotation assembly in Spring?

27, @Component, @controller, @repository

28. What is the use of the @required annotation?

29. What is the use of the @autowired annotation?

30. What is the use of @qualifier annotations?

31, What is the @requestMapping annotation for?

What is the use of spring DAO?

33. List exceptions thrown by the Spring DAO.

34. What classes exist in the Spring JDBC API?

Article space is limited, temporarily show part of the answer to the analysis of concerns about the public number: Kylin bug.

15. Spring Cloud

1. What is Spring Cloud?

2. What are the advantages of using Spring Cloud?

3. What does service registration and discovery mean? How is Spring Cloud implemented?

4. What is the significance of load balancing?

5. What is Hystrix? How does it achieve fault tolerance?

6. What is Hystrix circuit breaker? Do we need it?

7. What is Netflix Feign? What are its advantages?

8. What is Spring Cloud Bus? Do we need it?

9. What are microservices

10. What is service circuit breaker? What is service degradation

Eureka and ZooKeeper both provide service registration and discovery functions. What is the difference between them?

What is the difference between SpringBoot and SpringCloud?

13. What is Hystrix circuit breaker? Do we need it

14. Talk about the implementation principle of RPC

15. Advantages and disadvantages of microservices? Tell me about the potholes in the development project?

What’s the difference between Spring Cloud and Dubbo?

17. Compare REST and RPC

What do you know about the microservices stack?

19. How do microservices communicate independently?

20. How does springcloud implement service registration?

RabbitMQ interview questions

1. What is RabbitMQ

2. Why rabbitMQ

3. Rabbitmq scenarios

4. How do I ensure that messages are sent to RabbitMQ correctly? How do I ensure that message recipients consume messages?

5. How to avoid repeated message delivery or consumption?

6. What transport is the message based on?

7. How are messages distributed?

8. How to route messages?

9. How to ensure that messages are not lost?

10. What are the benefits of RabbitMQ?

11. Cluster for RabbitMQ

12. Disadvantages of MQ

13. What is the difference between Kafka, ActiveMQ, RabbitMQ, RocketMQ?

14. How to ensure high availability?

15. How to ensure the reliable transmission of messages? What if the message gets lost

16. How to ensure the sequential nature of messages

17. How to solve the delay and expiration of message queue? What happens when the message queue is full? There are millions of messages waiting for hours. How do you fix them

18, the design of MQ ideas

19. What is Message?

20, What is Publisher?

Article space is limited, temporarily show part of the answer to the analysis of concerns about the public number: Kylin bug.

Dubbo interview questions

1. Why Dubbo?

2. What are the layers of the overall architectural design of Dubbo?

3. What communication framework is used by default? Is there any other choice?

4. Is the service invocation blocking?

5. What registry is generally used? Is there any other option?

What serialization framework is used by default, and what else do you know?

7. What is the principle that service providers can achieve failure kick out?

8. How does the launch of the service not affect the old version?

9. How to solve the problem of long service invocation chain?

10. What are the core configurations?

11. What protocol does Dubbo recommend?

12. Can a service be directly connected with multiple registrations of the same service?

Draw a flow chart for service registration and discovery.

14. How many schemes are there for Dubbo cluster fault tolerance?

Dubbo service is degraded. What should I do if I try again?

16. What are the problems encountered during the use of Dubbo?

17, Dubbo Monitor implementation principle?

18. What design patterns does Dubbo use?

How is the Dubbo configuration file loaded into Spring?

What is the difference between Dubbo SPI and Java SPI?

21. Does Dubbo support distributed transactions?

22. Can Dubbo cache results?

18, MyBatis interview questions

1. What is Mybatis?

2. Advantages of Mybaits

3. Disadvantages of MyBatis framework

4, MyBatis framework applicable occasions

5. What are the differences between MyBatis and Hibernate?

What is the difference between #{} and ${}?

7, What if the name of the attribute in the entity class is different from the name of the field in the table?

8, fuzzy query like statement how to write?

9. Usually, an Xml mapping file will write a Dao interface corresponding to it. What is the working principle of this Dao interface? Can methods in the Dao interface be overloaded if their parameters are different?

13. How to obtain the automatically generated (primary) key value?

14. How to pass multiple parameters in Mapper?

15, Mybatis dynamic SQL what to use? How does it work? What dynamic SQL is there?

16, Xml mapping file, in addition to the common select | insert | updae | delete tags, what other tags?

19. ZooKeeper

1. What is Zookeeper?

2. How does Zookeeper ensure distributed consistency?

3. What does ZooKeeper offer?

4. Zookeeper file system

5. ZAB agreement?

6. Four types of data nodes Znode

Zookeeper Watcher mechanism — data change notification

8, client register Watcher implementation

The server handles the Watcher implementation

Client callback Watcher

11. ACL permission control mechanism

12. Chroot

13. Session Management

14. Server roles

15. Running status of the Zookeeper Server

16. Data synchronization

17. How does ZooKeeper ensure transaction order consistency?

18. What can I do if the ZK node is down?

Zookeeper load balancing and NGINx load balancing

20. Why does a distributed cluster have a Master?

20. Data structure interview questions

1. Stack

A stack is a table that limits insertions and deletions to one position, the end of the table, called the top. It is last in, first out (LIFO). There are only two basic operations on the stack: push, which is an insert, and pop, which is a deletion of the last element.

2. Queue

3. Linked Lists

4. Hash Table

5. Sort binary trees

Prefix tree

7. Red black trees

8, the b-tree

9, bitmap

Algorithm interview questions

1, {1,2,3,4,5,6,7,8,9} in the data, please randomly scramble the order, generate a new array (please use code to achieve)

2, write code to determine whether an integer is 2 power (please code implementation, declined to call API method)

3. Suppose today is Sunday, March 1, 2015. Please calculate the day of the week 13 months and 6 days from now.

4, There are two baskets, respectively A and B, basket A contains eggs, basket B contains apples, please use object-oriented thinking to realize the two baskets exchange items (please use code).

Binary search

6. Bubble sorting algorithm

7. Insert sort algorithm

8. Quicksort algorithm

Hill sorting algorithm

10. Merge sort algorithm

Bucket sorting algorithm

12. Cardinality sorting algorithm

Pruning algorithm

Backtracking algorithm

15. Shortest path algorithm

Minimum spanning tree algorithm

17, AES

In the 18th and RSA

19, CRC

20, MD5

答 案 22, Elasticsearch

How many shards do you have in your es cluster? How many shards do you have in your es cluster?

What is the inverted index of ElasticSearch

Select * from elasticSearch; select * from elasticSearch

How does ElasticSearch implement master voting

5, Describe the process of Elasticsearch indexing documents in detail

How about Elasticsearch?

How to optimize Linux Settings for Elasticsearch deployment

8. What is the internal structure of Lucence?

How does Elasticsearch implement Master voting?

10 select a master from Elasticsearch and 10 select another master from Elasticsearch

11. How do clients select specific nodes to execute requests when connecting to the cluster?

Describe the process of indexing documents for Elasticsearch.

Describe how Elasticsearch updates and deletes documents.

Describe the Elasticsearch process in detail

In Elasticsearch, how do YOU find an inverted index based on a word?

What are the optimizations for Linux Settings when Elasticsearch is deployed?

17. What do you need to know about using Elasticsearch for GC?

18, How to implement Elasticsearch aggregation for large data (tens of millions of magnitude)?

19, What does Elasticsearch do to ensure read-write consistency in concurrent cases?

20. How do I monitor the Elasticsearch cluster status?

21. Introduce the overall technical architecture of your e-commerce search

22. Tell me about your personalized search solution.

23, Do you know dictionary tree?

24. How is spelling correction implemented?

Kafka interview questions

1. What is Kafka

Offset, MessageSize, data

3, data file segment (sequential read and write, segment command, binary search)

4. Load balancing (partition is evenly distributed among different brokers)

5. Batch delivery

6. Compression (GZIP or Snappy)

7. Consumer design

8, Consumer Group

9, How to get the list of topic topics

What is the producer and consumer command line?

11. Is consumer push or pull?

12. Talk about how Kafka maintains consumption status tracking

13. Talk about master slave synchronization

14, why do you need a message system, mysql can’t meet the requirements?

15. What does Zookeeper do for Kafka?

16. What two conditions does Kafka use to determine if a node is alive?

17. There are three key differences between Kafka and traditional MQ messaging systems

18. Talk about the three mechanisms of Kafka ack

19. How do consumers not automatically submit offsets by applications?

20. How to solve the problem of consumer failure and live lock?

24. Micro service interview questions

2. What are the advantages of microservices architecture?

3. What are the characteristics of micro-services?

4. What are the best practices for designing microservices?

5. How does the microservices architecture work?

6. What are the advantages and disadvantages of microservices architecture?

7. What are the differences between monolithic, SOA and microservice architectures?

8. What challenges do you face when using microservices architecture?

9. What are the key differences between SOA and microservices architectures?

10. What are the characteristics of micro services?

What is Domain-driven design?

12. Why domain Driven Design (DDD)?

13. What is the ubiquitous language?

What is cohesion?

15. What is coupling?

What is REST/RESTful and what is its purpose?

17. What do you know about Spring Boot?

What is a Spring-booted executor?

19. What is Spring Cloud?

20. What problems does Spring Cloud solve?

21. What is the use of WebMvcTest annotations in Spring MVC applications?

22. Can you give me some key points about breaks and microservices?

23. What are the different types of microservice testing?

24. What do you know about Distributed Transaction?

25. What is Idempotence and where is it used?

26. What is bounded context?

27. What is two-factor authentication?

What are the credential types for two-factor authentication?

29. What is a customer certificate?

30. What is the use of PACT in the microservices architecture?

Linux interview questions

1. What is the symbol for absolute paths? What are the current and upper directories represented by? What is the home directory? What command is used to switch directories?

2. How to check the current process? How do I exit? How do I view the current path?

3. How to clear the screen? How do I exit the current command? How to perform sleep? How to check when

4. What function does the Ls command perform? What parameters can be taken and what is the difference?

5. Check the commands in the file

6. List a few common Linux commands

7. How do you check your logs?

8, establish soft links (shortcuts), and hard links command

What command is used to create a directory? What command is used to create a file? What command is used to copy files?

10. What commands can be used to view file contents?

11, write files at will command? How do I output a string with a space to the screen, such as “Hello world”?

12, terminal is which folder under which file? Which command in which folder is the black hole file?

Which command is used to move files? Which command should I use for the name change?

Which command is used to copy files? What if you need to copy along with the folder? What if you need a hint function?

Which command is used to delete files? What if you need to delete both the directory and the files in the directory? What command is used to delete an empty folder?

What kinds of wildcards can be used in Linux commands? What do they mean?

17, What command is used to make statistics on the contents of a file? (Line number, word number, byte number)

18. What is the use of Grep command? How do I ignore case? How do I find a row that does not contain this string?

19. What are the states of processes in Linux? What symbols are used to represent the information displayed in PHOTOSHOP?

How do I make a command run in the background?

Article space is limited, temporarily show part of the answer to the analysis of concerns about the public number: Kylin bug.

The last

Limited space, other content will not be shown here one by one, the standard Ali P7 Java backend development interview summary of a total of 25 topics, sorting is not easy, need to small partners can pay attention to the public number to receive. Welcome everyone to exchange, like the article remember to pay attention to me like yo, thank you for your support!